Legendre Polynomials

Point a problem at a sphere — the electric potential around a charged ball, the temperature over the surface of a planet, the gravitational field of a slightly squashed Earth — and something remarkable happens. The equations of physics, written in spherical coordinates, split apart. The radial part goes one way; the angular part, the dependence on the polar angle \theta, goes another. And that angular part keeps throwing up the same family of functions, over and over, no matter which physical problem you started from.

Those functions are the Legendre polynomials P_\ell(x). They are the natural "harmonics of the sphere" in the way that sines and cosines are the harmonics of a circle — a complete, orthogonal set of building blocks tailor-made for anything with spherical symmetry. This page is about that one family: where they come from, the pattern that generates them, and the orthogonality that makes them so useful.

Where they come from: Legendre's equation

When Laplace's equation \nabla^2 V = 0 is separated in spherical coordinates, the angular factor (with the substitution x=\cos\theta) must satisfy Legendre's differential equation:

(1-x^2)\,y'' - 2x\,y' + \ell(\ell+1)\,y = 0, \qquad -1 \le x \le 1.

Here \ell is a separation constant. If you attack this with a power-series solution, you find something crucial: the series generally diverges at the poles x=\pm 1 (that is, \theta = 0 and \pi) — a physical disaster — unless \ell is a non-negative integer. For each integer \ell = 0, 1, 2, \dots the infinite series terminates and collapses into a genuine polynomial of degree \ell. Those terminating solutions are the Legendre polynomials.

The first few, normalised by the standard convention P_\ell(1)=1, are:

P_0 = 1, \quad P_1 = x, \quad P_2 = \tfrac{1}{2}(3x^2 - 1), \quad P_3 = \tfrac{1}{2}(5x^3 - 3x), \quad P_4 = \tfrac{1}{8}(35x^4 - 30x^2 + 3).

The generating pattern

You do not have to solve the differential equation afresh each time. Two compact rules generate the whole infinite family.

The recurrence is the workhorse. Start with P_0 = 1 and P_1 = x; then, for example, with \ell=1:

2\,P_2 = 3x\,P_1 - 1\cdot P_0 = 3x^2 - 1 \;\Longrightarrow\; P_2 = \tfrac{1}{2}(3x^2-1).

Notice the parity: P_\ell is an even function of x when \ell is even and odd when \ell is odd, and it has exactly \ell real zeros, all inside (-1,1). Two values are worth memorising: P_\ell(1) = 1 always, and P_\ell(-1) = (-1)^\ell.

Seeing them: harmonics on the interval

The graph plots P_0 through P_4 across the interval [-1, 1]. Trace how each one behaves: they all pass through the right-hand corner (1, 1), they wiggle more as the degree rises (degree \ell crosses zero \ell times), and they stay politely bounded between -1 and 1 — exactly the good behaviour that the divergent series would have spoilt.

This picture is the heart of their usefulness. Just as any periodic signal can be built from sines and cosines, any reasonable function on [-1,1] (equivalently, any function of the polar angle on a sphere) can be expanded as a sum f(x) = \sum_\ell c_\ell\,P_\ell(x) — a Legendre series.

The property that makes them work: orthogonality

The reason you can pull off that expansion — and cleanly extract each coefficient c_\ell — is that the Legendre polynomials form an orthogonal set on [-1, 1]. The "inner product" here is the integral of the product over the interval, and it vanishes whenever the two degrees differ:

Together these give a one-line recipe for the coefficients in f(x) = \sum_\ell c_\ell P_\ell(x): multiply both sides by P_n, integrate, and every term but one drops out, leaving

c_n = \frac{2n+1}{2}\int_{-1}^{1} f(x)\,P_n(x)\,dx.

This is precisely the trick you already saw with Fourier series — orthogonality turns an infinite coupled problem into a list of independent integrals.

Worked examples

Example 1 — climb the recurrence. Build P_3 from P_1=x and P_2=\tfrac12(3x^2-1) using \ell=2:

3\,P_3 = 5x\,P_2 - 2\,P_1 = 5x\cdot\tfrac{1}{2}(3x^2-1) - 2x = \tfrac{15x^3 - 5x}{2} - 2x = \tfrac{15x^3 - 9x}{2}. P_3 = \tfrac{1}{2}(5x^3 - 3x). \checkmark

Example 2 — an endpoint value. Evaluate P_4(-1). Use P_\ell(-1)=(-1)^\ell with \ell=4: P_4(-1) = (-1)^4 = 1. (Check against the formula: \tfrac18(35 - 30 + 3) = \tfrac{8}{8} = 1.)

Example 3 — orthogonality in action. What is \int_{-1}^{1} P_2(x)\,P_5(x)\,dx? The degrees differ (2 \ne 5), so by orthogonality the integral is zero — no calculation needed. But \int_{-1}^{1}[P_2(x)]^2\,dx = \tfrac{2}{2\cdot2+1} = \tfrac{2}{5}.

Example 4 — evaluate a polynomial. Find P_2(0.5): \tfrac12(3\cdot0.25 - 1) = \tfrac12(0.75 - 1) = -0.125.

They are orthogonal but not normalised to one. Their squared norm is \int_{-1}^{1}[P_n]^2\,dx = \tfrac{2}{2n+1}, which shrinks as n grows — it is never 1. Forgetting the \tfrac{2}{2n+1} factor is the classic slip: it is exactly why the coefficient formula carries the \tfrac{2n+1}{2} out front. If you want an orthonormal set, use the rescaled \sqrt{\tfrac{2n+1}{2}}\,P_n(x).

A second warning: the plain P_\ell only handle the case with no dependence on the azimuthal angle \varphi (the "m=0" case). The full angular story needs the associated Legendre functions P_\ell^m(x), which feed into spherical harmonics.

Because of a stunning identity — the generating function. Expand the reciprocal distance between two points and out fall the Legendre polynomials, all of them at once:

\frac{1}{\sqrt{1 - 2xt + t^2}} = \sum_{\ell=0}^{\infty} P_\ell(x)\,t^{\ell}.

This is not a coincidence dressed up as algebra — it is electrostatics. Set x=\cos\theta and t=r'/r, and the left side is (up to a factor) the Coulomb potential 1/|\mathbf{r}-\mathbf{r}'| of a charge seen from far away. The expansion on the right is the famous multipole expansion: P_0 is the monopole term, P_1 the dipole, P_2 the quadrupole, and so on. Every Legendre polynomial is one rung of the multipole ladder — which is why they are unavoidable in electromagnetism and gravitation.