Main Content

Chebyshev polynomials of the second kind

`chebyshevU(`

represents the `n`

,`x`

)`n`

th degree Chebyshev polynomial of the
second kind at the point `x`

.

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]

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]

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 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')

`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.

[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.

`chebyshevT`

| `gegenbauerC`

| `hermiteH`

| `jacobiP`

| `laguerreL`

| `legendreP`