SciPy

scipy.special.gegenbauer

scipy.special.gegenbauer(n, alpha, monic=False)[source]

Gegenbauer (ultraspherical) polynomial.

Defined to be the solution of

\[(1 - x^2)\frac{d^2}{dx^2}C_n^{(\alpha)} - (2\alpha + 1)x\frac{d}{dx}C_n^{(\alpha)} + n(n + 2\alpha)C_n^{(\alpha)} = 0\]

for \(\alpha > -1/2\); \(C_n^{(\alpha)}\) is a polynomial of degree \(n\).

Parameters:
n : int

Degree of the polynomial.

monic : bool, optional

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

Returns:
C : orthopoly1d

Gegenbauer polynomial.

Notes

The polynomials \(C_n^{(\alpha)}\) are orthogonal over \([-1,1]\) with weight function \((1 - x^2)^{(\alpha - 1/2)}\).