sh_chebyt#
- scipy.special.sh_chebyt(n, monic=False)[source]#
Shifted Chebyshev polynomial of the first kind.
Defined as \(T^*_n(x) = T_n(2x - 1)\) for \(T_n\) 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:
- Torthopoly1d
Shifted Chebyshev polynomial of the first kind.
Notes
The polynomials \(T^*_n\) are orthogonal over \([0, 1]\) with weight function \((x - x^2)^{-1/2}\).
Array API Standard Support
sh_chebytis not in-scope for support of Python Array API Standard compatible backends other than NumPy.See Support for the array API standard for more information.
Examples
Evaluate the shifted Chebyshev polynomial of the first kind \(T^*_3\) at \(x = 0.75\):
>>> import numpy as np >>> from scipy.special import chebyt, sh_chebyt >>> np.isclose(sh_chebyt(3)(0.75), -1.0) True
The polynomial \(T^*_n\) is the Chebyshev polynomial \(T_n\) shifted from \([-1, 1]\) to \([0, 1]\):
>>> x = np.linspace(0, 1, 5) >>> np.allclose(sh_chebyt(3)(x), chebyt(3)(2*x - 1)) True
Plot \(T^*_n\) for several values of \(n\):
>>> import matplotlib.pyplot as plt >>> x = np.linspace(0, 1, 400) >>> fig, ax = plt.subplots() >>> for n in range(4): ... ax.plot(x, sh_chebyt(n)(x), label=rf"$T^*_{n}$") >>> ax.set_title(r"Shifted Chebyshev polynomials $T^*_n$") >>> ax.set_xlabel("x") >>> ax.legend(loc="best") >>> plt.show()