Special functions · Orthogonal polynomials

Legendre Polynomials

The distance between two points, \( \frac{1}{|\mathbf r - \mathbf r'|} \), expanded in powers of the ratio of their distances from the origin, produces a family of polynomials in the cosine of the angle between them. Legendre found them in 1782 while computing the gravitational attraction of planets. Today they are the standard example of orthogonal polynomials: they play the role on \([-1, 1]\) that sines and cosines play in Fourier series, and they appear whenever a problem has spherical symmetry.

1. Definition by a generating function

1° Legendre polynomials The Legendre polynomials \(P_n(x)\), \(n = 0, 1, 2, \dots\), are defined by the generating function \[ G(t, x) = \frac{1}{\sqrt{1 - 2xt + t^2}} = \sum_{n=0}^\infty P_n(x)\,t^n \qquad (|x| \le 1,\ |t| < 1), \] where the branch of \(G(t, x)\) with \(G(0, x) = 1\) is taken.

(The book writes only the condition \(|x| \le 1\); the expansion in powers of \(t\) also needs \( |t| < 1 \). For \(|x| \le 1\), the zeros of \( 1 - 2xt + t^2 \) are \( t = x \pm i\sqrt{1 - x^2} \), which lie on the unit circle, so the radius of convergence is exactly \(1\).)

Where it comes from. For two points at distances \(r\) and \(r' < r\) from the origin, with angle \(\theta\) between them, the law of cosines gives

\[ \frac{1}{|\mathbf r - \mathbf r'|} = \frac{1}{\sqrt{r^2 - 2rr'\cos\theta + r'^2}} = \frac1r\cdot\frac{1}{\sqrt{1 - 2xt + t^2}}, \qquad x = \cos\theta,\ t = \frac{r'}{r}. \]

So \( \frac{1}{|\mathbf r - \mathbf r'|} = \frac1r\sum P_n(\cos\theta)\big(\frac{r'}{r}\big)^n \): the potential of a point mass or charge, seen from far away, splits into a monopole term (\(P_0\)), a dipole term (\(P_1\)), a quadrupole term (\(P_2\)), and so on. This is the multipole expansion of physics.

Example 1 · The first polynomials Expanding \( (1 - u)^{-1/2} = 1 + \frac12u + \frac38u^2 + \cdots \) with \( u = 2xt - t^2 \) and collecting powers of \(t\): \[ P_0 = 1,\quad P_1 = x,\quad P_2 = \tfrac12(3x^2 - 1),\quad P_3 = \tfrac12(5x^3 - 3x),\quad P_4 = \tfrac18(35x^4 - 30x^2 + 3). \]

Two quick facts from the generating function:

1 −1 −1 1 P₀ P₁ P₂ P₃ P₄
Figure 1. Legendre polynomials \(P_0\) to \(P_4\) on \([-1, 1]\). All take the value \(1\) at \(x = 1\), stay between \(-1\) and \(1\) on the interval, and \(P_n\) has exactly \(n\) zeros there.

2. The explicit formula

2° 1) Explicit formula \[ P_n(x) = \frac{1}{2^n}\sum_{k=0}^{[n/2]}(-1)^k\frac{(2n - 2k)!}{(n - k)!\,(n - k)!}\binom{n - k}{k}x^{n-2k} = \frac{1}{2^n}\sum_{k=0}^{[n/2]}\frac{(-1)^k(2n - 2k)!}{k!\,(n - k)!\,(n - 2k)!}x^{n-2k}. \]

(The two forms agree, since \( \binom{n - k}{k} = \frac{(n - k)!}{k!\,(n - 2k)!} \).) Only powers \(x^n, x^{n-2}, x^{n-4}, \dots\) occur, matching the parity. The leading coefficient (\(k = 0\)) is \( \frac{(2n)!}{2^n(n!)^2} \); for \(n = 2\): \( \frac{24}{4\cdot4} = \frac32 \). ✓

Example 2 · \(P_3\) from the formula \( k = 0 \): \( \frac{1}{8}\cdot\frac{6!}{0!\,3!\,3!}x^3 = \frac{20}{8}x^3 = \frac52x^3 \). \( k = 1 \): \( \frac18\cdot\frac{-4!}{1!\,2!\,1!}x = -\frac{12}{8}x = -\frac32x \). So \( P_3 = \frac52x^3 - \frac32x \). ✓

3. Rodrigues' formula

2° 2) Rodrigues' formula \[ P_n(x) = \frac{1}{n!\,2^n}\frac{d^n}{dx^n}(x^2 - 1)^n. \]

This is the most compact description. Expanding \( (x^2 - 1)^n = \sum_k\binom nk(-1)^kx^{2n-2k} \) and differentiating \(n\) times gives the explicit formula above, term by term. Rodrigues' formula is the key to orthogonality (Section 5), because \( (x^2 - 1)^n \) vanishes to order \(n\) at \(x = \pm1\), so all its derivatives of order less than \(n\) vanish there.

Example 3 \( n = 2 \): \( \frac{1}{8}\frac{d^2}{dx^2}(x^4 - 2x^2 + 1) = \frac18(12x^2 - 4) = \frac12(3x^2 - 1) \). ✓

4. The three-term recurrence

2° 3) Recurrence (Bonnet) \[ (n + 1)P_{n+1}(x) - (2n + 1)\,x\,P_n(x) + nP_{n-1}(x) = 0. \]

Derivation from the generating function. Differentiate \( G = (1 - 2xt + t^2)^{-1/2} \) with respect to \(t\):

\[ (1 - 2xt + t^2)\frac{\partial G}{\partial t} = (x - t)\,G. \]

Substitute \( G = \sum P_nt^n \) and \( \frac{\partial G}{\partial t} = \sum nP_nt^{n-1} \), and compare the coefficients of \(t^n\): \( (n + 1)P_{n+1} - 2xnP_n + (n - 1)P_{n-1} = xP_n - P_{n-1} \), which rearranges to the recurrence.

The recurrence is the practical way to compute Legendre polynomials (and their numerical values): starting from \(P_0 = 1\), \(P_1 = x\), each step needs only the two previous ones.

Example 4 · \(P_4\) from the recurrence With \(n = 3\): \( 4P_4 = 7xP_3 - 3P_2 = 7x\cdot\frac{5x^3 - 3x}{2} - 3\cdot\frac{3x^2 - 1}{2} = \frac{35x^4 - 30x^2 + 3}{2} \), so \( P_4 = \frac18(35x^4 - 30x^2 + 3) \). ✓

5. Orthogonality

2° 4) Orthogonality \[ \int_{-1}^1P_m(x)\,P_n(x)\,dx = \frac{2}{2n + 1}\,\delta_{mn}, \qquad \delta_{mn} = \begin{cases}1, & m = n,\\ 0, & m \ne n.\end{cases} \]

Why the integral is zero for \(m < n\). Use Rodrigues' formula for \(P_n\) and integrate by parts \(n\) times, moving derivatives from \( (x^2 - 1)^n \) onto \(P_m\):

\[ \int_{-1}^1P_m\,\frac{d^n}{dx^n}(x^2 - 1)^n\,dx = (-1)^n\int_{-1}^1P_m^{(n)}(x)\,(x^2 - 1)^n\,dx. \]

The boundary terms vanish because each lower derivative of \( (x^2 - 1)^n \) is zero at \(\pm1\). And \( P_m^{(n)} = 0 \), since \(P_m\) has degree \(m < n\). In fact the argument shows more: \(P_n\) is orthogonal to every polynomial of degree less than \(n\).

For \(m = n\), the same integration by parts gives \( \frac{(2n)!}{2^n(n!)^2}\cdot\frac{1}{2^nn!}\cdot(2n)!\int_{-1}^1(1 - x^2)^n\,dx \), and the last integral is a Beta integral; everything simplifies to \( \frac{2}{2n + 1} \). (Check: \( \int_{-1}^1P_3^2\,dx = \frac27 \).)

Orthogonality is exactly the property of \(\sin nx\), \(\cos nx\) on \([-\pi, \pi]\) that makes Fourier series work, and it has the same consequence here (Section 7).

6. Legendre's differential equation

2° 5) Legendre's equation \(P_n(x)\) is a particular solution of \[ (x^2 - 1)\,y'' + 2x\,y' - n(n + 1)\,y = 0 \qquad (n = 0, 1, 2, \dots), \] equivalently \( \big((1 - x^2)y'\big)' + n(n + 1)y = 0 \).

Why: let \( u = (x^2 - 1)^n \). Then \( (x^2 - 1)u' = 2nxu \). Differentiate this \(n + 1\) times with Leibniz's rule:

\[ (x^2 - 1)u^{(n+2)} + 2x(n + 1)u^{(n+1)} + n(n + 1)u^{(n)} = 2nx\,u^{(n+1)} + 2n(n + 1)u^{(n)}, \]

i.e. \( (x^2 - 1)u^{(n+2)} + 2xu^{(n+1)} - n(n + 1)u^{(n)} = 0 \). Since \(P_n\) is a constant multiple of \(u^{(n)}\), it satisfies the equation.

This equation arises when Laplace's equation \(\Delta V = 0\) is separated in spherical coordinates for axially symmetric problems, with \(x = \cos\theta\). The general solution is \( y = c_1P_n(x) + c_2Q_n(x) \), where the second solution \(Q_n\) (Legendre function of the second kind) has logarithmic singularities at \(x = \pm1\). That is why physically meaningful solutions, finite at the poles \(\theta = 0, \pi\), are the polynomials \(P_n\): "particular solution" in the book means exactly this one.

7. Legendre series

Just as a function on \([-\pi, \pi]\) is expanded in a Fourier series, a function on \([-1, 1]\) can be expanded in Legendre polynomials:

\[ f(x) = \sum_{n=0}^\infty c_nP_n(x), \qquad c_n = \frac{2n + 1}{2}\int_{-1}^1f(x)\,P_n(x)\,dx. \]

The formula for \(c_n\) follows from orthogonality: multiply by \(P_m\) and integrate; only the term \(n = m\) survives. Truncating the series gives the best approximation of \(f\) by polynomials of a given degree in the sense of least squares (mean-square error) on \([-1, 1]\).

Example 5 · Expanding \(|x|\) \(|x|\) is even, so only even \(n\) appear. \( c_0 = \frac12\int_{-1}^1|x|\,dx = \frac12 \), \( c_2 = \frac52\int_{-1}^1|x|\frac{3x^2 - 1}{2}dx = \frac58 \), \( c_4 = -\frac{3}{16} \). Hence \[ |x| \approx \frac12P_0(x) + \frac58P_2(x) - \frac3{16}P_4(x) + \cdots \] Already the first two terms, \( \frac12 + \frac58\cdot\frac{3x^2 - 1}{2} = \frac{15x^2 + 3}{16} \), give the best quadratic approximation of \(|x|\) on \([-1, 1]\).

A polynomial has a finite Legendre expansion. For example \( x^2 = \frac13P_0 + \frac23P_2 \) and \( x^3 = \frac35P_1 + \frac25P_3 \).

8. Summary

PropertyFormula
Generating function\( \frac{1}{\sqrt{1 - 2xt + t^2}} = \sum P_n(x)t^n \), \(|t| < 1\)
Explicit\( P_n = \frac{1}{2^n}\sum_k\frac{(-1)^k(2n - 2k)!}{k!(n - k)!(n - 2k)!}x^{n-2k} \)
Rodrigues\( P_n = \frac{1}{2^nn!}\frac{d^n}{dx^n}(x^2 - 1)^n \)
Recurrence\( (n + 1)P_{n+1} = (2n + 1)xP_n - nP_{n-1} \)
Orthogonality\( \int_{-1}^1P_mP_n\,dx = \frac{2}{2n + 1}\delta_{mn} \)
Differential equation\( (x^2 - 1)y'' + 2xy' - n(n + 1)y = 0 \)
Values\( P_n(1) = 1 \), \( P_n(-x) = (-1)^nP_n(x) \)
Legendre series\( c_n = \frac{2n + 1}{2}\int_{-1}^1fP_n\,dx \)

9. Practice problems

Try each one before opening the solution. More solved problems from this topic are in Series.

Problem 1: Compute \(P_5\) from the recurrence.

\( 5P_5 = 9xP_4 - 4P_3 \Rightarrow P_5 = \frac18(63x^5 - 70x^3 + 15x) \).

Problem 2: Find \(P_n(0)\) for even \(n\) from the generating function.

\( G(t, 0) = (1 + t^2)^{-1/2} = \sum_m\binom{-1/2}{m}t^{2m} \), so \( P_{2m}(0) = \binom{-1/2}{m} = (-1)^m\frac{(2m)!}{4^m(m!)^2} \): \( 1, -\frac12, \frac38, -\frac5{16}, \dots \) (and \(P_n(0) = 0\) for odd \(n\)).

Problem 3: Verify that \(P_2\) satisfies Legendre's equation with \(n = 2\).

\( y = \frac12(3x^2 - 1) \), \( y' = 3x \), \( y'' = 3 \): \( 3(x^2 - 1) + 6x^2 - 6\cdot\frac12(3x^2 - 1) = 3x^2 - 3 + 6x^2 - 9x^2 + 3 = 0 \). ✓

Problem 4: Expand \(x^3\) in Legendre polynomials.

\( P_3 = \frac52x^3 - \frac32x \Rightarrow x^3 = \frac25P_3 + \frac35x = \frac25P_3 + \frac35P_1 \).

Problem 5: Compute \( \int_{-1}^1x\,P_n(x)\,dx \) for \(n \ge 2\).

\(x\) is a polynomial of degree \(1 < n\), so the integral is \(0\) by orthogonality.

Problem 6: Show that \( P_n'(1) = \frac{n(n + 1)}{2} \).

Put \(x = 1\) in Legendre's equation: \( 0\cdot y'' + 2y'(1) - n(n + 1)\cdot1 = 0 \). (Check: \(P_2' = 3x\), \(P_2'(1) = 3\).)

Final thoughts

Legendre polynomials can be reached from many directions, and each gives something different: the generating function (from the potential \(\frac{1}{|\mathbf r - \mathbf r'|}\)) gives values and the recurrence; Rodrigues' formula gives orthogonality and the differential equation; the explicit sum gives coefficients. Together they make \(P_n\) the model orthogonal family on \([-1, 1]\): a basis for expanding functions, the natural solutions of Laplace's equation in spherical coordinates, and the backbone of Gaussian quadrature (whose nodes are the zeros of \(P_n\)).

Related posts: Fourier series (the trigonometric analogue), the hypergeometric function (\(P_n(x) = F(-n, n + 1, 1, \frac{1 - x}{2})\)), and Bernoulli polynomials (another family defined by a generating function).