chebys#
- scipy.special.chebys(n, monic=False)[source]#
Chebyshev polynomial of the second kind on \([-2, 2]\).
Defined as \(S_n(x) = U_n(x/2)\) where \(U_n\) is the nth Chebyshev polynomial of the second kind.
- Parameters:
- nint
Degree of the polynomial.
- monicbool, optional
If True, scale the leading coefficient to be 1. Default is False.
- Returns:
- Sorthopoly1d
Chebyshev polynomial of the second kind on \([-2, 2]\).
See also
chebyuChebyshev polynomial of the second kind
Notes
The polynomials \(S_n(x)\) are orthogonal over \([-2, 2]\) with weight function \(\sqrt{1 - (x/2)^2}\).
References
[1]Abramowitz and Stegun, “Handbook of Mathematical Functions” Section 22. National Bureau of Standards, 1972.
Examples
Evaluate the Chebyshev polynomial of the second kind \(S_3\) at \(x = 1\):
>>> import numpy as np >>> from scipy.special import chebys, chebyu >>> np.isclose(chebys(3)(1), -1.0) True
The polynomial \(S_n\) is a scaled Chebyshev polynomial of the second kind:
>>> x = np.linspace(-2, 2, 5) >>> np.allclose(chebys(3)(x), chebyu(3)(x/2)) True
Plot \(S_n\) for several values of \(n\):
>>> import matplotlib.pyplot as plt >>> x = np.linspace(-2, 2, 400) >>> fig, ax = plt.subplots() >>> for n in range(4): ... ax.plot(x, chebys(n)(x), label=rf"$S_{n}$") >>> ax.set_title(r"Chebyshev polynomials $S_n$") >>> ax.set_xlabel("x") >>> ax.legend(loc="best") >>> plt.show()