Skip to content
fn

chebyshev_polynomial_u

→Tensor
chebyshev_polynomial_u(x: TensorOrScalar, n: TensorOrScalar)

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

The U polynomials are orthogonal on [−1,1][-1, 1] with weight 1−x2\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 | Scalar
Where UnU_n is evaluated, of any real dtype.
nTensor | Scalar
Degree of UnU_n, for every element or one per element; truncated toward zero, and a negative degree gives 0.

Returns

Tensor

Un(x)U_n(x) element-wise, broadcast over x and n.

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)=2x Uk(x)−Uk−1(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)=n Un−1(x)T_n'(x) = n\, U_{n-1}(x).

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., -0., -1., 4.])

Used by 1