torch.special.chebyshev_polynomial_w
function chebyshev_polynomial_w<S extends Shape>(x: Tensor<S, 'float32'>, n: number | Tensor, _options?: SpecialPolynomialOptions<S>): Tensor<S, 'float32'>Computes Chebyshev polynomial of the fourth kind W_n(x).
The Chebyshev polynomials of the fourth kind are orthogonal on (-1, 1) with weight function 1/√(1+x)·√(1-x) = 1/√(1-x²), complementing the third kind (V_n). They form the complete family of Chebyshev polynomials with asymmetric weight handling. Rarely used in practice but theoretically complete. Applications include:
- Specialized boundary value problems: opposite asymmetric singularities from V_n
- Completeness of Chebyshev polynomial theory: full orthogonal basis family
- Theoretical approximation studies: comparing orthogonal families
Theoretical Role: W_n and V_n together provide an orthogonal basis for functions with different behaviors at x = -1 and x = +1. Fourth kind has opposite asymmetry from third kind.
- Opposite asymmetry: W_n(−1)=1, W_n(1)=(−1)^n (reverse of V_n)
- Same recurrence: Three-term recurrence shared with T_n, U_n, V_n
- Rare usage: Least common of the four Chebyshev kinds; mainly theoretical interest
- Completeness: V_n and W_n together form complete orthogonal pair for asymmetric problems
- Rarely used: Not commonly needed; check literature before applying
- Specialized applications: Understand asymmetry before deploying in practice
Parameters
xTensor<S, 'float32'>- Input tensor with values in [-1, 1] (opposite asymmetry from V_n)
nnumber | Tensor- Polynomial degree (non-negative integer). Can be scalar or Tensor
_optionsSpecialPolynomialOptions<S>optional
Returns
Tensor<S, 'float32'>– Tensor with W_n(x) valuesExamples
// Fourth kind evaluation
const x = torch.linspace(-1, 1, 5);
const W_0 = torch.special.chebyshev_polynomial_w(x, 0); // [1, 1, 1, 1, 1]
const W_1 = torch.special.chebyshev_polynomial_w(x, 1); // 2*x + 1
const W_2 = torch.special.chebyshev_polynomial_w(x, 2); // 4*x^2 + 2*x - 1
// Opposite boundary conditions from third kind
const x_bound = torch.tensor([-1.0, 1.0]);
const W_n = torch.special.chebyshev_polynomial_w(x_bound, 5);
// W_n(-1) = 1; W_n(1) = ±1 (opposite boundary behavior from V_n)
// Theoretical completeness of Chebyshev family
const degrees = [0, 1, 2, 3, 4];
const x_test = torch.linspace(-1, 1, 100);
// W_n, V_n together provide complete orthogonal basisSee Also
- PyTorch torch.special.chebyshev_polynomial_w()
- torch.special.chebyshev_polynomial_v - Third kind (complement, opposite asymmetry)
- torch.special.chebyshev_polynomial_t - First kind (most common reference)