fn

chebyshev_polynomial_u

Tensor
chebyshev_polynomial_u(x: Tensor, n: int)
source

Chebyshev polynomial of the second kind, Un(x)U_n(x).

The U polynomials are orthogonal on [1,1][-1, 1] with weight 1x2\sqrt{1 - x^2}. They appear naturally as the derivative of the T polynomials (up to a normalisation) and in Gauss-Chebyshev quadrature of the second kind.

Parameters

xTensor
Argument tensor; any floating-point dtype.
nint
Non-negative polynomial degree.

Returns

Tensor

Un(x)U_n(x) element-wise, same shape and dtype as x.

Notes

Defined by Un(cosθ)=sin((n+1)θ)/sinθU_n(\cos\theta) = \sin((n+1)\theta)/\sin\theta and obeying

U0(x)=1,U1(x)=2x,Uk+1(x)=2xUk(x)Uk1(x).U_0(x) = 1, \quad U_1(x) = 2x, \quad U_{k+1}(x) = 2x\, U_k(x) - U_{k-1}(x).

Linked to T by Tn(x)=nUn1(x)T_n'(x) = n\, U_{n-1}(x). Raises ValueError for n < 0.

Examples

>>> import lucid
>>> from lucid.special import chebyshev_polynomial_u
>>> chebyshev_polynomial_u(lucid.tensor([-1.0, 0.0, 0.5, 1.0]), n=3)
Tensor([-4.0000, 0.0000, 0.0000, 4.0000])