This is a pre-release version (2.0.0.dev0+git20260907.41eeb59).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / special / _orthogonal / sh_chebyu

function

scipy.special._orthogonal:sh_chebyu

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

Signature

def sh_chebyu(n, monic = False)

Summary

Shifted Chebyshev polynomial of the second kind.

Extended Summary

Defined as for 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

U : orthopoly1d

Shifted Chebyshev polynomial of the second kind.

Notes

The polynomials are orthogonal over with weight function .

Examples

Evaluate the shifted Chebyshev polynomial of the second kind :math:`U^*_3` at :math:`x = 0.75`:
import numpy as np
from scipy.special import chebyu, sh_chebyu
✓
np.isclose(sh_chebyu(3)(0.75), -1.0)
✗
np.True_
The polynomial :math:`U^*_n` is the Chebyshev polynomial :math:`U_n` shifted from :math:`[-1, 1]` to :math:`[0, 1]`:
x = np.linspace(0, 1, 5)
np.allclose(sh_chebyu(3)(x), chebyu(3)(2*x - 1))
✓
True
Plot :math:`U^*_n` for several values of :math:`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_chebyu(n)(x), label=rf"$U^*_{n}$")
ax.set_title(r"Shifted Chebyshev polynomials $U^*_n$")
ax.set_xlabel("x")
ax.legend(loc="best")
✗
<matplotlib.legend.Legend object at 0x7f3f590a2cf0>
plt.show()
✓
fig-178fa4558cf0abb3.png

Aliases

  • scipy.special.sh_chebyu