Main Content

chebyshevU

Chebyshev polynomials of the second kind

Description

chebyshevU(n,x) represents the nth degree Chebyshev polynomial of the second kind at the point x.

example

Examples

First Five Chebyshev Polynomials of the Second Kind

Find the first five Chebyshev polynomials of the second kind for the variable x.

syms x
chebyshevU([0, 1, 2, 3, 4], x)
ans =
[ 1, 2*x, 4*x^2 - 1, 8*x^3 - 4*x, 16*x^4 - 12*x^2 + 1]

Chebyshev Polynomials for Numeric and Symbolic Arguments

Depending on its arguments, chebyshevU returns floating-point or exact symbolic results.

Find the value of the fifth-degree Chebyshev polynomial of the second kind at these points. Because these numbers are not symbolic objects, chebyshevU returns floating-point results.

chebyshevU(5, [1/6, 1/3, 1/2, 2/3, 4/5])
ans =
    0.8560    0.9465    0.0000   -1.2675   -1.0982

Find the value of the fifth-degree Chebyshev polynomial of the second kind for the same numbers converted to symbolic objects. For symbolic numbers, chebyshevU returns exact symbolic results.

chebyshevU(5, sym([1/6, 1/4, 1/3, 1/2, 2/3, 4/5]))
ans =
[ 208/243, 33/32, 230/243, 0, -308/243, -3432/3125]

Evaluate Chebyshev Polynomials with Floating-Point Numbers

Floating-point evaluation of Chebyshev polynomials by direct calls of chebyshevU is numerically stable. However, first computing the polynomial using a symbolic variable, and then substituting variable-precision values into this expression can be numerically unstable.

Find the value of the 500th-degree Chebyshev polynomial of the second kind at 1/3 and vpa(1/3). Floating-point evaluation is numerically stable.

chebyshevU(500, 1/3)
chebyshevU(500, vpa(1/3))
ans =
    0.8680
 
ans =
0.86797529488884242798157148968078

Now, find the symbolic polynomial U500 = chebyshevU(500, x), and substitute x = vpa(1/3) into the result. This approach is numerically unstable.

syms x
U500 = chebyshevU(500, x);
subs(U500, x, vpa(1/3))
ans =
63080680195950160912110845952.0

Approximate the polynomial coefficients by using vpa, and then substitute x = sym(1/3) into the result. This approach is also numerically unstable.

subs(vpa(U500), x, sym(1/3))
ans =
-1878009301399851172833781612544.0

Plot Chebyshev Polynomials of the Second Kind

Plot the first five Chebyshev polynomials of the second kind.

syms x y
fplot(chebyshevU(0:4, x))
axis([-1.5 1.5 -2 2])
grid on

ylabel('U_n(x)')
legend('U_0(x)', 'U_1(x)', 'U_2(x)', 'U_3(x)', 'U_4(x)', 'Location', 'Best')
title('Chebyshev polynomials of the second kind')

Figure contains an axes object. The axes object with title Chebyshev polynomials of the second kind, ylabel U indexOf n baseline (x) contains 5 objects of type functionline. These objects represent U_0(x), U_1(x), U_2(x), U_3(x), U_4(x).

Input Arguments

collapse all

Degree of the polynomial, specified as a nonnegative integer, symbolic variable, expression, or function, or as a vector or matrix of numbers, symbolic numbers, variables, expressions, or functions.

Evaluation point, specified as a number, symbolic number, variable, expression, or function, or as a vector or matrix of numbers, symbolic numbers, variables, expressions, or functions.

More About

collapse all

Chebyshev Polynomials of the Second Kind

  • Chebyshev polynomials of the second kind are defined as follows:

    U(n,x)=sin((n+1)acos(x))sin(acos(x))

    These polynomials satisfy the recursion formula

    U(0,x)=1,U(1,x)=2x,U(n,x)=2xU(n1,x)U(n2,x)

  • Chebyshev polynomials of the second kind are orthogonal on the interval -1 ≤ x ≤ 1 with respect to the weight function w(x)=1x2.

    11U(n,x)U(m,x)1x2dx={0if nmπ2if n=m.

  • Chebyshev polynomials of the second kind are a special case of the Jacobi polynomials

    U(n,x)=22nn!(n+1)!(2n+1)!P(n,12,12,x)

    and Gegenbauer polynomials

    U(n,x)=G(n,1,x)

Tips

  • chebyshevU returns floating-point results for numeric arguments that are not symbolic objects.

  • chebyshevU acts element-wise on nonscalar inputs.

  • At least one input argument must be a scalar or both arguments must be vectors or matrices of the same size. If one input argument is a scalar and the other one is a vector or a matrix, then chebyshevU expands the scalar into a vector or matrix of the same size as the other argument with all elements equal to that scalar.

References

[1] Hochstrasser, U. W. “Orthogonal Polynomials.” Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. (M. Abramowitz and I. A. Stegun, eds.). New York: Dover, 1972.

[2] Cohl, Howard S., and Connor MacKenzie. “Generalizations and Specializations of Generating Functions for Jacobi, Gegenbauer, Chebyshev and Legendre Polynomials with Definite Integrals.” Journal of Classical Analysis, no. 1 (2013): 17–33. https://doi.org/10.7153/jca-03-02.

Version History

Introduced in R2014b