The Legendre polynomials are a set of functions that sometimes arise in physics.
They are the eigenfunctions of Legendre’s differential equation,
which is a (Sturm-Liouville)
eigenvalue problem for ,
where turns out to be a non-negative integer:
The th-degree Legendre polynomial
is given in the form of a Rodrigues’ formula by:
The first handful of Legendre polynomials are therefore as follows:
And then more can be computed quickly
using Bonnet’s recursion formula:
The derivative of a given can be calculated recursively
using the following relation:
Noteworthy is that the Legendre polynomials
are mutually orthogonal for :
As was to be expected from Sturm-Liouville theory.
Likewise, they form a complete basis in the
of piecewise continuous functions on ,
Each Legendre polynomial comes with
a set of associated Legendre polynomials
of order and degree .
These are the non-singular solutions of the general Legendre equation,
where and are integers satisfying :
The th-degree th-order associated Legendre polynomial
is as follows for :
Here, the in front is called the Condon-Shortley phase,
and is omitted by some authors.
For negative orders ,
an additional constant factor is necessary:
Beware, the name is misleading:
if is odd, then is actually not a polynomial.
Moreover, not all are mutually orthogonal
(but some are).