scipy 1.8.0 Pypi GitHub Homepage
Other Docs
NotesParametersReturnsBackRef
laguerre(n, monic=False)

Defined to be the solution of

$$x\frac{d^2}{dx^2}L_n + (1 - x)\frac{d}{dx}L_n + nL_n = 0;$$

$L_n$ is a polynomial of degree $n$ .

Notes

The polynomials $L_n$ are orthogonal over $[0, \infty)$ with weight function $e^{-x}$ .

Parameters

n : int

Degree of the polynomial.

monic : bool, optional

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

Returns

L : orthopoly1d

Laguerre Polynomial.

Laguerre polynomial.

See Also

genlaguerre

Generalized (associated) Laguerre polynomial.

Examples

The Laguerre polynomials $L_n$ are the special case $\alpha = 0$ of the generalized Laguerre polynomials $L_n^{(\alpha)}$ . Let's verify it on the interval $[-1, 1]$ :

>>> from scipy.special import genlaguerre
... from scipy.special import laguerre
... x = np.arange(-1.0, 1.0, 0.01)
... np.allclose(genlaguerre(3, 0)(x), laguerre(3)(x)) True

The polynomials $L_n$ also satisfy the recurrence relation:

$$(n + 1)L_{n+1}(x) = (2n +1 -x)L_n(x) - nL_{n-1}(x)$$

This can be easily checked on $[0, 1]$ for $n = 3$ :

>>> from scipy.special import laguerre
... x = np.arange(0.0, 1.0, 0.01)
... np.allclose(4 * laguerre(4)(x),
...  (7 - x) * laguerre(3)(x) - 3 * laguerre(2)(x)) True

This is the plot of the first few Laguerre polynomials $L_n$ :

>>> import matplotlib.pyplot as plt
... from scipy.special import laguerre
... x = np.arange(-1.0, 5.0, 0.01)
... fig, ax = plt.subplots()
... ax.set_ylim(-5.0, 5.0)
... ax.set_title(r'Laguerre polynomials $L_n$')
... for n in np.arange(0, 5):
...  ax.plot(x, laguerre(n)(x), label=rf'$L_{n}$')
... plt.legend(loc='best')
... plt.show()
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.special._orthogonal.genlaguerre scipy.special._orthogonal.laguerre

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/special/_orthogonal.py#702
type: <class 'function'>
Commit: