---
title: Maxwell's equations at a point
heading: Divergence, curl, and why charge must be conserved
eyebrow: B7 · Lesson 3 · Maxwell's equations at a point
xp: 40
---

::: hook
Lesson 1 stated Maxwell's equations as statements about whole surfaces and loops: the flux out of a box, the circulation around a ring. Shrink the box and the ring down to a point and the same laws become local: how much field spreads out from each point, and how much it swirls around it. This differential form is what field solvers compute, what makes the wave equation fall out in a few lines, and what reveals a hidden demand in the equations: they only make sense if charge is never created or destroyed.
:::

::: play
- The arrows are the magnetic field of a straight wire of radius $a$ carrying current out of the screen. Inside the wire the field grows with radius; outside it falls as $1/r$.
- Drag the paddle wheel. Inside the wire it spins: the field has curl there, equal to $\mu_0J$. Outside it doesn't turn at all, even though the field still circles the wire.
- Circulation around a big loop counts the current inside; curl measures the current right at a point.
:::
:::

```sim plot
view: flow
x: x = -3..3 mm
y: y = -3..3 mm
aspect: equal
time: tt
slider: a = 0.5..1.5 step 0.1 = 1 mm
slider: x0 = -2.5..2.5 step 0.05 = 0.4 mm
slider: y0 = -2.5..2.5 step 0.05 = 0 mm
dx: -y*(step(a - sqrt(x^2 + y^2))/a^2 + step(sqrt(x^2 + y^2) - a)/(x^2 + y^2))
dy: x*(step(a - sqrt(x^2 + y^2))/a^2 + step(sqrt(x^2 + y^2) - a)/(x^2 + y^2))
arrows: scaled
grid: 14
path: a*cos(2*pi*u), a*sin(2*pi*u) | over: u = 0..1 | color: ch3
wheel: x0, y0 | size: 0.35 | curl: c
readout: curl at the wheel = c
readout: expected curl inside the wire = 2/a^2 | digits: 3
```

::: predict
## Outside a straight wire carrying a steady current, the magnetic field circles the wire. Is the curl of $\mathbf B$ zero there?

- [x] Yes: there's no current at that point
- [ ] No: the field lines circle, so it has curl
- [ ] Only far from the wire
- [ ] It depends on the current's size

::: reveal
Yes. Curl measures circulation around a tiny loop at a point, and Ampère's law says that's $\mu_0J$, the current density right there, which is zero outside the wire. The field lines do circle, but the field weakens as $1/r$ in exactly the way that makes a small loop's circulation cancel: the stronger inner side is shorter than the weaker outer side. Circling field lines and nonzero curl are different things.
:::
:::

::: nameit
## From integrals to points

The divergence theorem and Stokes's theorem (A9.37) turn surface and loop integrals into derivatives at a point. Applied to the integral laws of lesson 1:

| Law | Integral form | At a point |
|---|---|---|
| Gauss (electric) | $\oint\mathbf E \cdot d\mathbf A = \frac{Q}{\varepsilon_0}$ | $\nabla \cdot \mathbf E = \frac{\rho}{\varepsilon_0}$ |
| Gauss (magnetic) | $\oint\mathbf B \cdot d\mathbf A = 0$ | $\nabla \cdot \mathbf B = 0$ |
| Faraday | $\oint\mathbf E \cdot d\mathbf l = -\frac{d\Phi_B}{dt}$ | $\nabla \times \mathbf E = -\frac{\partial\mathbf B}{\partial t}$ |
| Ampère–Maxwell | $\oint\mathbf B \cdot d\mathbf l = \mu_0I + \mu_0\varepsilon_0\frac{d\Phi_E}{dt}$ | $\nabla \times \mathbf B = \mu_0\mathbf J + \mu_0\varepsilon_0\frac{\partial\mathbf E}{\partial t}$ |

**Divergence** says how much a field spreads out from a point: only charge makes electric field lines start or end, and nothing makes magnetic ones. **Curl** says how much it swirls around a point: changing magnetic fields swirl the electric field, and currents and changing electric fields swirl the magnetic field.

## Why charge must be conserved

Charge flowing out of a tiny volume must reduce the charge inside: the **continuity equation**

$$\nabla \cdot \mathbf J = -\frac{\partial\rho}{\partial t}$$

The divergence of any curl is zero, so taking the divergence of the Ampère–Maxwell law gives $0 = \mu_0\nabla \cdot \mathbf J + \mu_0\varepsilon_0\frac{\partial}{\partial t}\nabla \cdot \mathbf E = \mu_0\left(\nabla \cdot \mathbf J + \frac{\partial\rho}{\partial t}\right)$: exactly the continuity equation. Without Maxwell's displacement term, Ampère's law would demand $\nabla \cdot \mathbf J = 0$ always, which fails the moment a capacitor charges.

## The wave equation

In empty space, take the curl of Faraday's law and use the Ampère–Maxwell law:

$$\nabla^2\mathbf E = \mu_0\varepsilon_0\frac{\partial^2\mathbf E}{\partial t^2}$$

a wave equation with speed $\frac{1}{\sqrt{\mu_0\varepsilon_0}} = c$ (lessons 4 and 5).
:::

::: example
## Check $\nabla \cdot \mathbf E = \rho/\varepsilon_0$ inside a uniformly charged ball, where $\mathbf E = \frac{\rho}{3\varepsilon_0}\mathbf r$.

::: solution
1. **Write the field in components.**
   $$\mathbf E = \frac{\rho}{3\varepsilon_0}(x, y, z)$$
2. **Take the divergence.**
   $$\begin{aligned} \nabla \cdot \mathbf E &= \frac{\rho}{3\varepsilon_0}(1 + 1 + 1) \\ &= \frac{\rho}{\varepsilon_0} \end{aligned}$$
3. **Outside the ball.** There $\mathbf E = \frac{kQ}{r^2}\hat{\mathbf r}$ has zero divergence: no charge there.

**Answer:** inside the ball $\nabla \cdot \mathbf E = \rho/\varepsilon_0$, as it should be, and outside the divergence is zero.
:::
:::

::: example
## A wire of radius 1 mm carries 10 A spread evenly. What is the curl of $\mathbf B$ inside it?

::: solution
1. **Current density.**
   $$\begin{aligned} J &= \frac{10}{\pi(10^{-3})^2} \\ &= 3.2 \times 10^6\ \text{A/m}^2 \end{aligned}$$
2. **Curl of B.**
   $$\begin{aligned} |\nabla \times \mathbf B| &= \mu_0J \\ &= 4\pi \times 10^{-7} \times 3.2 \times 10^6 \\ &= 4.0\ \text{T/m} \end{aligned}$$
   pointing along the wire.
3. **Outside the wire.** There the curl is zero.

**Answer:** inside the wire the curl of $\mathbf B$ is 4.0 T/m, pointing along the wire; outside it's zero.
:::
:::

::: check
given: rho = 1..20 int
answer: rho*1e-6/8.854e-12/1e6
unit: MV/m²
tolerance: 0.5%

## A region holds a charge density of {rho} µC/m³. What is $\nabla \cdot \mathbf E$ there?

::: right
Right. $\frac{\rho}{\varepsilon_0}$ = {answer}.
:::

::: misses
- [rho*1e-6*8.854e-12/1e6] Divide by $\varepsilon_0$.
- [any] Not yet. Gauss's law at a point.
:::
:::

::: check
given: I = 5 | 20; a = 0.5 | 2
answer: 4*pi*1e-7*I/(pi*(a/1000)^2)
unit: T/m
tolerance: 0.5%

## A wire of radius {a} mm carries {I} A spread evenly. How large is the curl of $\mathbf B$ inside it?

::: right
Right. $\mu_0J$ with $J = I/\pi a^2$: {answer}.
:::

::: misses
- [4*pi*1e-7*I/(2*pi*a/1000)] That's the field at the surface; the curl is $\mu_0J$.
- [any] Not yet. $\nabla \times \mathbf B = \mu_0\mathbf J$.
:::
:::

::: check
given: dB = 1 | 5 | 10 | 20 | 50 | 100
answer: dB
unit: V/m²
tolerance: 0.5%

## At some point the magnetic field changes at {dB} T/s. How large is the curl of $\mathbf E$ there?

::: right
Right. $|\nabla \times \mathbf E| = \left|\frac{\partial\mathbf B}{\partial t}\right|$ = {answer}.
:::

::: misses
- [any] Not yet. Faraday's law at a point.
:::
:::

::: check
given: dE = 1..20 int
answer: 4*pi*1e-7*8.854e-12*dE*1e12
unit: µT/m
tolerance: 0.5%

## In empty space the electric field changes at {dE} × 10¹² V/(m·s). How large is the curl of $\mathbf B$?

::: right
Right. $\mu_0\varepsilon_0\frac{\partial E}{\partial t}$ = {answer}.
:::

::: misses
- [any] Not yet. The displacement-current term.
:::
:::

::: check
given: c0 = 2 | 5 | 7
answer: 3*c0
tolerance: 0.5%

## A field is $\mathbf E = \given{c0}(x, y, z)$ in suitable units. What is its divergence?

::: right
Right. $\frac{\partial E_x}{\partial x} + \frac{\partial E_y}{\partial y} + \frac{\partial E_z}{\partial z} = 3c$ = {answer}.
:::

::: misses
- [c0] Each of the three components contributes.
- [any] Not yet. Add the three partial derivatives.
:::
:::

::: check
given: dQ = 1 | 5; dt = 1 | 10
answer: dQ/dt
unit: A
tolerance: 0.5%

## The charge inside a closed surface falls by {dQ} µC in {dt} µs. What net current flows out through the surface?

::: right
Right. Charge is conserved: $I = -\frac{dQ}{dt}$ = {answer}.
:::

::: misses
- [any] Not yet. The continuity equation in integral form.
:::
:::

::: explain
## Why do Maxwell's equations require charge to be conserved?

::: model
The magnetic field's curl is set by the current density plus the displacement term. A mathematical fact about any field is that the divergence of a curl is zero, so the divergence of the right-hand side must be zero too. The divergence of the displacement term is the rate of change of $\nabla \cdot \mathbf E$, which by Gauss's law is $\partial\rho/\partial t$ over $\varepsilon_0$. So $\nabla \cdot \mathbf J + \partial\rho/\partial t = 0$: current flowing out of any point must be matched by charge there decreasing. The equations simply can't hold if charge appears from nowhere.
:::
:::

::: practice

::: check
given: Q = 1 | 10; R = 1 | 5
answer: Q*1e-9/(4/3*pi*(R/100)^3)*1e6
unit: µC/m³
tolerance: 0.5%

## A ball of radius {R} cm holds {Q} nC spread evenly. What charge density is that?

::: misses
- [any] Charge over volume.
:::
:::

::: check
given: I = 1 | 10; a = 0.5 | 2
answer: I/(pi*(a/1000)^2)/1e6
unit: A/mm²
tolerance: 0.5%

## A wire of radius {a} mm carries {I} A. What is its current density?

::: misses
- [any] Current over area.
:::
:::

::: check
given: x = 0.1 | 0.5 | 1 | 2 | 5 | 10
answer: 0
tolerance: 0.5%

## What is the divergence of the magnetic field at {x} m from a magnet's center?

::: misses
- [any] Always zero: $\nabla \cdot \mathbf B = 0$.
:::
:::
:::
