In mathematics, the **associated Legendre polynomials** are the canonical solutions of the **general Legendre equation**

or equivalently

where the indices *ℓ* and *m* (which are integers) are referred to as the degree and order of the associated Legendre polynomial respectively. This equation has nonzero solutions that are nonsingular on [−1, 1] only if *ℓ* and *m* are integers with 0 ≤ *m* ≤ *ℓ*, or with trivially equivalent negative values. When in addition *m* is even, the function is a polynomial. When *m* is zero and *ℓ* integer, these functions are identical to the Legendre polynomials. In general, when *ℓ* and *m* are integers, the regular solutions are sometimes called "associated Legendre polynomials", even though they are not polynomials when *m* is odd. The fully general class of functions with arbitrary real or complex values of *ℓ* and *m* are Legendre functions. In that case the parameters are usually labelled with Greek letters.

The Legendre ordinary differential equation is frequently encountered in physics and other technical fields. In particular, it occurs when solving Laplace's equation (and related partial differential equations) in spherical coordinates. Associated Legendre polynomials play a vital role in the definition of spherical harmonics.

These functions are denoted , where the superscript indicates the order and not a power of *P*. Their most straightforward definition is in terms
of derivatives of ordinary Legendre polynomials (*m* ≥ 0)

The (−1)^{m} factor in this formula is known as the Condon–Shortley phase. Some authors omit it. That the functions described by this equation satisfy the general Legendre differential equation with the indicated values of the parameters *ℓ* and *m* follows by differentiating *m* times the Legendre equation for *P*_{ℓ}:^{[1]}

Moreover, since by Rodrigues' formula,

the

This equation allows extension of the range of *m* to: −*ℓ* ≤ *m* ≤ *ℓ*. The definitions of *P*_{ℓ}^{±m}, resulting from this expression by substitution of ±*m*, are proportional. Indeed, equate the coefficients of equal powers on the left and right hand side of

then it follows that the proportionality constant is

so that

The following alternative notations are also used in literature:^{[2]}

The Associated Legendre Polynomial can also be written as:^{[citation needed]}

with simple monomials and the generalized form of the binomial coefficient.

The associated Legendre polynomials are not mutually orthogonal in general. For example, is not orthogonal to . However, some subsets are orthogonal. Assuming 0 ≤ *m* ≤ *ℓ*, they satisfy the orthogonality condition for fixed *m*:

Where *δ*_{k,ℓ} is the Kronecker delta.

Also, they satisfy the orthogonality condition for fixed *ℓ*:

The differential equation is clearly invariant under a change in sign of *m*.

The functions for negative *m* were shown above to be proportional to those of positive *m*:

(This followed from the Rodrigues' formula definition. This definition also makes the various recurrence formulas work for positive or negative m.)

The differential equation is also invariant under a change from ℓ to −*ℓ* − 1, and the functions for negative ℓ are defined by

From their definition, one can verify that the Associated Legendre functions are either even or odd according to

The first few associated Legendre functions, including those for negative values of *m*, are:

These functions have a number of recurrence properties:

Helpful identities (initial values for the first recursion):

with !! the double factorial.

The integral over the product of three associated Legendre polynomials (with orders matching as shown below) is a necessary ingredient when developing products of Legendre polynomials into a series linear in the Legendre polynomials. For instance, this turns out to be necessary when doing atomic calculations of the Hartree–Fock variety where matrix elements of the Coulomb operator are needed. For this we have Gaunt's formula ^{[3]}

This formula is to be used under the following assumptions:

- the degrees are non-negative integers
- all three orders are non-negative integers
- is the largest of the three orders
- the orders sum up
- the degrees obey

Other quantities appearing in the formula are defined as

The integral is zero unless

- the sum of degrees is even so that is an integer
- the triangular condition is satisfied

Dong and Lemus (2002)^{[4]} generalized the derivation of this formula to integrals over a product of an arbitrary number of associated Legendre polynomials.

Main article: Legendre function |

These functions may actually be defined for general complex parameters and argument:

where is the gamma function and is the hypergeometric function

They are called the **Legendre functions** when defined in this more general way. They satisfy the same differential equation as before:

Since this is a second order differential equation, it has a second solution, , defined as:

and both obey the various recurrence formulas given previously.

These functions are most useful when the argument is reparameterized in terms of angles, letting :

Using the relation , the list given above yields the first few polynomials, parameterized this way, as:

The orthogonality relations given above become in this formulation:
for fixed *m*, are orthogonal, parameterized by θ over , with weight :

Also, for fixed *ℓ*:

In terms of θ, are solutions of

More precisely, given an integer *m*0, the above equation has
nonsingular solutions only when for *ℓ*
an integer ≥ *m*, and those solutions are proportional to
.

Main article: Spherical harmonics |

In many occasions in physics, associated Legendre polynomials in terms of angles occur where spherical symmetry is involved. The colatitude angle in spherical coordinates is
the angle used above. The longitude angle, , appears in a multiplying factor. Together, they make a set of functions called spherical harmonics. These functions express the symmetry of the two-sphere under the action of the Lie group SO(3).^{[citation needed]}

What makes these functions useful is that they are central to the solution of the equation on the surface of a sphere. In spherical coordinates θ (colatitude) and φ (longitude), the Laplacian is

When the partial differential equation

is solved by the method of separation of variables, one gets a φ-dependent part or for integer m≥0, and an equation for the θ-dependent part

for which the solutions are with and .

Therefore, the equation

has nonsingular separated solutions only when , and those solutions are proportional to

and

For each choice of *ℓ*, there are 2ℓ + 1 functions
for the various values of *m* and choices of sine and cosine.
They are all orthogonal in both *ℓ* and *m* when integrated over the
surface of the sphere.

The solutions are usually written in terms of complex exponentials:

The functions are the spherical harmonics, and the quantity in the square root is a normalizing factor.
Recalling the relation between the associated Legendre functions of positive and negative

The spherical harmonic functions form a complete orthonormal set of functions in the sense of Fourier series. Workers in the fields of geodesy, geomagnetism and spectral analysis use a different phase and normalization factor than given here (see spherical harmonics).

When a 3-dimensional spherically symmetric partial differential equation is solved by the method of separation of variables in spherical coordinates, the part that remains after removal of the radial part is typically of the form

and hence the solutions are spherical harmonics.

The Legendre polynomials are closely related to hypergeometric series. In the form of spherical harmonics, they express the symmetry of the two-sphere under the action of the Lie group SO(3). There are many other Lie groups besides SO(3), and analogous generalizations of the Legendre polynomials exist to express the symmetries of semi-simple Lie groups and Riemannian symmetric spaces. Crudely speaking, one may define a Laplacian on symmetric spaces; the eigenfunctions of the Laplacian can be thought of as generalizations of the spherical harmonics to other settings.