---
title: Legendre polynomials and spheres
heading: Fields around spheres, and the multipoles of a charge distribution
eyebrow: A12 · Lesson 41 · Legendre polynomials and spheres
xp: 40
---

::: hook
For problems with a sphere and an axis of symmetry (a ball bearing in a field, a raindrop near a power line, the far field of a small antenna or a molecule), Laplace's equation separates in spherical coordinates, and the angular part is a family of polynomials in cos θ named after Legendre. They do for spheres what sines do for strings. They also organize the far field of any charge distribution into a **multipole expansion**: total charge, then dipole, then quadrupole, each falling off one power of distance faster than the last, which is why a neutral object's field is so short-ranged.
:::

::: play
- A dielectric sphere sits in a uniform field; this is a slice through its center. The shading is the potential, and the lines are flux (D) lines.
- Raise $\varepsilon_r$: flux crowds in through the poles, the inside field drops toward zero, and the field at the poles outside rises toward $3E_0$, half again what a cylinder reaches.
- Water has $\varepsilon_r$ near 80: a raindrop in a strong field is very nearly a conductor, with nearly three times the applied field at its tips.
:::
:::

```sim plot
view: flow
x: x = -3..3
y: y = -2..2
slider: er = 1..100 = 4 log
shade: step(x^2 + y^2 - 1)*(-x*(1 - (er - 1)/(er + 2)/(x^2 + y^2)^1.5)) + (1 - step(x^2 + y^2 - 1))*(-3*x/(er + 2)) | contours: 16 | scale: 3
dx: step(x^2 + y^2 - 1)*(1 + (er - 1)/(er + 2)*(2*x^2 - y^2)/(x^2 + y^2)^2.5) + (1 - step(x^2 + y^2 - 1))*3*er/(er + 2)
dy: step(x^2 + y^2 - 1)*3*(er - 1)/(er + 2)*x*y/(x^2 + y^2)^2.5
arrows: none
start: -2.95, -1.8 | forward
start: -2.95, -1.4 | forward
start: -2.95, -1 | forward
start: -2.95, -0.7 | forward
start: -2.95, -0.4 | forward
start: -2.95, -0.15 | forward
start: -2.95, 0.15 | forward
start: -2.95, 0.4 | forward
start: -2.95, 0.7 | forward
start: -2.95, 1 | forward
start: -2.95, 1.4 | forward
start: -2.95, 1.8 | forward
path: cos(u), sin(u) | over: u = 0..2*pi
readout: field inside, × E₀ = 3/(er + 2)
readout: field just outside at the poles, × E₀ = 3*er/(er + 2)
```

::: predict
## A small metal sphere sits in a uniform field $E_0$. What's the strongest field at its surface?

- [ ] $E_0$
- [ ] $2E_0$
- [x] $3E_0$
- [ ] $4E_0$

::: reveal
$3E_0$, at the two poles facing along the field. The outside potential is $-E_0\left(r - \frac{a^3}{r^2}\right)\cos\theta$: the applied field plus a dipole, whose field falls as $1/r^3$. A sphere concentrates the field more than a cylinder ($2E_0$) because the field can wrap around it in every direction.
:::
:::

::: nameit
## Separated solutions with an axis of symmetry

$$\varphi(r, \theta) = \sum_{n=0}^{\infty}\left(A_nr^n + \frac{B_n}{r^{n+1}}\right)P_n(\cos\theta)$$

Inside a sphere keep $r^n$; outside keep $r^{-(n+1)}$ (plus any applied field).

## Legendre polynomials

| n | $P_n(x)$ |
|---|---|
| 0 | 1 |
| 1 | $x$ |
| 2 | $\frac12(3x^2 - 1)$ |
| 3 | $\frac12(5x^3 - 3x)$ |

They satisfy $(n + 1)P_{n+1} = (2n + 1)xP_n - nP_{n-1}$, have $P_n(1) = 1$, and are orthogonal on [−1, 1] with weight 1: $\int_{-1}^1 P_mP_n\,dx = \frac{2}{2n + 1}$ if m = n, else 0.

## Spheres in a uniform field

| Sphere | Field inside | Field at the poles, outside |
|---|---|---|
| conductor | 0 | $3E_0$, with $\sigma = 3\varepsilon_0E_0\cos\theta$ |
| dielectric $\varepsilon_r$ | $\frac{3}{\varepsilon_r + 2}E_0$, uniform | $\frac{3\varepsilon_r}{\varepsilon_r + 2}E_0$ |

## The multipole expansion

For r larger than the size of the charges, $\frac{1}{\lvert\mathbf r - \mathbf r'\rvert} = \sum_n\frac{r'^n}{r^{n+1}}P_n(\cos\gamma)$, so the potential is

$$\varphi = \frac{1}{4\pi\varepsilon_0}\left(\frac{Q}{r} + \frac{p\cos\theta}{r^2} + \frac{\text{quadrupole}}{r^3} + \cdots\right)$$

A neutral object's field is led by its dipole term ($1/r^2$); with no dipole either, by its quadrupole ($1/r^3$).
:::

::: example
## A raindrop ($\varepsilon_r$ = 80) sits in a field $E_0$. What are the fields inside and at its tips?

::: solution
1. **Inside.**
   $$\begin{aligned} E_{\text{in}} &= \frac{3}{82}E_0 \\ &= 0.037E_0 \end{aligned}$$
2. **At the tips, outside.**
   $$\begin{aligned} E_{\text{tip}} &= \frac{240}{82}E_0 \\ &= 2.93E_0 \end{aligned}$$
3. **What it means.** The drop is almost a conductor: the strong tip field is how drops in thunderclouds start corona discharges.

**Answer:** the field is $0.037E_0$ inside and $2.93E_0$ at the tips.
:::
:::

::: example
## Charges +q at $z = \pm d$ and −2q at the origin form a linear quadrupole. Compare the expansion with the exact potential at r = 10d on the axis.

::: solution
1. **The expansion.** The monopole and dipole terms cancel, leaving
   $$\begin{aligned} \varphi &\approx \frac{q}{4\pi\varepsilon_0}\frac{2d^2P_2(1)}{r^3} \\ &= \frac{q}{4\pi\varepsilon_0}\frac{0.002}{d} \end{aligned}$$
2. **The exact potential.**
   $$\begin{aligned} \varphi &= \frac{q}{4\pi\varepsilon_0 d}\left(\frac19 + \frac1{11} - \frac{2}{10}\right) \\ &= \frac{q}{4\pi\varepsilon_0}\frac{0.00202}{d} \end{aligned}$$
3. **Compare.** The expansion is within 1% of the exact value.

**Answer:** the expansion gives $\frac{q}{4\pi\varepsilon_0}\frac{0.002}{d}$ and the exact potential is $\frac{q}{4\pi\varepsilon_0}\frac{0.00202}{d}$, within 1%.
:::
:::

::: example
## A sphere of radius a has $\varphi = V_0\cos^2\theta$ on its surface. Find the potential inside and outside.

::: solution
1. **Expand the surface values.** Since $P_2 = \frac{3\cos^2\theta - 1}{2}$,
   $$\cos^2\theta = \frac13 + \frac23P_2(\cos\theta)$$
2. **Inside.** Each $P_\ell$ term grows as $(r/a)^\ell$:
   $$\varphi = \frac{V_0}{3} + \frac{2V_0}{3}\left(\frac ra\right)^2P_2(\cos\theta)$$
   The center sits at $V_0/3$, the average of the surface potential over the sphere.
3. **Outside.** Each term falls as $(a/r)^{\ell + 1}$:
   $$\varphi = \frac{V_0}{3}\cdot\frac ar + \frac{2V_0}{3}\left(\frac ar\right)^3P_2(\cos\theta)$$
4. **Far away.** Only the monopole term $\frac{V_0a}{3r}$ remains, as from a charge $Q = \frac{4\pi\varepsilon_0aV_0}{3}$.

**Answer:** inside, $\varphi = V_0\left[\frac13 + \frac23\left(\frac ra\right)^2P_2(\cos\theta)\right]$; outside, $\varphi = V_0\left[\frac13\cdot\frac ar + \frac23\left(\frac ar\right)^3P_2(\cos\theta)\right]$.
:::
:::

::: check
given: x = 0.3 | 0.5 | 0.8
answer: (3*x^2 - 1)/2
tolerance: 0.5%

## What's $P_2(\given{x})$?

::: right
Right. $\frac12(3x^2 - 1)$ = {answer}.
:::

::: misses
- [3*x^2 - 1] Divide by 2: $P_2(1)$ must be 1.
- [any] Not yet. $P_2(x) = \frac12(3x^2 - 1)$.
:::
:::

::: check
given: n = 1 | 2 | 3 | 4
answer: 2/(2*n + 1)
tolerance: 0.5%

## What's $\int_{-1}^{1}P_{\given{n}}(x)^2\,dx$?

::: right
Right. $\frac{2}{2n + 1}$ = {answer}.
:::

::: misses
- [1/(2*n + 1)] The interval [−1, 1] has length 2, which doubles it.
- [any] Not yet. $\frac{2}{2n + 1}$.
:::
:::

::: check
given: E0 = 0.4 | 1 | 1.5
answer: 3*E0
unit: MV/m
tolerance: 0.5%

## A metal sphere sits in a uniform field of {E0} MV/m. What's the strongest field at its surface?

::: right
Right. $3E_0$ = {answer} MV/m.
:::

::: misses
- [2*E0] That's a cylinder; a sphere triples the field.
- [any] Not yet. The surface field is $3E_0\cos\theta$.
:::
:::

::: check
given: er = 2 | 5 | 80
answer: 3/(er + 2)
tolerance: 0.5%

## A dielectric sphere with $\varepsilon_r$ = {er} sits in a uniform field $E_0$. What's the field inside, as a multiple of $E_0$?

::: right
Right. $\frac{3}{\varepsilon_r + 2}$ = {answer}.
:::

::: misses
- [2/(er + 1)] That's a cylinder's result.
- [1/er] That's a slab with the field across it.
- [any] Not yet. $\frac{3}{\varepsilon_r + 2}E_0$.
:::
:::

::: check
given: V = 2 | 10; r = 1.5 | 2 | 4
answer: V/r^2
unit: V
tolerance: 0.5%

## A sphere of radius 1 has $\varphi = \given{V}\cos\theta$ volts on its surface. What's the potential outside at radius {r} on the axis θ = 0?

::: right
Right. $V(a/r)^2$ = {answer} V: a pure dipole field.
:::

::: misses
- [V/r] The $P_1$ term outside goes as $r^{-2}$.
- [V*r] Inside it would grow as r; outside it falls.
- [any] Not yet. $\varphi = V(a/r)^2\cos\theta$ outside.
:::
:::

::: check
given: q = 1 | 5; d = 1 | 2; r = 5 | 10
answer: 8.988*q*2*(d/1000)^2/(r/100)^3
unit: V
tolerance: 0.5%

## Charges +{q} nC at $z = \pm$ {d} mm and $-2 \times$ {q} nC at the origin. Using the quadrupole term, what's the potential on the axis {r} cm away?

::: right
Right. $\frac{q}{4\pi\varepsilon_0}\frac{2d^2}{r^3}$ = {answer} V.
:::

::: misses
- [8.988*q*2*(d/1000)/(r/100)^2] That's a dipole's falloff; the dipole moment here is zero.
- [any] Not yet. $\frac{q}{4\pi\varepsilon_0}\frac{2d^2P_2(1)}{r^3}$.
:::
:::

::: check
kind: choice

## A charge distribution has zero net charge and zero dipole moment. If you double your distance from it, its potential falls by about what factor?

- [ ] 2
- [ ] 4
- [x] 8
- [ ] 16

::: misses
- [1] That's a net charge's falloff.
- [2] That's a dipole's.
- [4] That's the next term, the octupole.
:::
:::

::: check
kind: parts
given: V = 3 | 9; k = 2 | 3

## A sphere of radius a has $\varphi = \given{V}\cos^2\theta$ volts on its surface.

::: part
answer: V/3
unit: V
tolerance: 0.5%

### What is the potential at its center?

::: misses
- [V/2] That's the average of $\cos^2$ around a circle; over a sphere it's $\frac13$.
- [any] Only the $P_0$ part reaches the center.
:::
:::

::: part
answer: V*(1/(3*k) + 2/(3*k^3))
unit: V
tolerance: 0.5%

### What is it outside on the axis ($\theta = 0$) at r = {k}a?

::: misses
- [V/(3*k)] Include the $P_2$ term, which falls as $(a/r)^3$.
- [any] $V\left[\frac13\frac ar + \frac23\left(\frac ar\right)^3\right]$.
:::
:::
:::

::: check
kind: derivation
vars: x = -1..1

## Build Legendre polynomials with Bonnet's recursion, $(n + 1)P_{n+1} = (2n + 1)xP_n - nP_{n-1}$, from $P_0 = 1$ and $P_1 = x$.

::: step
answer: (3*x^2 - 1)/2

### What is $P_2(x)$?
:::

::: step
answer: (5*x^3 - 3*x)/2

### What is $P_3(x)$?
:::

::: right
Right. Each $P_n$ has $P_n(1) = 1$, which is a quick check on the arithmetic.
:::
:::

::: explain
## Why does a sphere in a uniform field have three times the field at its poles, while a cylinder has only twice?

::: model
Both conductors push the applied field out of their interior, and the surface charge that does it must make a field outside that bends the field lines around the object. Around a cylinder the field can only go around in the plane across it, so its induced line dipole is of strength $a^2E_0$ and adds $E_0$ at the surface. Around a sphere the field lines can go around in every direction, so the same blocking is done by a point dipole of moment $4\pi\varepsilon_0a^3E_0$, whose field $2p/(4\pi\varepsilon_0a^3)$ at the pole adds $2E_0$. The lines that would have passed through the object pile up at its poles from more directions, which gives the larger enhancement.
:::
:::

::: practice

::: check
given: x = 0.1 | 0.2 | 0.3 | 0.5 | 0.7 | 0.9
answer: (5*x^3 - 3*x)/2
tolerance: 0.5%

## $P_3(\given{x})$?

::: misses
- [any] $\frac12(5x^3 - 3x)$.
:::
:::

::: check
given: er = 2 | 3 | 4 | 6 | 10 | 80
answer: 3/(er + 2)
tolerance: 0.5%

## Field inside a dielectric sphere, $\varepsilon_r$ = {er}, × $E_0$?

::: misses
- [any] $\frac{3}{\varepsilon_r + 2}$.
:::
:::

::: check
given: V = 4 | 7; r = 3 | 5
answer: V/r^2
unit: V
tolerance: 0.5%

## Outside a unit sphere with surface $\given{V}\cos\theta$, potential at r = {r}, θ = 0?

::: misses
- [any] $V/r^2$.
:::
:::
:::
