torch.special.chebyshev_polynomial_u
function chebyshev_polynomial_u<S extends Shape>(x: Tensor<S, 'float32'>, n: number | Tensor, _options?: SpecialPolynomialOptions<S>): Tensor<S, 'float32'>Computes Chebyshev polynomial of the second kind U_n(x).
The Chebyshev polynomials of the second kind are orthogonal on [-1, 1] with weight function √(1-x²), complementary to the first kind (T_n). They have different growth and extrema properties: larger oscillations at interval boundaries but smaller growth outside [-1, 1]. Numerically important for:
- Orthogonal polynomial approximation: weight √(1-x²) appears naturally in angular momentum integrals
- Quantum mechanics: radial wave functions, spherical harmonics decomposition
- Signal processing: specialized filter designs requiring different sidelobe structure
- Chebyshev-Fourier series: approximating derivatives and boundary value problems
- Approximation theory: function reconstruction with different error distribution
Relationship to Sine: U_n(cos θ) = sin((n+1)θ) / sin(θ), connecting to frequency analysis. Second kind has higher amplitude near boundaries and different spectral properties than first kind.
Key Difference from T_n: While T_n achieves minimum maximum deviation, U_n is the unique monic polynomial of degree n minimizing ∫_{-1}^{1} √(1-x²) |p(x)|² dx. Used when boundary behavior matters.
- Boundary amplitude: U_n(1) = n+1 linear growth; U_n(-1) = (-1)^n(n+1) alternating
- Weight function: √(1-x²) weight means integrals at boundaries are suppressed
- Same recurrence as T_n: Both share the 2xU_n - U_n-1 recurrence (numerically efficient)
- Relationship to sine: U_n(cos θ) = sin((n+1)θ)/sin(θ) for frequency analysis
- Outside [-1, 1]: Exponential growth; U_n(x) ≈ (x + √(x²-1))^n+1 / √(x²-1) for |x| 1
- Asymptotic behavior: For large n and fixed x ∈ (-1, 1), U_n(x) ~ √((n+1)/2) * (eigenvalue)^n structure
- Near boundaries: Weight function √(1-x²) → 0 near x = ±1; be careful with orthogonality
- Large n extrapolation: Growth exponential outside interval; numerical overflow for |x| 1
- Different orthogonality: Not orthogonal with T_n; different weight function than T_n
Parameters
xTensor<S, 'float32'>- Input tensor with values in [-1, 1] (defined for all real x; behavior outside changes qualitatively)
nnumber | Tensor- Polynomial degree (non-negative integer). Can be scalar or Tensor
_optionsSpecialPolynomialOptions<S>optional
Returns
Tensor<S, 'float32'>– Tensor with U_n(x) valuesExamples
// Basic second-kind evaluation
const x = torch.linspace(-1, 1, 5);
const U_0 = torch.special.chebyshev_polynomial_u(x, 0); // [1, 1, 1, 1, 1]
const U_1 = torch.special.chebyshev_polynomial_u(x, 1); // 2*x
const U_2 = torch.special.chebyshev_polynomial_u(x, 2); // 4*x^2 - 1
// Boundary value comparison with first kind
const x_bound = torch.tensor([1.0]);
const T_n_at_1 = torch.special.chebyshev_polynomial_t(x_bound, 5); // T_5(1) = 1
const U_n_at_1 = torch.special.chebyshev_polynomial_u(x_bound, 5); // U_5(1) = 6
// Second kind grows linearly at boundary (n+1), vs constant for first kind
// Quantum mechanics: basis for angular momentum eigenfunctions
const cos_theta = torch.linspace(-1, 1, 100); // cos(θ) values
const n_ell = 3; // Angular momentum quantum number
const U_basis = torch.special.chebyshev_polynomial_u(cos_theta, n_ell);
// Used in spherical harmonic expansion with Y_ℓ^m proportional to P_ℓ^m * U-based factors
// Spectral method for differential equations with weight √(1-x²)
const xNodes = torch.linspace(-1, 1, 20);
const nModes = 5;
const u_expansion = torch.special.chebyshev_polynomial_u(xNodes, nModes);
// Forms orthogonal basis for weighted L²[-1,1] approximation
// Comparison of growth inside vs outside interval
const xInside = torch.tensor([0.5]); // Inside [-1, 1]
const xOutside = torch.tensor([2.0]); // Outside
const U_inside = torch.special.chebyshev_polynomial_u(xInside, 10); // Moderate value
const U_outside = torch.special.chebyshev_polynomial_u(xOutside, 10); // Exponential growthSee Also
- PyTorch torch.special.chebyshev_polynomial_u()
- torch.special.chebyshev_polynomial_t - First kind T_n with 1/√(1-x²) weight
- torch.special.chebyshev_polynomial_v - Third kind V_n
- torch.special.chebyshev_polynomial_w - Fourth kind W_n (rare)