Categories: Mathematics.

# Legendre polynomials

The **Legendre polynomials** are a set of functions that sometimes arise in physics.
They are the eigenfunctions $u(x)$ of **Legendre’s differential equation**,
which is a (Sturm-Liouville)
eigenvalue problem for $\ell (\ell + 1)$,
where $\ell$ turns out to be a non-negative integer:

The $\ell$th-degree Legendre polynomial $P_\ell(x)$
is given in the form of a *Rodrigues’ formula* by:

The first handful of Legendre polynomials $P_\ell(x)$ are therefore as follows:

$\begin{gathered} P_0(x) = 1 \qquad \quad P_1(x) = x \qquad \quad P_2(x) = \frac{1}{2} (3 x^2 - 1) \\ P_3(x) = \frac{1}{2} (5 x^3 - 3 x) \qquad \quad P_4(x) = \frac{1}{8} (35 x^4 - 30 x^2 + 3) \end{gathered}$And then more $P_\ell$ can be computed quickly
using **Bonnet’s recursion formula**:

The derivative of a given $P_\ell$ can be calculated recursively using the following relation:

$\begin{aligned} \boxed{ \dv{}{x}P_{\ell + 1} = (\ell + 1) P_\ell(x) + x \dv{}{x}P_\ell(x) } \end{aligned}$Noteworthy is that the Legendre polynomials are mutually orthogonal for $x \in [-1, 1]$:

$\begin{aligned} \boxed{ \Inprod{P_m}{P_n} = \int_{-1}^{1} P_m(x) \: P_n(x) \dd{x} = \frac{2}{2 n + 1} \delta_{nm} } \end{aligned}$As was to be expected from Sturm-Liouville theory. Likewise, they form a complete basis in the Hilbert space of piecewise continuous functions $f(x)$ on $x \in [-1, 1]$, meaning:

$\begin{aligned} \boxed{ f(x) = \sum_{\ell = 0}^\infty a_\ell P_\ell(x) = \sum_{\ell = 0}^\infty \frac{\Inprod{P_\ell}{f}}{\Inprod{P_\ell}{P_\ell}} P_\ell(x) } \end{aligned}$Each Legendre polynomial $P_\ell$ comes with
a set of **associated Legendre polynomials** $P_\ell^m(x)$
of order $m$ and degree $\ell$.
These are the non-singular solutions of the **general Legendre equation**,
where $m$ and $\ell$ are integers satisfying $-\ell \le m \le \ell$:

The $\ell$th-degree $m$th-order associated Legendre polynomial $P_\ell^m$ is as follows for $m \ge 0$:

$\begin{aligned} P_\ell^m(x) = (-1)^m (1 - x^2)^{m/2} \dvn{m}{}{x}P_\ell(x) \end{aligned}$Here, the $(-1)^m$ in front is called the **Condon-Shortley phase**,
and is omitted by some authors.
For negative orders $m$,
an additional constant factor is necessary:

Beware, the name is misleading: if $m$ is odd, then $P_\ell^m$ is actually not a polynomial. Moreover, not all $P_\ell^m$ are mutually orthogonal (but some are).