---
title: "From integral to differential form: divergence and curl at a point"
heading: Shrinking a surface or a loop to a point to turn Maxwell's integral laws into equations at every point, divergence as flux per volume and curl as circulation per area, the field inside and outside a wire carrying current, and the four equations in differential form
eyebrow: D8 · Lesson 2 · Divergence and curl at a point
xp: 40
---

::: hook
The integral laws of lesson 1 say what's true for whole loops and surfaces. To solve for a field everywhere, it helps to know what's true at each point, and that comes from shrinking the loop. The circulation around a tiny loop, divided by its area, approaches a limit called the **curl**; the flux out of a tiny box, divided by its volume, approaches the **divergence** (A9). Shrink Ampère's law this way and it says the curl of B at a point equals μ₀ times the current density there, which is zero in empty space and nonzero only inside the wire.
:::

::: play
- The magnetic field of a wire of radius 1 carrying a uniform current density J, seen end-on. Inside, B grows in proportion to the distance from the center; outside, it falls as one over the distance.
- A small loop of radius r is centered a distance a from the axis. The readout is its circulation divided by its area, in units of $\mu_0J$.
- Shrink the loop: inside the wire the ratio is 1 everywhere, outside it's 0, wherever the loop sits. That ratio, in the limit, is the curl.
:::

```sim plot
view: flow
x: x = -2.5..2.5
y: y = -2..2
slider: a = 0..2.2 step 0.05 = 0.5
slider: r = 0.05..0.6 step 0.01 = 0.3
dx: -y*(step(1 - x^2 - y^2)/2 + step(x^2 + y^2 - 1)/(2*(x^2 + y^2)))
dy: x*(step(1 - x^2 - y^2)/2 + step(x^2 + y^2 - 1)/(2*(x^2 + y^2)))
heads: on
path: cos(u), sin(u) | over: u = 0..2*pi | label: edge of the wire
path: a + r*cos(u), r*sin(u) | over: u = 0..2*pi | work: W | label: small loop
readout: circulation per area, units of μ₀J = W/(pi*r^2) | digits: 4
```

::: predict
## A wire of radius 1 mm carries 10 A spread evenly over its cross-section. How strong is the magnetic field halfway to its surface?

- [ ] 0
- [x] 1 mT
- [ ] 2 mT
- [ ] 4 mT

::: reveal
A circle of radius r inside the wire encloses only the fraction $r^2/R^2$ of the current, so Ampère's law gives $B = \mu_0Ir/(2\pi R^2)$: at r = 0.5 mm, 4π × 10⁻⁷ × 10 × 5 × 10⁻⁴/(2π × 10⁻⁶) = 1 mT, half the 2 mT at the surface. The current density is 10/(π × 10⁻⁶) = 3.18 × 10⁶ A/m², and $\mu_0J$ = 4 T/m is the curl everywhere inside.
:::
:::

::: nameit
## Divergence and curl

- **Divergence**: $\nabla\cdot\mathbf F = \lim\frac{1}{V}\oint\mathbf F\cdot d\mathbf A$, the net outflow per volume. In Cartesian coordinates, $\partial F_x/\partial x + \partial F_y/\partial y + \partial F_z/\partial z$.
- **Curl**: the component of $\nabla\times\mathbf F$ along a loop's normal is $\lim\frac{1}{A}\oint\mathbf F\cdot d\mathbf l$, the circulation per area. Its z component is $\partial F_y/\partial x - \partial F_x/\partial y$.

The divergence theorem and Stokes' theorem (A9) make the step from integral to point form exact.

## Maxwell's equations at a point

$$\nabla\cdot\mathbf E = \frac{\rho}{\varepsilon_0} \qquad \nabla\cdot\mathbf B = 0$$

$$\nabla\times\mathbf E = -\frac{\partial\mathbf B}{\partial t} \qquad \nabla\times\mathbf B = \mu_0\mathbf J + \mu_0\varepsilon_0\frac{\partial\mathbf E}{\partial t}$$

In a material, ε₀ and μ₀ become ε and μ, with **D** = εE and **B** = μH. These local laws hold at every point, so with boundary conditions (lesson 3) they determine the fields anywhere: they're what numerical field solvers discretize.

## A rotating field

A field circulating like a rigid wheel, $\mathbf F = (-\omega y, \omega x)$, has curl 2ω everywhere: each small loop sees the same rotation. The field outside a wire also circulates, but with strength falling as 1/r, its curl is zero: small loops there feel no net twist.
:::

::: example
## An electric field is $\mathbf E = k(3x, 2y, z)$ with k = 100 V/m². What charge density produces it?

::: solution
1. **Take the divergence.**
   $$\begin{aligned} \nabla\cdot\mathbf E &= k(3 + 2 + 1) \\ &= 600\ \text{V/m}^3 \end{aligned}$$
2. **Charge density from Gauss's law.**
   $$\begin{aligned} \rho &= \varepsilon_0 \times 600 \\ &= 5.31 \times 10^{-9}\ \text{C/m}^3 \end{aligned}$$
   It's the same everywhere in the region.

**Answer:** a uniform charge density of 5.31 × 10⁻⁹ C/m³.
:::
:::

::: example
## What's the curl of $\mathbf B = B_0(-y, x, 0)/a$, and what current density would produce it in free space?

::: solution
1. **Take the curl.** Its only component is along z:
   $$\begin{aligned} (\nabla\times\mathbf B)_z &= \frac{\partial B_y}{\partial x} - \frac{\partial B_x}{\partial y} \\ &= \frac{B_0}{a} + \frac{B_0}{a} \\ &= \frac{2B_0}{a} \end{aligned}$$
2. **Current density from Ampère's law.** In free space the curl is $\mu_0\mathbf J$, so
   $$J_z = \frac{2B_0}{\mu_0 a}$$
3. **Where this field appears.** The field inside a uniformly carrying wire has this form, with
   $$\frac{B_0}{a} = \frac{\mu_0 J}{2}$$

**Answer:** the curl is $2B_0/a$ along z, produced by a uniform current density $J_z = 2B_0/(\mu_0 a)$.
:::
:::

::: example
## A ball holds a uniform charge density of 1 µC/m³. What field does Gauss's law give 1 m from its center, inside the ball?

::: solution
1. **Gauss's law with spherical symmetry.** $\nabla \cdot \mathbf E = \rho/\varepsilon_0$ with spherical symmetry gives
   $$E = \frac{\rho r}{3\varepsilon_0}$$
2. **Put in the numbers.**
   $$\begin{aligned} E &= \frac{10^{-6}}{3 \times 8.854 \times 10^{-12}} \\ &= 37.6\ \text{kV/m} \end{aligned}$$
   The field grows linearly with r out to the surface.

**Answer:** 37.6 kV/m, 1 m from the center.
:::
:::

::: check
given: I = 1 | 10 | 50; R = 0.5 | 1 | 2
answer: I/(pi*(R*1e-3)^2)/1e6
unit: A/mm²
tolerance: 0.5%

## A wire of radius {R} mm carries {I} A uniformly. What's the current density?

::: right
Right. $I/\pi R^2$ = {answer} A/mm².
:::

::: misses
- [any] Not yet. Current over cross-sectional area.
:::
:::

::: check
given: I = 1 | 10 | 50; R = 1 | 2; f = 0.25 | 0.5 | 0.75
answer: 2e-7*I*(f*R*1e-3)/(R*1e-3)^2*1000
unit: mT
tolerance: 0.5%

## A wire of radius {R} mm carries {I} A uniformly. What's the field at {f} of the way from its axis to its surface?

::: right
Right. $\mu_0Ir/(2\pi R^2)$ = {answer} mT.
:::

::: misses
- [2e-7*I/(f*R*1e-3)*1000] That's the outside formula; inside, only the enclosed current counts.
- [any] Not yet. Ampère's law on a circle inside the wire.
:::
:::

::: check
given: a = 1 | 2 | 3; b = 1 | 4; c = 0 | 2; k = 10 | 100
answer: k*(a + b + c)*8.8541878128e-12*1e9
unit: nC/m³
tolerance: 0.5%

## A field is $\mathbf E = \given{k}(\given{a}x, \given{b}y, \given{c}z)$ V/m with x, y, z in meters. What charge density produces it?

::: right
Right. $\varepsilon_0\nabla\cdot\mathbf E$ = {answer} nC/m³.
:::

::: misses
- [k*(a + b + c)] That's the divergence in V/m³; multiply by $\varepsilon_0$.
- [any] Not yet. Gauss's law at a point.
:::
:::

::: check
given: w = 0.5 | 2 | 7
answer: 2*w
tolerance: 0.5%

## A field circulates like a rigid wheel, $\mathbf F = (-\given{w}y, \given{w}x)$. What's its curl?

::: right
Right. $\partial F_y/\partial x - \partial F_x/\partial y = 2\omega$ = {answer}.
:::

::: misses
- [w] Both terms contribute: ω + ω.
- [any] Not yet. Differentiate each component.
:::
:::

::: check
kind: parts
given: k = 10 | 100; a = 1 | 2 | 3; b = 1 | 2

## A field is $\mathbf E = k(\given{a}x, \given{b}y, 0)$ with k = {k} V/m².

::: part
answer: k*(a + b)
unit: V/m²
tolerance: 0.5%

### What is its divergence?

::: misses
- [any] $\partial E_x/\partial x + \partial E_y/\partial y$.
:::
:::

::: part
answer: k*(a + b)*8.854e-12*1e9
unit: nC/m³
tolerance: 0.5%

### What charge density produces it?

::: misses
- [any] $\varepsilon_0\nabla \cdot \mathbf E$.
:::
:::
:::

::: check
kind: parts
given: p = 0.1 | 1 | 10; r = 0.2 | 0.5

## A ball holds a uniform charge density of {p} µC/m³.

::: part
answer: p*1e-6*r/(3*8.854e-12)/1000
unit: kV/m
tolerance: 0.5%

### What field is there {r} m from its center, inside?

::: misses
- [any] $\rho r/(3\varepsilon_0)$.
:::
:::

::: part
answer: p*1e-6/8.854e-12/1000
unit: kV/m²
tolerance: 0.5%

### What is the divergence of the field?

::: misses
- [any] $\rho/\varepsilon_0$.
:::
:::
:::

::: check
kind: parts
given: B = 0.01 | 0.1; a = 0.01 | 0.05

## A field $\mathbf B = B_0(-y, x, 0)/a$ has $B_0$ = {B} T and a = {a} m.

::: part
answer: 2*B/a
unit: T/m
tolerance: 0.5%

### What is the magnitude of its curl?

::: misses
- [any] $\partial B_y/\partial x - \partial B_x/\partial y = 2B_0/a$.
:::
:::

::: part
answer: 2*B/a/(4*pi*1e-7)/1e6
unit: MA/m²
tolerance: 0.5%

### What current density would produce it in free space?

::: misses
- [any] $(\nabla\times\mathbf B)/\mu_0$.
:::
:::
:::

::: explain
## How can the magnetic field outside a wire circulate around it yet have zero curl?

::: model
Curl measures circulation per area around a vanishingly small loop at a point; whether the field lines go around in big circles doesn't enter into it. Outside a wire, a small loop has field running along its outer edge and its inner edge in opposite senses; the outer edge is longer but the field there is weaker, by exactly the factor that makes the two contributions cancel, since the field falls as one over the distance from the wire. So a paddle wheel placed there wouldn't spin, even though it would be carried around the wire. Only inside the conductor, where current flows through the small loop, is there net circulation, and the curl equals μ₀ times the current density there.
:::
:::

::: practice

::: check
given: I = 0.1 | 500; R = 0.05 | 10
answer: I/(pi*(R*1e-3)^2)/1e6
unit: A/mm²
tolerance: 0.5%

## J for {I} A in radius {R} mm?

::: misses
- [any] $I/\pi R^2$.
:::
:::

::: check
given: a = 1 | 2 | 3 | 5; b = 1 | 2 | 4; c = 1 | 2 | 6; k = 1 | 1000
answer: k*(a + b + c)*8.8541878128e-12*1e9
unit: nC/m³
tolerance: 0.5%

## ρ for $\mathbf E = \given{k}(\given{a}x, \given{b}y, \given{c}z)$?

::: misses
- [any] $\varepsilon_0\nabla\cdot\mathbf E$.
:::
:::
:::
