# Steady Currents and Magnetostatic Fields: From the Biot–Savart Law to curl B = μ0 J

> From current density and charge conservation, via the Biot–Savart law, to the two equations of magnetostatics: div B = 0 and curl B = μ0 J, the curl being circulation per unit area.
> https://rikai.mugen-giken.com/en/physics/electromagnetism/magnetostatics

## 0. Key points

- The current density $\boldsymbol{J}$ is a vector field describing "the charge crossing unit area per unit time". The requirement that charge neither vanishes nor springs into being takes the local form $\nabla\cdot\boldsymbol{J} + \partial\rho/\partial t = 0$, the continuity equation.
- For a **steady current**, one whose distribution does not depend on time, we have $\nabla\cdot\boldsymbol{J} = 0$. Every argument in this article rests on that condition.
- The field produced by a steady current is given by the **Biot–Savart law**. This is an experimental law, the counterpart of Coulomb's law in electrostatics, and it serves as our starting point.
- From the Biot–Savart law we **derive** the two differential equations satisfied by a magnetostatic field: $\nabla\cdot\boldsymbol{B} = 0$ (no magnetic monopoles) and $\nabla\times\boldsymbol{B} = \mu_0\boldsymbol{J}$ (Ampère's law). The first is a consequence of the fact that $\boldsymbol{B}$ can be written as the curl of a vector potential.
- The curl $\nabla\times$ is "circulation per unit area". With this reading and Stokes' theorem, the differential form $\nabla\times\boldsymbol{B} = \mu_0\boldsymbol{J}$ and the integral form $\oint_C\boldsymbol{B}\cdot d\boldsymbol{l} = \mu_0 I_{\text{enc}}$ become equivalent.
- The equation $\nabla\times\boldsymbol{B} = \mu_0\boldsymbol{J}$ necessarily breaks down when the current is not steady. The precise manner of that breakdown is what forces the displacement current of the next chapter.

## 1. Motivation: the vortex Ørsted found

In 1820, in Copenhagen, H. C. Ørsted noticed that a compass needle placed near a wire carrying a current was deflected. At the time electricity and magnetism were believed to be entirely separate phenomena, so this came as a great surprise. Stranger still was the **manner** of the deflection. The needle was neither attracted to the wire nor repelled from it; it aligned itself in the direction that **wraps around** the wire.

In an electrostatic field, lines of force radiate outward from charges. The field around a current, by contrast, traces circles about the current as axis. It is not a source, but a vortex. Stating this difference mathematically is the goal of this article, and the answer is contained in two equations.

$$
\nabla\cdot\boldsymbol{B} = 0,\qquad \nabla\times\boldsymbol{B} = \mu_0\boldsymbol{J}.
$$

The left one says "there are no sources"; the right one says "the source of the vortex is the current". In this article we **prove** both of them from the Biot–Savart law, which is an experimental law.

<Figure caption="The magnetic field around a straight current. The field lines are concentric circles about the current, weakening in inverse proportion to distance.">
<svg viewBox="0 0 490 265" width="100%" role="img" aria-label="Concentric magnetic field lines around a straight current">
  <defs>
    <marker id="ms-arrow-a" markerWidth="10" markerHeight="10" refX="6.5" refY="3" orient="auto">
      <path d="M0,0 L7,3 L0,6 z" fill="currentColor" />
    </marker>
  </defs>
  <g fill="none" stroke="currentColor" strokeWidth="1.4" markerEnd="url(#ms-arrow-a)">
    <path d="M185,133 A45,45 0 1 0 184.3,140.8" />
    <path d="M215,133 A75,75 0 1 0 213.9,146.0" />
    <path d="M245,133 A105,105 0 1 0 243.4,151.2" />
  </g>
  <circle cx="140" cy="133" r="11" fill="none" stroke="var(--sl-color-accent)" strokeWidth="2" />
  <circle cx="140" cy="133" r="3" fill="var(--sl-color-accent)" />
  <text x="118" y="112" fill="var(--sl-color-accent)" fontSize="14" textAnchor="end">I</text>
  <g fill="currentColor" fontSize="13">
    <text x="285" y="105">B forms circles about the current</text>
    <text x="285" y="128">direction: the right-hand rule</text>
    <text x="285" y="151">magnitude falls off as 1/s</text>
    <text x="140" y="255" textAnchor="middle">current I points out of the page</text>
  </g>
</svg>
</Figure>

The field $\boldsymbol{B}$ itself is defined through the force it exerts on charges. A charge $q$ moving with velocity $\boldsymbol{v}$ experiences, in addition to the force from the electric field, the force

$$
\boldsymbol{F} = q\,\boldsymbol{v}\times\boldsymbol{B} .
$$

This is the magnetic part of the Lorentz force, and it constitutes the operational definition of $\boldsymbol{B}$. Since the force is orthogonal to the velocity, a magnetic field does no work. Here too the contrast with the electrostatic field is sharp.

## 2. Current, current density, and charge conservation

### 2.1. The definition of current density

The quantity "a current of $I$ amperes" presupposes a thin tube, namely a wire. To describe the flow point by point inside a conductor we need a quantity that is a field.

<Definition id="def-current-density" title="Current density">
Suppose that at each point $\boldsymbol{r}$ of space a charge of density $\rho(\boldsymbol{r}, t)$ moves with velocity field $\boldsymbol{v}(\boldsymbol{r}, t)$. The **current density** is defined by

$$
\boldsymbol{J}(\boldsymbol{r}, t) = \rho(\boldsymbol{r}, t)\,\boldsymbol{v}(\boldsymbol{r}, t) .
$$

When several species of carrier are present we set $\boldsymbol{J} = \sum_\alpha \rho_\alpha \boldsymbol{v}_\alpha$. Its unit is $\mathrm{A/m^2}$.

The charge crossing an oriented surface $S$ per unit time, that is, the **current** through $S$, is given by

$$
I_S = \int_S \boldsymbol{J}\cdot d\boldsymbol{S} .
$$
</Definition>

That the surface integral gives the current is checked as follows. Regard an infinitesimal piece $dS$ of the surface as a flat patch with normal $\boldsymbol{n}$. The charge crossing this patch during time $dt$ is the charge that was contained in the oblique cylinder with base $dS$ and generator $\boldsymbol{v}\,dt$; its volume is $(\boldsymbol{v}\cdot\boldsymbol{n})\,dt\,dS$, so the charge is $\rho\,\boldsymbol{v}\cdot\boldsymbol{n}\,dS\,dt = \boldsymbol{J}\cdot\boldsymbol{n}\,dS\,dt$. Dividing by $dt$ and summing over $S$ gives the formula above. Readers uneasy with surface integrals may consult [Multiple integrals and iterated integrals](/mathematics/calculus/multiple-integrals).

### 2.2. Charge conservation

We now translate the experimental fact that charge is neither created nor destroyed into the language of fields. First we record a lemma which looks obvious but is used constantly: if a volume integral vanishes over every region, then the integrand itself vanishes.

<Lemma id="lem-localization" title="Localization lemma">
Let $\Omega \subset \mathbb{R}^3$ be open and let $f:\Omega \to \mathbb{R}$ be continuous. If $\int_V f\,dV = 0$ for every closed ball $V$ contained in $\Omega$, then $f \equiv 0$ on $\Omega$.
</Lemma>

<Proof of="lem-localization">
We prove the contrapositive. Suppose $f(\boldsymbol{x}_0) \neq 0$ at some point $\boldsymbol{x}_0 \in \Omega$. Replacing $f$ by $-f$ if necessary, we may assume $c := f(\boldsymbol{x}_0) > 0$.

Since $f$ is continuous at $\boldsymbol{x}_0$, for $\varepsilon = c/2$ there is an $r > 0$ such that $|\boldsymbol{x} - \boldsymbol{x}_0| < r$ and $\boldsymbol{x}\in\Omega$ imply $|f(\boldsymbol{x}) - c| < c/2$, hence $f(\boldsymbol{x}) > c/2$. As $\Omega$ is open, shrinking $r$ if necessary we may arrange that the closed ball $V = \{\boldsymbol{x} : |\boldsymbol{x}-\boldsymbol{x}_0| \le r/2\}$ is contained in $\Omega$. On this $V$ the integrand exceeds $c/2$, so

$$
\int_V f\,dV \ge \frac{c}{2}\cdot\frac{4}{3}\pi\left(\frac{r}{2}\right)^3 > 0 ,
$$

contradicting the hypothesis.
</Proof>

<Theorem id="thm-continuity" title="The continuity equation">
Let $\rho$ and $\boldsymbol{J}$ be functions of class $C^1$ on $\mathbb{R}^3$, and suppose that for every bounded region $V$ (with piecewise smooth boundary $\partial V$, taken with the outward normal) the law of charge conservation

$$
\frac{d}{dt}\int_V \rho\,dV = -\oint_{\partial V}\boldsymbol{J}\cdot d\boldsymbol{S}
$$

holds. Then at every point of space

$$
\nabla\cdot\boldsymbol{J} + \frac{\partial\rho}{\partial t} = 0 .
$$
</Theorem>

The integral form assumed here reads: "the increase of the charge inside $V$ equals what has flowed in through the boundary". The minus sign on the right is there because outward flow is counted as positive.

<Proof of="thm-continuity">
On the left-hand side, since $\rho$ is of class $C^1$ and $V$ is a fixed region independent of time, we may interchange differentiation and integration:

$$
\frac{d}{dt}\int_V \rho\,dV = \int_V \frac{\partial\rho}{\partial t}\,dV .
$$

Applying <Ref to="physics/electromagnetism/electrostatics#thm-divergence-theorem" text="the divergence theorem of Gauss" /> to the right-hand side gives

$$
\oint_{\partial V}\boldsymbol{J}\cdot d\boldsymbol{S} = \int_V \nabla\cdot\boldsymbol{J}\,dV .
$$

The hypothesis can therefore be rewritten as

$$
\int_V\left(\frac{\partial\rho}{\partial t} + \nabla\cdot\boldsymbol{J}\right)dV = 0 ,
$$

valid for every bounded region and in particular for every closed ball. The integrand is continuous because $\rho$ and $\boldsymbol{J}$ are of class $C^1$, so by <Ref to="lem-localization" /> it vanishes identically.
</Proof>

<Definition id="def-steady-current" title="Steady current">
When the charge distribution and the current distribution are both independent of time, that is, $\partial\rho/\partial t = 0$ and $\partial\boldsymbol{J}/\partial t = \boldsymbol{0}$, the current is called **steady**.
</Definition>

<Corollary id="cor-steady-divj" title="The condition for a steady current">
For a steady current,

$$
\nabla\cdot\boldsymbol{J} = 0 .
$$

That is, the streamlines of the current density are never interrupted, and within a bounded region they form closed circuits.
</Corollary>

<Proof of="cor-steady-divj">
Substituting the condition $\partial\rho/\partial t = 0$ of <Ref to="def-steady-current" /> into the continuity equation of <Ref to="thm-continuity" /> gives $\nabla\cdot\boldsymbol{J} = 0$ at once.
</Proof>

<Aside type="caution">
The identity $\nabla\cdot\boldsymbol{J} = 0$ is the foundation on which every result of this article stands. There is no such thing as a "stub of current" — a steady current flowing along a finite segment only — because charge would pile up indefinitely at the ends of the segment. Below we point out explicitly each place where this condition is used.
</Aside>

## 3. The Biot–Savart law

Immediately after Ørsted's discovery, J.-B. Biot and F. Savart, together with A.-M. Ampère, determined the quantitative relation between current and magnetic field by experiment. Their result takes the following form. It is not derived from anything else; it is a starting point grounded in experiment.

<Axiom id="ax-biot-savart" title="The Biot–Savart law">
A steady current density $\boldsymbol{J}$ distributed in a bounded region ($\boldsymbol{J}$ of class $C^1$, vanishing outside some bounded set) produces the magnetic field

$$
\boldsymbol{B}(\boldsymbol{r}) = \frac{\mu_0}{4\pi}\int_{\mathbb{R}^3} \frac{\boldsymbol{J}(\boldsymbol{r}')\times(\boldsymbol{r}-\boldsymbol{r}')}{|\boldsymbol{r}-\boldsymbol{r}'|^{3}}\,dV' ,
$$

where $\mu_0$ is the permeability of the vacuum.

When the current flows along a thin closed curve $C$ of negligible cross-section (a line current of strength $I$), the substitution $\boldsymbol{J}\,dV' \to I\,d\boldsymbol{l}'$ gives

$$
\boldsymbol{B}(\boldsymbol{r}) = \frac{\mu_0 I}{4\pi}\oint_C \frac{d\boldsymbol{l}'\times(\boldsymbol{r}-\boldsymbol{r}')}{|\boldsymbol{r}-\boldsymbol{r}'|^{3}} .
$$
</Axiom>

Comparison with <Ref to="physics/electromagnetism/electrostatics#ax-coulomb" text="Coulomb's law" /> makes the structure plain. The dependence on distance is the same $1/R^2$ (one factor of $R$ in the denominator $R^3$ merely normalizes the direction vector). The differences are that the source is a vector $\boldsymbol{J}$ rather than a scalar $\rho$, and that a cross product appears. It is this cross product that turns the field so as to circulate around its source.

<Remark id="rem-mu0" title="On the value of μ0">
Before the 2019 redefinition of the SI base units, $\mu_0 = 4\pi\times10^{-7}\ \mathrm{N/A^2}$ was a value fixed exactly by the definition of the ampere. Since the redefinition the elementary charge $e$ is the exact quantity, and $\mu_0$ has become a measured one. Its value nevertheless departs from $4\pi\times10^{-7}\ \mathrm{N/A^2}$ only by about one part in $10^{9}$, so in undergraduate calculations this value may be used as it stands.
</Remark>

<Example id="ex-straight-wire" title="An infinitely long straight current">
Let a current $I$ flow along the $z$ axis in the $+z$ direction. Write $\boldsymbol{e}_s,\boldsymbol{e}_\phi,\boldsymbol{e}_z$ for the unit vectors of cylindrical coordinates $(s,\phi,z)$ and take the field point to be $\boldsymbol{r} = s\,\boldsymbol{e}_s$ (in the plane $z=0$, with no loss of generality). The source point is $\boldsymbol{r}' = z'\boldsymbol{e}_z$ and the line element is $d\boldsymbol{l}' = dz'\,\boldsymbol{e}_z$.

We have

$$
\boldsymbol{r}-\boldsymbol{r}' = s\,\boldsymbol{e}_s - z'\,\boldsymbol{e}_z,\qquad |\boldsymbol{r}-\boldsymbol{r}'| = \sqrt{s^2+z'^2}
$$

and, since $\boldsymbol{e}_z\times\boldsymbol{e}_s = \boldsymbol{e}_\phi$ and $\boldsymbol{e}_z\times\boldsymbol{e}_z = \boldsymbol{0}$,

$$
d\boldsymbol{l}'\times(\boldsymbol{r}-\boldsymbol{r}') = dz'\,\boldsymbol{e}_z\times(s\,\boldsymbol{e}_s - z'\boldsymbol{e}_z) = s\,dz'\,\boldsymbol{e}_\phi .
$$

The field therefore has only an $\boldsymbol{e}_\phi$ component, and

$$
B_\phi = \frac{\mu_0 I}{4\pi}\int_{-\infty}^{\infty}\frac{s\,dz'}{(s^2+z'^2)^{3/2}} .
$$

Substituting $z' = s\tan\theta$ (so $dz' = s\sec^2\theta\,d\theta$ and $(s^2+z'^2)^{3/2} = s^3\sec^3\theta$),

$$
\int_{-\infty}^{\infty}\frac{dz'}{(s^2+z'^2)^{3/2}} = \int_{-\pi/2}^{\pi/2}\frac{s\sec^2\theta}{s^3\sec^3\theta}\,d\theta = \frac{1}{s^2}\int_{-\pi/2}^{\pi/2}\cos\theta\,d\theta = \frac{2}{s^2} .
$$

Hence

$$
\boldsymbol{B} = \frac{\mu_0 I}{4\pi}\cdot s\cdot\frac{2}{s^2}\,\boldsymbol{e}_\phi = \frac{\mu_0 I}{2\pi s}\,\boldsymbol{e}_\phi .
$$

The magnitude falls off as $1/s$, and the direction wraps around the current by the right-hand rule. This agrees with Ørsted's observation.
</Example>

<Example id="ex-circular-loop" title="The field of a circular current on its axis">
A circular circuit of radius $a$ lies in the $xy$ plane centred at the origin, carrying a current $I$ counterclockwise as seen from above. We compute the field at the point $\boldsymbol{r} = z\,\boldsymbol{e}_z$ on the $z$ axis.

Taking the source point to be $\boldsymbol{r}' = a(\cos\phi',\sin\phi',0)$, the magnitude of $\boldsymbol{r}-\boldsymbol{r}'$ is $R = \sqrt{a^2+z^2}$, independent of $\phi'$. Moreover the line element $d\boldsymbol{l}'$ is tangent to the circle, while $\boldsymbol{r}-\boldsymbol{r}'$ consists of an $\boldsymbol{e}_z$ component and a radial component, both orthogonal to the tangent direction. Hence

$$
|d\boldsymbol{l}'\times(\boldsymbol{r}-\boldsymbol{r}')| = R\,|d\boldsymbol{l}'| = R\,a\,d\phi' .
$$

This cross-product vector sweeps once around a cone. By the symmetry about the $z$ axis, the radial components cancel upon integrating around the loop and only the $z$ component survives. The factor that extracts the $z$ component is the cosine of the angle between the cross-product vector and $\boldsymbol{e}_z$, namely $a/R$. Therefore

$$
B_z = \frac{\mu_0 I}{4\pi}\int_0^{2\pi}\frac{R\,a\,d\phi'}{R^3}\cdot\frac{a}{R} = \frac{\mu_0 I}{4\pi}\cdot\frac{a^2}{R^3}\cdot 2\pi = \frac{\mu_0 I\,a^2}{2(a^2+z^2)^{3/2}} .
$$

At the centre $z=0$ this is $B_z = \mu_0 I/(2a)$, while far away, for $|z| \gg a$,

$$
B_z \simeq \frac{\mu_0 I a^2}{2|z|^3} = \frac{\mu_0}{4\pi}\cdot\frac{2m}{|z|^3},\qquad m := I\pi a^2 ,
$$

which exhibits the same $1/|z|^3$ behaviour as the field of an electric dipole. The quantity $m$ is called the **magnetic moment**.
</Example>

## 4. The magnetic field has no sources

From the Biot–Savart law we first derive $\nabla\cdot\boldsymbol{B} = 0$. The shortest route is to show that $\boldsymbol{B}$ is the curl of something.

<Definition id="def-vector-potential" title="Vector potential">
Under the same hypotheses as <Ref to="ax-biot-savart" />, the field

$$
\boldsymbol{A}(\boldsymbol{r}) := \frac{\mu_0}{4\pi}\int_{\mathbb{R}^3}\frac{\boldsymbol{J}(\boldsymbol{r}')}{|\boldsymbol{r}-\boldsymbol{r}'|}\,dV'
$$

is called the **vector potential** of the steady current $\boldsymbol{J}$.
</Definition>

This is the componentwise analogue of the <Ref to="physics/electromagnetism/electrostatics#def-potential" text="electrostatic potential" /> $\varphi(\boldsymbol{r}) = \frac{1}{4\pi\epsilon_0}\int \rho(\boldsymbol{r}')/|\boldsymbol{r}-\boldsymbol{r}'|\,dV'$. To shorten the notation we set

$$
\boldsymbol{R} := \boldsymbol{r}-\boldsymbol{r}',\qquad R := |\boldsymbol{R}| .
$$

Here $\nabla$ denotes differentiation with respect to the field point $\boldsymbol{r}$ and $\nabla'$ differentiation with respect to the source point $\boldsymbol{r}'$. The basic computation is

$$
\nabla\frac{1}{R} = -\frac{\boldsymbol{R}}{R^3},\qquad \nabla'\frac{1}{R} = +\frac{\boldsymbol{R}}{R^3} = -\nabla\frac{1}{R}
$$

(since $1/R$ depends only on the difference of $\boldsymbol{r}$ and $\boldsymbol{r}'$, the two derivatives differ only in sign).

<Proposition id="prop-vector-potential" title="The magnetic field is the curl of the vector potential">
The field of <Ref to="ax-biot-savart" /> and the vector potential of <Ref to="def-vector-potential" /> are related by

$$
\boldsymbol{B} = \nabla\times\boldsymbol{A} .
$$
</Proposition>

<Proof of="prop-vector-potential">
Granting that differentiation and integration may be interchanged (the singularity of $1/R$ is integrable on $\mathbb{R}^3$ and $\boldsymbol{J}$ has bounded support, so the integral converges absolutely as an improper integral and the interchange is justified), we have

$$
\nabla\times\boldsymbol{A} = \frac{\mu_0}{4\pi}\int \nabla\times\left(\frac{\boldsymbol{J}(\boldsymbol{r}')}{R}\right)dV' .
$$

To the integrand we apply the formula for the curl of a scalar times a vector, $\nabla\times(f\boldsymbol{a}) = f\,(\nabla\times\boldsymbol{a}) + (\nabla f)\times\boldsymbol{a}$. Here $\boldsymbol{a} = \boldsymbol{J}(\boldsymbol{r}')$ is a function of the integration variable $\boldsymbol{r}'$ and does not depend on the field point $\boldsymbol{r}$, so $\nabla\times\boldsymbol{J}(\boldsymbol{r}') = \boldsymbol{0}$ and

$$
\nabla\times\left(\frac{\boldsymbol{J}(\boldsymbol{r}')}{R}\right) = \left(\nabla\frac1R\right)\times\boldsymbol{J}(\boldsymbol{r}') = -\frac{\boldsymbol{R}}{R^3}\times\boldsymbol{J}(\boldsymbol{r}') = \frac{\boldsymbol{J}(\boldsymbol{r}')\times\boldsymbol{R}}{R^3} ,
$$

the last equality using the anticommutativity $\boldsymbol{a}\times\boldsymbol{b} = -\boldsymbol{b}\times\boldsymbol{a}$ of the cross product. Putting this back under the integral sign reproduces exactly the right-hand side of <Ref to="ax-biot-savart" />.
</Proof>

<Lemma id="lem-div-curl" title="The divergence of a curl vanishes">
For a vector field $\boldsymbol{F}$ of class $C^2$ we have $\nabla\cdot(\nabla\times\boldsymbol{F}) = 0$.
</Lemma>

<Proof of="lem-div-curl">
Write it out in components:

$$
\nabla\cdot(\nabla\times\boldsymbol{F}) = \frac{\partial}{\partial x}\left(\frac{\partial F_z}{\partial y}-\frac{\partial F_y}{\partial z}\right) + \frac{\partial}{\partial y}\left(\frac{\partial F_x}{\partial z}-\frac{\partial F_z}{\partial x}\right) + \frac{\partial}{\partial z}\left(\frac{\partial F_y}{\partial x}-\frac{\partial F_x}{\partial y}\right).
$$

Since $\boldsymbol{F}$ is of class $C^2$, <Ref to="mathematics/calculus/multivariable-differentiation#thm-schwarz" text="Schwarz's theorem" /> permits us to interchange the order of the second partial derivatives. Then $\partial^2 F_z/\partial x\partial y$ cancels against $-\partial^2 F_z/\partial y\partial x$, and likewise the terms in $F_x$ cancel each other, as do the terms in $F_y$. The total is $0$.
</Proof>

<Theorem id="thm-div-b" title="The divergence of the magnetic field vanishes">
Under the hypotheses of <Ref to="ax-biot-savart" />, at every point of space

$$
\nabla\cdot\boldsymbol{B} = 0 ,
$$

equivalently $\oint_S \boldsymbol{B}\cdot d\boldsymbol{S} = 0$ for every closed surface $S$.
</Theorem>

<Proof of="thm-div-b">
By <Ref to="prop-vector-potential" /> we may write $\boldsymbol{B} = \nabla\times\boldsymbol{A}$. Since $\boldsymbol{J}$ is of class $C^1$ with bounded support, $\boldsymbol{A}$ is of class $C^2$, so applying <Ref to="lem-div-curl" /> with $\boldsymbol{F} = \boldsymbol{A}$ gives

$$
\nabla\cdot\boldsymbol{B} = \nabla\cdot(\nabla\times\boldsymbol{A}) = 0 .
$$

The integral form follows by integrating this equation over an arbitrary bounded region $V$ and applying the divergence theorem. Conversely, if the surface integral vanishes over every closed surface, then the divergence theorem together with <Ref to="lem-localization" /> yields $\nabla\cdot\boldsymbol{B} = 0$.
</Proof>

<Remark id="rem-monopole" title="The absence of magnetic monopoles">
For the electrostatic field, <Ref to="physics/electromagnetism/electrostatics#thm-gauss-differential" text="Gauss's law in differential form" /> reads $\nabla\cdot\boldsymbol{E} = \rho/\epsilon_0$, with the charge density — a genuine source — on the right. The right-hand side of <Ref to="thm-div-b" /> is $0$. This means that magnetic charge (a magnetic monopole) does not exist. Breaking a bar magnet in half does not yield a fragment with only a north pole; a new south pole and north pole appear at the cut.

The relation $\nabla\cdot\boldsymbol{B} = 0$ derived here is a consequence of <Ref to="ax-biot-savart" />, that is, of the premise that currents are the only sources of magnetic fields. At a deeper level it is an experimental fact, and Dirac showed in 1931 that if even a single magnetic monopole existed anywhere in the universe, electric charge would be forced to take discrete values (charge quantization). The search for monopoles continues today, with no established detection.

The representation $\boldsymbol{B} = \nabla\times\boldsymbol{A}$ leaves freedom in the choice of $\boldsymbol{A}$. Changing $\boldsymbol{A} \to \boldsymbol{A} + \nabla\chi$ for an arbitrary scalar field $\chi$ leaves $\boldsymbol{B}$ unaltered, because $\nabla\times\nabla\chi = \boldsymbol{0}$. This is <Ref to="physics/electromagnetism/gauge-potentials#def-gauge-transformation" text="a gauge transformation" />, treated in detail in [Electromagnetic potentials and gauge transformations](/physics/electromagnetism/gauge-potentials).
</Remark>

## 5. The curl is circulation per unit area

Before turning to the other equation, $\nabla\times\boldsymbol{B} = \mu_0\boldsymbol{J}$, let us make sure of the meaning of the curl operation. Just as the divergence is "outflow per unit volume", the curl is "circulation per unit area".

<Definition id="def-curl" title="Curl">
For a vector field $\boldsymbol{F} = (F_x, F_y, F_z)$ of class $C^1$, the **curl** $\nabla\times\boldsymbol{F}$ (also written $\operatorname{rot}\boldsymbol{F}$) is defined by

$$
\nabla\times\boldsymbol{F} := \left(\frac{\partial F_z}{\partial y}-\frac{\partial F_y}{\partial z},\ \frac{\partial F_x}{\partial z}-\frac{\partial F_z}{\partial x},\ \frac{\partial F_y}{\partial x}-\frac{\partial F_x}{\partial y}\right).
$$

Moreover, the line integral $\oint_C \boldsymbol{F}\cdot d\boldsymbol{l}$ along a closed curve $C$ is called the **circulation** of $\boldsymbol{F}$ along $C$.
</Definition>

Staring at the components conveys no meaning. The next proposition supplies it.

<Figure caption="The z component of the curl is the circulation around an infinitesimal rectangle in the xy plane, divided by its area.">
<svg viewBox="0 0 440 235" width="100%" role="img" aria-label="Diagram relating the circulation around an infinitesimal rectangle to the curl">
  <defs>
    <marker id="ms-arrow-b" markerWidth="10" markerHeight="10" refX="6.5" refY="3" orient="auto">
      <path d="M0,0 L7,3 L0,6 z" fill="currentColor" />
    </marker>
  </defs>
  <g fill="none" stroke="currentColor" strokeWidth="1.6" markerEnd="url(#ms-arrow-b)">
    <path d="M120,165 L275,165" />
    <path d="M290,155 L290,70" />
    <path d="M280,60 L125,60" />
    <path d="M110,70 L110,155" />
  </g>
  <g fill="none" stroke="currentColor" strokeWidth="1" opacity="0.45">
    <path d="M110,60 L290,60 L290,165 L110,165 Z" />
  </g>
  <g fill="currentColor" fontSize="12.5">
    <text x="200" y="186" textAnchor="middle">Fx(x, y0)</text>
    <text x="200" y="46" textAnchor="middle">Fx(x, y0 + Δy)</text>
    <text x="300" y="117">Fy(x0 + Δx, y)</text>
    <text x="100" y="117" textAnchor="end">Fy(x0, y)</text>
  </g>
  <text x="200" y="118" fill="var(--sl-color-accent)" fontSize="13.5" textAnchor="middle">circulation ≈ (curl F)z ΔxΔy</text>
</svg>
</Figure>

<Proposition id="prop-curl-circulation" title="Curl and circulation">
Let $\boldsymbol{F}$ be a vector field of class $C^1$ and consider the rectangle parallel to the $xy$ plane with lower left corner at $(x_0,y_0,z_0)$,

$$
S_{\Delta} = [x_0, x_0+\Delta x]\times[y_0,y_0+\Delta y]\times\{z_0\} .
$$

Traverse its boundary $\partial S_\Delta$ once in the sense that is right-handed with respect to the positive $z$ direction as normal (counterclockwise seen from above). Then

$$
\lim_{\Delta x,\Delta y\to 0}\frac{1}{\Delta x\,\Delta y}\oint_{\partial S_\Delta}\boldsymbol{F}\cdot d\boldsymbol{l} = \left(\frac{\partial F_y}{\partial x}-\frac{\partial F_x}{\partial y}\right)\Bigg|_{(x_0,y_0,z_0)} = (\nabla\times\boldsymbol{F})_z\big|_{(x_0,y_0,z_0)} .
$$
</Proposition>

<Proof of="prop-curl-circulation">
Below we fix $z = z_0$ and suppress it. Writing out the line integrals along the four sides — on the bottom (direction $+x$) and top (direction $-x$) we have $d\boldsymbol{l} = \pm dx\,\boldsymbol{e}_x$, on the right (direction $+y$) and left (direction $-y$) we have $d\boldsymbol{l} = \pm dy\,\boldsymbol{e}_y$ — gives

$$
\begin{aligned}
\oint_{\partial S_\Delta}\boldsymbol{F}\cdot d\boldsymbol{l}
&= \int_{x_0}^{x_0+\Delta x}F_x(x,y_0)\,dx + \int_{y_0}^{y_0+\Delta y}F_y(x_0+\Delta x, y)\,dy \\
&\quad - \int_{x_0}^{x_0+\Delta x}F_x(x,y_0+\Delta y)\,dx - \int_{y_0}^{y_0+\Delta y}F_y(x_0, y)\,dy .
\end{aligned}
$$

Combining the second with the fourth term, and the first with the third, we obtain

$$
\oint_{\partial S_\Delta}\boldsymbol{F}\cdot d\boldsymbol{l} = \int_{y_0}^{y_0+\Delta y}\big[F_y(x_0+\Delta x,y)-F_y(x_0,y)\big]dy - \int_{x_0}^{x_0+\Delta x}\big[F_x(x,y_0+\Delta y)-F_x(x,y_0)\big]dx .
$$

To each bracket we apply <Ref to="mathematics/calculus/mean-value-and-taylor#thm-mvt" text="the mean value theorem" /> in the $x$ direction and in the $y$ direction respectively (recall $\boldsymbol{F}$ is of class $C^1$). There exist $\xi \in (x_0, x_0+\Delta x)$ and $\eta\in(y_0,y_0+\Delta y)$ (depending on $y$, respectively on $x$) such that

$$
F_y(x_0+\Delta x,y)-F_y(x_0,y) = \frac{\partial F_y}{\partial x}(\xi, y)\,\Delta x,\qquad
F_x(x,y_0+\Delta y)-F_x(x,y_0) = \frac{\partial F_x}{\partial y}(x, \eta)\,\Delta y .
$$

Substituting these and then applying <Ref to="mathematics/calculus/integration-and-ftc#prop-mvt-integral" text="the mean value theorem for integrals" /> to the remaining integrals, we find points $(\xi_1,\eta_1)$ and $(\xi_2,\eta_2)$ inside the rectangle with

$$
\oint_{\partial S_\Delta}\boldsymbol{F}\cdot d\boldsymbol{l} = \left[\frac{\partial F_y}{\partial x}(\xi_1,\eta_1) - \frac{\partial F_x}{\partial y}(\xi_2,\eta_2)\right]\Delta x\,\Delta y .
$$

Divide both sides by $\Delta x\,\Delta y$ and let $\Delta x,\Delta y\to 0$. Both $(\xi_i,\eta_i)$ converge to $(x_0,y_0)$, and the partial derivatives are continuous by the hypothesis of class $C^1$, so the limit is the value of $\partial_x F_y - \partial_y F_x$ at $(x_0,y_0)$. This is precisely the $z$ component in <Ref to="def-curl" />.
</Proof>

Thus $(\nabla\times\boldsymbol{F})\cdot\boldsymbol{n}$ is "the circulation per unit area obtained by going once around the rim of an infinitesimal surface with normal $\boldsymbol{n}$". It measures the strength of the vortex. Accumulating this local relation over a finite surface gives Stokes' theorem.

<Theorem id="thm-stokes" title="Stokes' theorem">
Let $S$ be a piecewise smooth oriented surface in $\mathbb{R}^3$ with boundary curve $\partial S$, the orientation of $\partial S$ being right-handed with respect to the normal of $S$. If $\boldsymbol{F}$ is a vector field of class $C^1$ on an open set containing $S$, then

$$
\int_S (\nabla\times\boldsymbol{F})\cdot d\boldsymbol{S} = \oint_{\partial S}\boldsymbol{F}\cdot d\boldsymbol{l} .
$$
</Theorem>

<Remark id="rem-stokes-proof" title="On the proof of Stokes' theorem">
The proof proceeds by subdividing the surface into infinitesimal rectangles (or triangles), applying <Ref to="prop-curl-circulation" /> on each piece, and summing. Interior edges are counted twice with opposite orientations by adjacent pieces and cancel, leaving only the edges along the boundary $\partial S$. We leave the rigorous treatment to textbooks of multivariable calculus (see Sugiura in the references, or the appendix of Jackson). In this article we use the theorem as known.
</Remark>

## 6. Ampère's law

The preparations are complete. We now compute $\nabla\times\boldsymbol{B}$ from the Biot–Savart law.

<Lemma id="lem-div-a" title="The vector potential of a steady current is transverse">
Under the hypotheses of <Ref to="ax-biot-savart" /> ($\boldsymbol{J}$ of class $C^1$ with bounded support, and steady, so that $\nabla\cdot\boldsymbol{J} = 0$ by <Ref to="cor-steady-divj" />), the vector potential of <Ref to="def-vector-potential" /> satisfies

$$
\nabla\cdot\boldsymbol{A} = 0 .
$$
</Lemma>

<Proof of="lem-div-a">
Since $\boldsymbol{J}(\boldsymbol{r}')$ does not depend on $\boldsymbol{r}$,

$$
\nabla\cdot\boldsymbol{A} = \frac{\mu_0}{4\pi}\int \nabla\cdot\left(\frac{\boldsymbol{J}(\boldsymbol{r}')}{R}\right)dV' = \frac{\mu_0}{4\pi}\int \boldsymbol{J}(\boldsymbol{r}')\cdot\nabla\frac1R\,dV' .
$$

Using $\nabla(1/R) = -\nabla'(1/R)$ gives

$$
\nabla\cdot\boldsymbol{A} = -\frac{\mu_0}{4\pi}\int \boldsymbol{J}(\boldsymbol{r}')\cdot\nabla'\frac1R\,dV' .
$$

Applying the product rule in the variable $\boldsymbol{r}'$, namely $\nabla'\cdot(f\boldsymbol{a}) = (\nabla' f)\cdot\boldsymbol{a} + f\,\nabla'\cdot\boldsymbol{a}$ with $f = 1/R$ and $\boldsymbol{a} = \boldsymbol{J}$, we get

$$
\boldsymbol{J}\cdot\nabla'\frac1R = \nabla'\cdot\left(\frac{\boldsymbol{J}}{R}\right) - \frac{\nabla'\cdot\boldsymbol{J}}{R} ,
$$

so taking a ball $V$ of sufficiently large radius (outside which $\boldsymbol{J} = \boldsymbol{0}$) we obtain

$$
\nabla\cdot\boldsymbol{A} = -\frac{\mu_0}{4\pi}\oint_{\partial V}\frac{\boldsymbol{J}(\boldsymbol{r}')\cdot d\boldsymbol{S}'}{R} + \frac{\mu_0}{4\pi}\int_V \frac{\nabla'\cdot\boldsymbol{J}(\boldsymbol{r}')}{R}\,dV'
$$

(the divergence theorem was used in the first term).

The first term vanishes because $\boldsymbol{J} = \boldsymbol{0}$ on $\partial V$ — this is where we use the hypothesis that the current distribution is confined to a bounded region. The second term vanishes by $\nabla'\cdot\boldsymbol{J} = 0$ from <Ref to="cor-steady-divj" /> — this is where we use the hypothesis that the current is **steady**. Hence $\nabla\cdot\boldsymbol{A} = 0$.
</Proof>

<Theorem id="thm-ampere-differential" title="Ampère's law (differential form)">
Under the hypotheses of <Ref to="ax-biot-savart" /> (steady current, class $C^1$, bounded support), at every point of space

$$
\nabla\times\boldsymbol{B} = \mu_0\boldsymbol{J} .
$$
</Theorem>

<Proof of="thm-ampere-differential">
By <Ref to="prop-vector-potential" /> we have $\boldsymbol{B} = \nabla\times\boldsymbol{A}$, so we use the vector-calculus identity (verified by a component computation in the Appendix)

$$
\nabla\times(\nabla\times\boldsymbol{A}) = \nabla(\nabla\cdot\boldsymbol{A}) - \nabla^2\boldsymbol{A} ,
$$

where $\nabla^2\boldsymbol{A}$ means the Laplacian applied to each Cartesian component.

The first term vanishes because $\nabla\cdot\boldsymbol{A} = 0$ by <Ref to="lem-div-a" />. We compute the second. Interchanging differentiation and integration in the defining formula of <Ref to="def-vector-potential" />,

$$
\nabla^2\boldsymbol{A} = \frac{\mu_0}{4\pi}\int \boldsymbol{J}(\boldsymbol{r}')\,\nabla^2\frac{1}{|\boldsymbol{r}-\boldsymbol{r}'|}\,dV' .
$$

As verified in <Ref to="physics/electromagnetism/electrostatics#thm-poisson" /> of [Electrostatic fields and Gauss's law](/en/physics/electromagnetism/electrostatics), the function $1/|\boldsymbol{r}-\boldsymbol{r}'|$ is harmonic for $\boldsymbol{r} \ne \boldsymbol{r}'$, and once the singularity at the origin is included one has, in the sense of distributions,

$$
\nabla^2\frac{1}{|\boldsymbol{r}-\boldsymbol{r}'|} = -4\pi\,\delta^3(\boldsymbol{r}-\boldsymbol{r}') .
$$

Substituting this gives

$$
\nabla^2\boldsymbol{A} = \frac{\mu_0}{4\pi}\int \boldsymbol{J}(\boldsymbol{r}')\cdot(-4\pi)\,\delta^3(\boldsymbol{r}-\boldsymbol{r}')\,dV' = -\mu_0\boldsymbol{J}(\boldsymbol{r}) .
$$

Therefore

$$
\nabla\times\boldsymbol{B} = \nabla(\nabla\cdot\boldsymbol{A}) - \nabla^2\boldsymbol{A} = \boldsymbol{0} + \mu_0\boldsymbol{J} = \mu_0\boldsymbol{J} .
$$
</Proof>

<Corollary id="cor-ampere-integral" title="Ampère's law (integral form)">
For a steady current, and for a piecewise smooth oriented surface $S$ with boundary curve $C = \partial S$ (oriented right-handedly with respect to the normal of $S$),

$$
\oint_C \boldsymbol{B}\cdot d\boldsymbol{l} = \mu_0 I_{\text{enc}},\qquad I_{\text{enc}} := \int_S \boldsymbol{J}\cdot d\boldsymbol{S} ,
$$

where $I_{\text{enc}}$ is the net current threading through $C$.
</Corollary>

<Proof of="cor-ampere-integral">
Applying <Ref to="thm-stokes" /> with $\boldsymbol{F} = \boldsymbol{B}$ on the surface $S$ gives

$$
\oint_C\boldsymbol{B}\cdot d\boldsymbol{l} = \int_S(\nabla\times\boldsymbol{B})\cdot d\boldsymbol{S} .
$$

Substituting <Ref to="thm-ampere-differential" /> on the right-hand side,

$$
\int_S(\nabla\times\boldsymbol{B})\cdot d\boldsymbol{S} = \mu_0\int_S\boldsymbol{J}\cdot d\boldsymbol{S} = \mu_0 I_{\text{enc}} .
$$

The converse is analogous: if the integral form holds for every surface, the limiting procedure of <Ref to="prop-curl-circulation" /> recovers the differential form.
</Proof>

<Remark id="rem-surface-independence" title="Independence of the choice of surface">
The left-hand side of <Ref to="cor-ampere-integral" /> is determined by the curve $C$ alone, whereas the right-hand side is written using a surface $S$ bounded by $C$. There is no contradiction, thanks to $\nabla\cdot\boldsymbol{J} = 0$. Indeed, joining two surfaces $S_1, S_2$ with the same boundary produces a closed surface, and by the divergence theorem

$$
\int_{S_1}\boldsymbol{J}\cdot d\boldsymbol{S} - \int_{S_2}\boldsymbol{J}\cdot d\boldsymbol{S} = \int_{V}\nabla\cdot\boldsymbol{J}\,dV = 0 ,
$$

where $V$ is the region enclosed by the two surfaces. Once the current ceases to be steady this agreement fails and Ampère's law itself loses its meaning. This is the mechanism that demands a displacement current, as we verify in the last exercise.
</Remark>

### 6.1. Computations using symmetry

The integral form is extremely powerful for finding $\boldsymbol{B}$ in highly symmetric configurations. The procedure is the same as for Gauss's law in electrostatics: first narrow down the form of $\boldsymbol{B}$ using symmetry, then choose a convenient closed curve.

<Example id="ex-cylinder" title="A cylindrical conductor of finite thickness">
An infinitely long cylindrical conductor of radius $a$ lies along the $z$ axis, carrying a total current $I$ in the $+z$ direction with uniform current density over its cross-section. That is, $\boldsymbol{J} = \dfrac{I}{\pi a^2}\boldsymbol{e}_z$ for $s \le a$ and $\boldsymbol{J} = \boldsymbol{0}$ for $s > a$.

**Step 1: narrow down the form of the field.** The configuration is invariant under translations along $z$ and rotations about the $z$ axis, so the cylindrical components $B_s, B_\phi, B_z$ are all functions of $s$ alone.

For $B_s$, apply the integral form of <Ref to="thm-div-b" /> to the closed surface consisting of a cylindrical surface of radius $s$ and length $L$ together with the two end discs. The contributions of the end discs cancel because $B_z(s)$ does not depend on $z$, and the contribution of the lateral surface is $B_s(s)\cdot 2\pi s L$. Hence $B_s(s)\,2\pi s L = 0$, that is, $B_s = 0$.

For $B_z$, apply <Ref to="cor-ampere-integral" /> to the closed curve bounding the rectangle $[s_1,s_2]\times[0,L]$ in the plane containing the $s$ axis and the $z$ axis. No current threads this rectangle (the current points along $z$, while the normal of the rectangle points along $\boldsymbol{e}_\phi$), so $\big(B_z(s_1)-B_z(s_2)\big)L = 0$; that is, $B_z$ is a constant independent of $s$. Requiring the field to vanish at infinity gives $B_z \equiv 0$.

What remains is $\boldsymbol{B} = B_\phi(s)\,\boldsymbol{e}_\phi$.

**Step 2: take a circular loop.** Apply <Ref to="cor-ampere-integral" /> to the disc bounded by the circle $C$ of radius $s$ centred on the $z$ axis (counterclockwise). The left-hand side is $B_\phi(s)\cdot 2\pi s$, and on the right

$$
I_{\text{enc}} = \begin{cases} \dfrac{I}{\pi a^2}\cdot\pi s^2 = I\dfrac{s^2}{a^2} & (s \le a) \\[2mm] I & (s \ge a)\end{cases}
$$

so that

$$
\boldsymbol{B} = \begin{cases} \dfrac{\mu_0 I\,s}{2\pi a^2}\,\boldsymbol{e}_\phi & (s\le a)\\[2mm] \dfrac{\mu_0 I}{2\pi s}\,\boldsymbol{e}_\phi & (s\ge a)\end{cases}
$$

Inside the conductor the field grows from $0$ at the centre in proportion to $s$, reaching its maximum $\mu_0 I/(2\pi a)$ at $s=a$; outside it decays as $1/s$. Note that the two expressions agree at $s = a$, and that the exterior expression agrees with <Ref to="ex-straight-wire" />. Seen from outside the wire, its thickness is invisible.
</Example>

<Example id="ex-solenoid" title="An infinitely long solenoid">
A current $I$ flows in an infinitely long cylindrical coil wound densely with $n$ turns per unit length. Assuming the winding is dense enough, we regard the current as flowing on the cylindrical surface in the $\boldsymbol{e}_\phi$ direction with surface current density $nI$.

By symmetry, the same argument as in <Ref to="ex-cylinder" /> gives $B_s = 0$. Moreover, since the current now points along $\boldsymbol{e}_\phi$, no current threads a disc bounded by a circle centred on the $z$ axis, so <Ref to="cor-ampere-integral" /> gives $B_\phi\cdot 2\pi s = 0$, that is, $B_\phi = 0$. What remains is $\boldsymbol{B} = B_z(s)\boldsymbol{e}_z$.

Take a rectangular loop in the $sz$ plane (of length $L$ along $z$, running from $s_1$ to $s_2$ in $s$). Since $\boldsymbol{B}$ has only a $z$ component, the circulation comes only from the two sides along $z$ and equals $\big(B_z(s_1)-B_z(s_2)\big)L$.

- With both sides outside the coil (both $s_1, s_2$ greater than the radius), no current is threaded, so $B_z$ is constant outside. Since it must vanish at infinity, $B_z = 0$ outside.
- With one side inside and the other outside, the loop threads the winding $nL$ times, so $I_{\text{enc}} = nLI$. Hence $\big(B_z^{\text{in}} - 0\big)L = \mu_0 n L I$, that is,

$$
\boldsymbol{B}^{\text{in}} = \mu_0 n I\,\boldsymbol{e}_z .
$$

- With both sides inside, $I_{\text{enc}} = 0$, so $B_z$ is independent of $s$ inside.

We conclude that the interior of an infinite solenoid carries the uniform field $\mu_0 nI$ and the exterior field is $\boldsymbol{0}$. For instance with $n = 1000\ \mathrm{m^{-1}}$ and $I = 2\ \mathrm{A}$ we get $B = 4\pi\times10^{-7}\times1000\times2 \approx 2.5\times10^{-3}\ \mathrm{T}$.
</Example>

## 7. Magnetostatics summarized, and the bridge to the next chapter

For steady currents, this article has obtained the following two laws.

| | Differential form | Integral form | Meaning |
|---|---|---|---|
| Divergence of the field | $\nabla\cdot\boldsymbol{B} = 0$ | $\oint_S \boldsymbol{B}\cdot d\boldsymbol{S} = 0$ | there is no magnetic charge |
| Curl of the field | $\nabla\times\boldsymbol{B} = \mu_0\boldsymbol{J}$ | $\oint_C\boldsymbol{B}\cdot d\boldsymbol{l} = \mu_0 I_{\text{enc}}$ | currents are the sources of the vortex |

Placing these beside the electrostatic $\nabla\cdot\boldsymbol{E} = \rho/\epsilon_0$ and $\nabla\times\boldsymbol{E} = \boldsymbol{0}$, we have four equations in hand. Maxwell's equations are one step away.

But every result of this article depended on $\nabla\cdot\boldsymbol{J} = 0$. Indeed, taking the divergence of both sides of $\nabla\times\boldsymbol{B} = \mu_0\boldsymbol{J}$, the left-hand side vanishes identically by <Ref to="lem-div-curl" />, so

$$
0 = \mu_0\,\nabla\cdot\boldsymbol{J} = -\mu_0\frac{\partial\rho}{\partial t} ,
$$

which is incompatible with any situation in which $\partial\rho/\partial t \ne 0$, such as the charging of a capacitor. How to resolve this contradiction is the subject of [Electromagnetic induction and the displacement current](/physics/electromagnetism/induction-and-displacement-current), and beyond it lies [Maxwell's equations and electromagnetic waves](/physics/electromagnetism/maxwell-equations).

## 8. Exercises

<Exercise id="exr-finite-wire" difficulty="Standard">
Let a current $I$ flow in the $+z$ direction along the segment $z_1 \le z \le z_2$ of the $z$ axis (note that in reality this is part of a circuit, and by itself it is not a steady current). Use <Ref to="ax-biot-savart" /> to find the magnetic field at the point $(s, 0, 0)$ with $s > 0$. Verify also that the result of <Ref to="ex-straight-wire" /> is recovered in the limit $z_1 \to -\infty$, $z_2\to+\infty$.

<Solution>
The intermediate computation of <Ref to="ex-straight-wire" /> applies verbatim. Since $d\boldsymbol{l}'\times(\boldsymbol{r}-\boldsymbol{r}') = s\,dz'\,\boldsymbol{e}_\phi$,

$$
B_\phi = \frac{\mu_0 I s}{4\pi}\int_{z_1}^{z_2}\frac{dz'}{(s^2+z'^2)^{3/2}} .
$$

The antiderivative is

$$
\int\frac{dz'}{(s^2+z'^2)^{3/2}} = \frac{z'}{s^2\sqrt{s^2+z'^2}} + C
$$

(differentiating the right-hand side with respect to $z'$ and using the quotient rule gives $\dfrac{\sqrt{s^2+z'^2} - z'\cdot z'/\sqrt{s^2+z'^2}}{s^2(s^2+z'^2)} = \dfrac{s^2}{s^2(s^2+z'^2)^{3/2}} = \dfrac{1}{(s^2+z'^2)^{3/2}}$, which confirms it). Therefore

$$
\boldsymbol{B} = \frac{\mu_0 I}{4\pi s}\left(\frac{z_2}{\sqrt{s^2+z_2^2}} - \frac{z_1}{\sqrt{s^2+z_1^2}}\right)\boldsymbol{e}_\phi .
$$

Measuring the angles subtended by the ends of the segment from the field point relative to the perpendicular, say $\theta_i$ with $\sin\theta_i = z_i/\sqrt{s^2+z_i^2}$, this reads $B_\phi = \dfrac{\mu_0 I}{4\pi s}(\sin\theta_2 - \sin\theta_1)$.

As $z_2\to+\infty$ we have $z_2/\sqrt{s^2+z_2^2}\to 1$, and as $z_1\to-\infty$ we have $z_1/\sqrt{s^2+z_1^2}\to -1$, so the bracket converges to $2$ and

$$
\boldsymbol{B} \to \frac{\mu_0 I}{4\pi s}\cdot 2\,\boldsymbol{e}_\phi = \frac{\mu_0 I}{2\pi s}\boldsymbol{e}_\phi ,
$$

in agreement with <Ref to="ex-straight-wire" />.

Note that <Ref to="cor-steady-divj" /> fails for a current on a segment alone, so <Ref to="cor-ampere-integral" /> must not be applied directly to this configuration. The formula above is meaningful only when the whole closed circuit is decomposed into segments and their contributions summed.
</Solution>
</Exercise>

<Exercise id="exr-coaxial" difficulty="Standard">
Consider a coaxial cable. The central conductor is a cylinder of radius $a$ carrying a total current $I$ in the $+z$ direction with uniform current density. The outer conductor is the cylindrical shell $b \le s \le c$ (with $a < b$) carrying a total current $I$ in the $-z$ direction with uniform current density. Find the magnetic field in each of the four regions $s < a$, $a < s < b$, $b < s < c$ and $s > c$.

<Solution>
The same symmetry argument as in <Ref to="ex-cylinder" /> gives $\boldsymbol{B} = B_\phi(s)\boldsymbol{e}_\phi$, and applying <Ref to="cor-ampere-integral" /> to the circle of radius $s$ gives $B_\phi(s) = \dfrac{\mu_0 I_{\text{enc}}(s)}{2\pi s}$. It remains only to count $I_{\text{enc}}$.

**For $s < a$:** counting only the fraction of the cross-section of the inner conductor, $I_{\text{enc}} = I\,s^2/a^2$. Hence $B_\phi = \dfrac{\mu_0 I s}{2\pi a^2}$.

**For $a < s < b$:** $I_{\text{enc}} = I$, hence $B_\phi = \dfrac{\mu_0 I}{2\pi s}$.

**For $b < s < c$:** the cross-section of the outer conductor has area $\pi(c^2-b^2)$, and the part of it inside radius $s$ has area $\pi(s^2-b^2)$, so the contribution of the reversed current is $-I\dfrac{s^2-b^2}{c^2-b^2}$. Altogether

$$
I_{\text{enc}} = I\left(1 - \frac{s^2-b^2}{c^2-b^2}\right) = I\,\frac{c^2-s^2}{c^2-b^2},
\qquad
B_\phi = \frac{\mu_0 I}{2\pi s}\cdot\frac{c^2-s^2}{c^2-b^2}.
$$

**For $s > c$:** $I_{\text{enc}} = I - I = 0$, hence $B_\phi = 0$.

That no field leaks outside at all is the advantage of a coaxial cable. Check also that the expressions join continuously at $s = b$ and $s = c$ (at $s=b$ the third expression gives $\mu_0 I/(2\pi b)$, and at $s=c$ it gives $0$).
</Solution>
</Exercise>

<Exercise id="exr-toroid" difficulty="Easy">
A wire is wound uniformly $N$ times around a doughnut-shaped core whose central axis is the $z$ axis, and a current $I$ is passed through it (a toroidal coil). Assume the winding covers the core densely. Find the magnetic field inside the core (the region enclosed by the coil) and outside it.

<Solution>
The system is rotationally symmetric about the $z$ axis. The current in the winding flows within the $sz$ plane, so by the same argument as in <Ref to="ex-solenoid" /> the field has the form $\boldsymbol{B} = B_\phi(s,z)\,\boldsymbol{e}_\phi$ (only the $\boldsymbol{e}_\phi$ component survives).

Take a horizontal circle $C$ of radius $s$ centred on the $z$ axis and apply <Ref to="cor-ampere-integral" />. The left-hand side is $B_\phi\cdot 2\pi s$.

- When $C$ passes through the interior of the core, a disc bounded by $C$ threads the winding $N$ times, so $I_{\text{enc}} = NI$ and

$$
B_\phi = \frac{\mu_0 N I}{2\pi s}.
$$

- When $C$ passes through the hole of the doughnut (small $s$), the disc threads no winding, so $I_{\text{enc}} = 0$ and $B_\phi = 0$.
- When $C$ passes outside the core, the disc threads each turn twice, once going and once returning, with opposite orientations, so the net $I_{\text{enc}} = 0$ and $B_\phi = 0$.

Thus the field is confined entirely to the interior of the core, its magnitude falling off in inverse proportion to the distance $s$ from the central axis. If the thickness of the core is small compared with the central radius, $s$ may be treated as essentially constant and one recovers the same $\mu_0 n I$ as for a solenoid, where $n = N/(2\pi s)$ is the number of turns per unit length.
</Solution>
</Exercise>

<Exercise id="exr-capacitor" difficulty="Hard">
A parallel-plate capacitor is being charged at a constant current $I$ through a wire. Fix a circle $C$ encircling the wire and consider two surfaces bounded by $C$: let $S_1$ be the flat disc pierced perpendicularly by the wire, and let $S_2$ be a bag-shaped surface that avoids the wire and passes between the plates. Compute $\mu_0\int_S \boldsymbol{J}\cdot d\boldsymbol{S}$ for $S = S_1$ and $S = S_2$, and state which hypothesis of <Ref to="cor-ampere-integral" /> is violated.

<Solution>
Since $S_1$ is pierced by the wire, $\int_{S_1}\boldsymbol{J}\cdot d\boldsymbol{S} = I$ and the right-hand side is $\mu_0 I$. The surface $S_2$, on the other hand, passes between the plates. Between the plates there is vacuum (or an insulator) and no flow of charge, so $\boldsymbol{J} = \boldsymbol{0}$ there; hence $\int_{S_2}\boldsymbol{J}\cdot d\boldsymbol{S} = 0$ and the right-hand side is $0$.

The left-hand side $\oint_C\boldsymbol{B}\cdot d\boldsymbol{l}$ is a quantity determined by the curve $C$ alone, so it cannot equal both $\mu_0 I \ne 0$ and $0$. This is a contradiction.

The hypothesis that is violated is **steadiness**. Charge accumulates on the plates as time goes on, so $\partial\rho/\partial t \ne 0$ at the plates, and <Ref to="thm-continuity" /> gives $\nabla\cdot\boldsymbol{J} = -\partial\rho/\partial t \ne 0$. Then <Ref to="cor-steady-divj" /> is unavailable, and the derivations of <Ref to="lem-div-a" />, <Ref to="thm-ampere-differential" /> and <Ref to="cor-ampere-integral" /> all collapse. The property of being independent of the choice of surface, seen in <Ref to="rem-surface-independence" />, likewise rested precisely on $\nabla\cdot\boldsymbol{J}=0$.

What rescues this breakdown is Maxwell's displacement current: replacing $\boldsymbol{J}$ by $\boldsymbol{J} + \epsilon_0\partial\boldsymbol{E}/\partial t$, the continuity equation makes $\nabla\cdot\!\left(\boldsymbol{J} + \epsilon_0\dfrac{\partial\boldsymbol{E}}{\partial t}\right) = -\dfrac{\partial\rho}{\partial t} + \dfrac{\partial\rho}{\partial t} = 0$ an identity (we used $\nabla\cdot\boldsymbol{E} = \rho/\epsilon_0$). For details see [Electromagnetic induction and the displacement current](/physics/electromagnetism/induction-and-displacement-current).
</Solution>
</Exercise>

## References

- S. Sunakawa, *Riron Denjikigaku*, 3rd ed., Kinokuniya, 1999 (in Japanese) — the chapter on steady currents and magnetostatic fields; its organization around the vector potential is close to the flow of this article.
- D. J. Griffiths, *Introduction to Electrodynamics*, 4th ed., Cambridge University Press, 2017 — Chapter 5, "Magnetostatics". The route from the Biot–Savart law to Ampère's law is set out carefully.
- J. D. Jackson, *Classical Electrodynamics*, 3rd ed., Wiley, 1999 — Chapter 5. The vector-calculus identities are collected in the appendix.
- *Feynman Butsurigaku III: Denjikigaku*, Iwanami Shoten (in Japanese; the Japanese edition of The Feynman Lectures on Physics) — the chapters on the magnetic field. The physical interpretation of curl and circulation is explained very readably.
- K. Ohta, *Denjikigaku no Kiso I*, University of Tokyo Press, 2012 (in Japanese) — a detailed account of the historical background (Ørsted, Biot–Savart, Ampère).
- M. Sugiura, *Kaiseki Nyūmon II*, University of Tokyo Press, 1985 (in Japanese) — rigorous treatment of the divergence theorem and Stokes' theorem.
- BIPM, *The International System of Units (SI Brochure)*, 9th ed. — the status of $\mu_0$ after the 2019 redefinition. [SI Brochure (BIPM)](https://www.bipm.org/en/publications/si-brochure)

## Appendix: The vector-calculus identities we used

**Notational preliminaries.** Below we write the Cartesian components as $x_1, x_2, x_3$ and set $\partial_i := \partial/\partial x_i$. A repeated index is summed from $1$ to $3$ (the Einstein convention). The Levi-Civita symbol $\epsilon_{ijk}$ is $+1$ if $(i,j,k)$ is an even permutation of $(1,2,3)$, $-1$ if it is odd, and $0$ otherwise. The cross product and the curl are then

$$
(\boldsymbol{a}\times\boldsymbol{b})_i = \epsilon_{ijk}a_j b_k,\qquad (\nabla\times\boldsymbol{F})_i = \epsilon_{ijk}\partial_j F_k .
$$

The relation we use constantly is

$$
\epsilon_{kij}\epsilon_{klm} = \delta_{il}\delta_{jm} - \delta_{im}\delta_{jl}
$$

($\delta$ being the Kronecker delta).

**Expanding the double curl.** We verify the identity used in the proof of <Ref to="thm-ampere-differential" />. For $\boldsymbol{A}$ of class $C^2$,

$$
\begin{aligned}
\big[\nabla\times(\nabla\times\boldsymbol{A})\big]_i
&= \epsilon_{ijk}\partial_j(\nabla\times\boldsymbol{A})_k
= \epsilon_{ijk}\epsilon_{klm}\partial_j\partial_l A_m \\
&= \epsilon_{kij}\epsilon_{klm}\partial_j\partial_l A_m
= (\delta_{il}\delta_{jm}-\delta_{im}\delta_{jl})\partial_j\partial_l A_m \\
&= \partial_j\partial_i A_j - \partial_j\partial_j A_i
= \partial_i(\nabla\cdot\boldsymbol{A}) - \nabla^2 A_i .
\end{aligned}
$$

In the second line we used $\epsilon_{ijk} = \epsilon_{kij}$ (invariance under cyclic permutation), and in the last line we interchanged $\partial_j\partial_i = \partial_i\partial_j$ by Schwarz's theorem, $\boldsymbol{A}$ being of class $C^2$. Hence

$$
\nabla\times(\nabla\times\boldsymbol{A}) = \nabla(\nabla\cdot\boldsymbol{A}) - \nabla^2\boldsymbol{A} .
$$

**The divergence of a cross product.** We proved <Ref to="thm-div-b" /> by way of <Ref to="prop-vector-potential" />, but it can also be shown directly from the Biot–Savart integral. What is needed then is

$$
\nabla\cdot(\boldsymbol{a}\times\boldsymbol{b}) = \boldsymbol{b}\cdot(\nabla\times\boldsymbol{a}) - \boldsymbol{a}\cdot(\nabla\times\boldsymbol{b}) .
$$

The component computation runs as follows.

$$
\begin{aligned}
\nabla\cdot(\boldsymbol{a}\times\boldsymbol{b}) &= \partial_i(\epsilon_{ijk}a_j b_k) = \epsilon_{ijk}(\partial_i a_j)b_k + \epsilon_{ijk}a_j(\partial_i b_k) \\
&= b_k\,\epsilon_{kij}\partial_i a_j - a_j\,\epsilon_{jik}\partial_i b_k
= \boldsymbol{b}\cdot(\nabla\times\boldsymbol{a}) - \boldsymbol{a}\cdot(\nabla\times\boldsymbol{b}).
\end{aligned}
$$

Here the first term used $\epsilon_{ijk} = \epsilon_{kij}$ and the second $\epsilon_{ijk} = -\epsilon_{jik}$.

Applying this with $\boldsymbol{a} = \boldsymbol{J}(\boldsymbol{r}')$ and $\boldsymbol{b} = \boldsymbol{R}/R^3$: the field $\boldsymbol{J}(\boldsymbol{r}')$ does not depend on $\boldsymbol{r}$, so $\nabla\times\boldsymbol{a} = \boldsymbol{0}$; and $\boldsymbol{R}/R^3 = -\nabla(1/R)$ with the curl of a gradient vanishing, so $\nabla\times\boldsymbol{b} = \boldsymbol{0}$. Hence the divergence of the integrand of <Ref to="ax-biot-savart" /> vanishes at every point, and $\nabla\cdot\boldsymbol{B} = 0$ follows directly.
