This is a pre-release version (latest).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy latest / scipy / special / _orthogonal / chebys

function

scipy.special._orthogonal:chebys

source: build-install/usr/lib/python3.14/site-packages/scipy/special/_orthogonal.py:2901

Signature

def chebys(n, monic = False)

Summary

Chebyshev polynomial of the second kind on .

Extended Summary

Defined as where is the nth Chebyshev polynomial of the second kind.

Parameters

n : int

Degree of the polynomial.

monic : bool, optional

If True, scale the leading coefficient to be 1. Default is False.

Returns

S : orthopoly1d

Chebyshev polynomial of the second kind on .

Notes

The polynomials are orthogonal over with weight function .

Examples

Evaluate the Chebyshev polynomial of the second kind :math:`S_3` at :math:`x = 1`:
import numpy as np
from scipy.special import chebys, chebyu
✓
np.isclose(chebys(3)(1), -1.0)
✗
np.True_
The polynomial :math:`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 :math:`S_n` for several values of :math:`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")
✗
<matplotlib.legend.Legend object at 0x7f3f687d9160>
plt.show()
✓
fig-a6a633af49c3a265.png

See also

chebyu

Chebyshev polynomial of the second kind

Aliases

  • scipy.special.chebys