Skip to content
fn

chebyshev_polynomial_w

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

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

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

Parameters

xTensor | Scalar
Where WnW_n is evaluated, of any real dtype.
nTensor | Scalar
Degree of WnW_n, for every element or one per element; truncated toward zero, and a negative degree gives 0.

Returns

Tensor

Wn(x)W_n(x) element-wise, broadcast over x and n.

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)=2x Wk(x)−Wk−1(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).

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

Used by 1