fn

chebyshev_polynomial_w

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

Chebyshev polynomial of the fourth kind, Wn(x)W_n(x).

The W polynomials are orthogonal on [1,1][-1, 1] with weight (1x)/(1+x)\sqrt{(1 - x)/(1 + x)} — the mirror image of the V family — and partner with V under the substitution xxx \mapsto -x.

Parameters

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

Returns

Tensor

Wn(x)W_n(x) element-wise, same shape and dtype as x.

Notes

Half-angle definition

Wn(cosθ)=sin((n+12)θ)sin(θ/2),W_n(\cos\theta) = \frac{\sin((n + \tfrac{1}{2})\theta)} {\sin(\theta/2)},

with the recurrence

W0(x)=1,W1(x)=2x+1,Wk+1(x)=2xWk(x)Wk1(x).W_0(x) = 1, \quad W_1(x) = 2x + 1, \quad W_{k+1}(x) = 2x\, W_k(x) - W_{k-1}(x).

Symmetry relation: Wn(x)=(1)nVn(x)W_n(-x) = (-1)^n V_n(x). Raises ValueError for n < 0.

Examples

>>> import lucid
>>> from lucid.special import chebyshev_polynomial_w
>>> chebyshev_polynomial_w(lucid.tensor([-1.0, 0.0, 1.0]), n=2)
Tensor([1.0000, -1.0000, 3.0000])