Legendre Polynomials: Recurrence Explained with Worked Examples

The Legendre polynomials satisfy , starting from and .

Write 2x or 2*x to multiply, ^ for powers, and ; between simultaneous equations. You can also type factor, expand, derivative of, integrate … from a to b, limit … as x->0 or 15% of 80.

Try an example

Before you start

This page is easier if you are comfortable with:

What Legendre polynomials: recurrence means

The recurrence builds each polynomial from the previous two. For : , so . For : , giving . For : . All satisfy and have parity . They are solutions of Legendre's equation.

Values come quickly: at , , , . The recurrence is numerically stable for , unlike direct evaluation of the expanded polynomials for large . It is similar in form to the recurrence for Chebyshev polynomials, .

The polynomials are orthogonal on , see Legendre orthogonality, and they can be obtained by applying the Gram–Schmidt process to with the integral inner product. They are used in Gaussian quadrature and in solving Laplace's equation in spherical coordinates.

What is it used for?

The recurrence builds every Legendre polynomial from the first two with simple arithmetic.

How to use legendre polynomials: recurrence

  1. Start with and .
  2. For each compute .
  3. Substitute the value of at each step to evaluate numerically.
  4. Check that .

Graph

The Legendre polynomials P₂, P₃ and P₄ on [−1, 1]all equal 1 at x = 1-1-0.8-0.6-0.4-0.200.20.40.60.81-1-0.500.51The Legendre polynomials P₂, P₃ and P₄ on [−1, 1]xyP2P3P4Graph with x from -1 to 1 and y from -1.1 to 1.1. Shows the curve P2; the curve P3; the curve P4; point all equal 1 at x = 1 at (1, 1).

Each polynomial ends at 1 on the right, and P₃ is odd.

Worked examples

These examples are worked by hand, step by step, so you can compare your own working.

Example 1: P₃(0.5)

Use the recurrence to find .

Worked example
Answer
−0.4375-0.4375
  1. P₂(0.5)
  2. n = 2
  3. P₃

Example 2: P₄(0.5)

Use the recurrence to find .

Worked example
Answer
−0.2891-0.2891
  1. n = 3
  2. Compute
  3. P₄

Example 3: P₄(1)

Check that using the closed form .

Worked example
Answer
11
  1. Substitute

Special cases

A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.

P₀ = 1, P₁ = x

P₁(0.5) = 0.5

Starting values.

P₂(0.5)

(3x² − 1)/2

−0.125.

P₃(0.5)

(5 × 0.5 × (−0.125) − 2 × 0.5)/3

−0.4375.

P₄(0.5)

(7 × 0.5 × P₃ − 3P₂)/4

−0.2891.

Word problems

(n + 1)Pₙ₊₁ = (2n + 1)xPₙ − nPₙ₋₁ with P₀ = 1 and P₁ = x generates all Legendre polynomials.

P₂

Use n = 1 at x = 0.5: 2P₂ = 3x·x − 1.

  1. (0.75 − 1)/2
  2. Check: ✓-0.125

P₃

Use n = 2: 3P₃ = 5xP₂ − 2P₁.

  1. (−0.3125 − 1)/3
  2. Check: ✓-0.4375

P₄ Higher

Use n = 3: 4P₄ = 7xP₃ − 3P₂.

  1. (−1.53125 + 0.375)/4
  2. Check: ✓-0.2891

At x = 1 Higher

Check P₃(1) by recurrence: (5·1·1 − 2·1)/3.

  1. 3/3
  2. Check: ✓1

Common mistakes

Wrong coefficients

nxPₙ ✗

(2n + 1)xPₙ ✓

Check.

Dividing by n

wrong divisor ✗

n + 1 ✓

Next index.

Index slip

Pₙ₋₁ as Pₙ ✗

use correct previous terms ✓

Track values.

Forgetting P₁ = x

P₁ = 1 ✗

P₁ = x ✓

Initial.

Exam tips

  1. (n + 1)Pₙ₊₁ = (2n + 1)xPₙ − nPₙ₋₁.
  2. P₀ = 1, P₁ = x.
  3. Pₙ(1) = 1.
  4. Table the values.
  5. Check with the closed form.

Practice questions

Try each one on paper, then open the answer. Use the solver above to see the full working.

1. P₂(0.4) Foundation

-0.26

2. P₃(0.4) via recurrence Foundation

-0.44

3. P₂(1) Foundation

1

4. P₃(0) via recurrence Higher

0

5. P₄(1) via recurrence (P₃(1) = 1, P₂(1) = 1) Higher

1

6. P₂(−0.5) Higher

-0.125

Practice generator

Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.

Solve: …

Key terms

Legendre polynomial
Pₙ(x).
Recurrence relation
Three-term rule.
Initial values
P₀, P₁.
Degree
n.
Parity
(−1)ⁿ.
Orthogonality
Next page.

Frequently asked questions

What is the Legendre recurrence?

(n + 1)Pₙ₊₁ = (2n + 1)xPₙ − nPₙ₋₁.

What are the starting values?

P₀ = 1, P₁ = x.

What is Pₙ(1)?

1.

How do I get P₂?

From n = 1.

Which page covers orthogonality?

Legendre orthogonality.

Which page covers Legendre’s equation?

Legendre’s equation.

More in Analysis, algebra and topology and the formula sheets.