chebyc#
- scipy.special.chebyc(n, monic=False)[source]#
Chebyshev polynomial of the first kind on \([-2, 2]\).
Defined as \(C_n(x) = 2T_n(x/2)\), where \(T_n\) is the nth Chebyshev polynomial of the first kind.
- Parameters:
- nint
Degree of the polynomial.
- monicbool, optional
If True, scale the leading coefficient to be 1. Default is False.
- Returns:
- Corthopoly1d
Chebyshev polynomial of the first kind on \([-2, 2]\).
See also
chebytChebyshev polynomial of the first kind.
Notes
The polynomials \(C_n(x)\) are orthogonal over \([-2, 2]\) with weight function \(1/\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 \(C_3\) at \(x = 1\):
>>> import numpy as np >>> from scipy.special import chebyc, chebyt >>> np.isclose(chebyc(3)(1), -2.0) True
The polynomial \(C_n\) is a scaled Chebyshev polynomial of the first kind:
>>> x = np.linspace(-2, 2, 5) >>> np.allclose(chebyc(3)(x), 2 * chebyt(3)(x/2)) True
Plot \(C_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, chebyc(n)(x), label=rf"$C_{n}$") >>> ax.set_title(r"Chebyshev polynomials $C_n$") >>> ax.set_xlabel("x") >>> ax.legend(loc="best") >>> plt.show()