Back to the on-screen lesson ·
$\nabla \cdot \vec{B} = 0$ and $\nabla \times \vec{B} = \mu_0\vec{J}$: Ampère's law for wires, solenoids and toroids, nonuniform currents, and the vector potential $\vec{B} = \nabla \times \vec{A}$.
Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.
By the end of this lesson you will be able to use Ampère's law to find the fields of symmetric current distributions, check them with the differential form, and work with the vector potential.
You know the Biot–Savart law, Gauss's law and its use with symmetry, and Ampère's law in integral form from Physics C. You know divergence, curl and Stokes's theorem. This lesson writes the laws of magnetostatics as differential equations and uses Ampère's law as efficiently as Gauss's.
| Term | What it means |
|---|---|
| Ampère's law | $\oint\vec{B} \cdot d\vec{l} = \mu_0I_{\text{enc}}$, or $\nabla \times \vec{B} = \mu_0\vec{J}$. |
| Amperian loop | A closed path chosen so that $\vec{B}$ is constant and tangent along it, or perpendicular to it. |
| Enclosed current | The net current through any surface bounded by the Amperian loop. |
| Solenoid | A long helical coil, with uniform field $\mu_0nI$ inside. |
| Toroid | A coil wound around a doughnut, with field $\mu_0NI/2\pi s$ inside and none outside. |
| Vector potential | $\vec{A}$, with $\vec{B} = \nabla \times \vec{A}$. |
| Coulomb gauge | The choice $\nabla \cdot \vec{A} = 0$, giving $\nabla^2\vec{A} = -\mu_0\vec{J}$. |
Taking the divergence and curl of the Biot–Savart field gives the two laws of magnetostatics:
$$\nabla \cdot \vec{B} = 0, \qquad \nabla \times \vec{B} = \mu_0\vec{J}.$$
The first says there are no magnetic charges: field lines never start or stop. The second says currents are the sources of the field's circulation. By Stokes's theorem the second becomes Ampère's law,
$$\oint\vec{B} \cdot d\vec{l} = \mu_0I_{\text{enc}}.$$
Like Gauss's law, it is always true but gives $\vec{B}$ only with symmetry. Four geometries work: an infinite straight line of current ($B = \mu_0I_{\text{enc}}/2\pi s$, including inside a thick wire); an infinite plane of current ($B = \mu_0K/2$); an infinite solenoid ($B = \mu_0nI$ inside, zero outside); and a toroid ($B = \mu_0NI/2\pi s$ inside).
Because $\nabla \cdot \vec{B} = 0$, the field can be written as the curl of a vector potential, $\vec{B} = \nabla \times \vec{A}$. With the choice $\nabla \cdot \vec{A} = 0$, Ampère's law becomes $\nabla^2\vec{A} = -\mu_0\vec{J}$, three Poisson equations, whose solution parallels the electric potential: $\vec{A} = \frac{\mu_0}{4\pi}\int\frac{\vec{J}}{\mathscr{r}}d\tau$. The flux through a loop equals the circulation of $\vec{A}$ around it.
Another way: picture
Picture walking around a closed path in a magnetic field, adding up how much the field pushes along your path at each step. Ampère's law says the total depends only on the current threading through your path — not on where the current is inside, or on currents outside. When symmetry makes every step identical, dividing the total by the path length gives the field.
Another way: steps
Checks. $\vec{B}$ must be continuous where no surface current flows. Inside a wire it must vanish on the axis; outside it must fall as $1/s$. A solenoid's field must not depend on its radius. And differentiating your answer should return the current density through $\nabla \times \vec{B} = \mu_0\vec{J}$.
The rings in the figure show what zero divergence looks like: field lines around a current close on themselves, with no point where they begin or end.
Every Biot–Savart contribution is a cross product of a current element with the separation vector, a structure that makes its divergence vanish identically. Physically, magnetic field lines form closed loops or extend to infinity; they never begin or end on anything, because no isolated magnetic charges — monopoles — have ever been found.
Physicists have searched hard. Grand unified theories predict monopoles from the early universe, and experiments such as MACRO under Italy's Gran Sasso mountain and searches at the Large Hadron Collider have looked for them without success. If one were found, $\nabla \cdot \vec{B}$ would acquire a source term and Maxwell's equations would gain a beautiful symmetry between electricity and magnetism. Until then, $\nabla \cdot \vec{B} = 0$ holds everywhere.
For a long solenoid, a rectangular loop with one side inside and one outside encloses $nL$ turns, each carrying $I$; the outside field is negligible, so $BL = \mu_0nLI$ and $B = \mu_0nI$. A rectangle entirely inside encloses no current, which proves the field is the same everywhere inside, not just on the axis.
A toroid bends the solenoid into a ring. A circular loop inside the winding encloses $NI$, giving $B = \mu_0NI/2\pi s$; loops inside the hole or outside the toroid enclose zero net current, so the field there vanishes. The toroid confines its field completely, which is why transformer cores and inductors are often toroidal: little field leaks out to disturb nearby circuits, and fusion experiments called tokamaks use toroidal fields to confine plasma.
When the current density varies across a wire, the enclosed current needs an integral. For $J = ks$ in a wire of radius $R$, $I_{\text{enc}} = \int_0^s ks'\,2\pi s'\,ds' = \frac{2\pi ks^3}{3}$, and $B = \mu_0ks^2/3$ inside. At high frequencies, current crowds toward the surface of a conductor — the skin effect of a later lesson — and the field inside drops almost to zero.
Coaxial cables exploit Ampère's law: equal and opposite currents in the inner conductor and the outer shield give a field only between them. A loop outside the cable encloses zero net current, so a coaxial cable produces no external magnetic field and is immune to external interference, which is why it carries cable-television and radio-frequency signals.
Because $\nabla \cdot \vec{B} = 0$, a vector field $\vec{A}$ exists with $\vec{B} = \nabla \times \vec{A}$. It is not unique: adding the gradient of any function leaves $\vec{B}$ unchanged, a freedom called gauge freedom. Choosing $\nabla \cdot \vec{A} = 0$ turns Ampère's law into $\nabla^2\vec{A} = -\mu_0\vec{J}$, solved component by component like Poisson's equation.
By Stokes's theorem, the magnetic flux through a loop equals $\oint\vec{A} \cdot d\vec{l}$ around it. Inside a solenoid $\vec{A}$ circles the axis with $A = \mu_0nIs/2$; outside, where $\vec{B} = 0$, $\vec{A}$ is still nonzero, $A = \mu_0nIR^2/2s$. In quantum mechanics that outside potential has observable effects: electrons passing around a solenoid shift their interference fringes even though they never enter the field — the Aharonov–Bohm effect, confirmed by Akira Tonomura's team in 1986.
A sheet of current with surface current density $\vec{K}$ (amperes per meter of width) produces a field $\mu_0K/2$ on each side, pointing in opposite directions. So the tangential component of $\vec{B}$ jumps by $\mu_0K$ across the sheet, while the normal component, by $\nabla \cdot \vec{B} = 0$, is continuous.
A solenoid is a rolled-up current sheet with $K = nI$, and its field, $\mu_0nI$ inside and zero outside, is exactly this jump. These boundary conditions — normal $B$ continuous, tangential $B$ jumping by the surface current — are the magnetic counterparts of those for $\vec{E}$, and together they determine how fields behave at the surfaces of wires, magnets and superconductors.
The field of a solenoid, $\mu_0nI$, grows with the current and the density of turns, and strong magnets push both. Superconducting wire carries hundreds of amperes with no resistance, so MRI solenoids reach $1.5$ to $3$ T with modest power, and research magnets reach $7$ T or more. The limit is set by the superconductor itself, which stops superconducting above a critical field, and by the magnetic pressure $B^2/2\mu_0$, which at $10$ T is $40$ MPa, four hundred atmospheres, pushing the windings outward.
The National High Magnetic Field Laboratory's $32$ T all-superconducting magnet uses high-temperature superconducting tape in its inner coils. Fusion projects such as Commonwealth Fusion Systems in Massachusetts have built $20$ T magnets with the same materials, aiming for compact tokamaks, where Ampère's law determines how many ampere-turns are needed for the confining field.
Ampère's law as written, $\nabla \times \vec{B} = \mu_0\vec{J}$, has a hidden flaw. The divergence of a curl is always zero, so it requires $\nabla \cdot \vec{J} = 0$: steady currents only. When charge piles up, as on a charging capacitor, the law contradicts charge conservation: a loop around the wire and a surface passing between the plates give different enclosed currents.
James Clerk Maxwell fixed this in the 1860s by adding a term, the displacement current, that makes changing electric fields act as sources of magnetic circulation. That correction, the subject of lesson 15, completed the laws of electromagnetism and predicted electromagnetic waves traveling at the speed of light. In magnetostatics, with steady currents, the uncorrected law is exact.
The main magnet of an MRI scanner is a superconducting solenoid wound from niobium-titanium wire, cooled by liquid helium to about $4$ K. Ampère's law, $B = \mu_0nI$, says a $1.5$ T field with $2000$ turns per meter needs about $600$ A. Once the current is established, a superconducting switch closes the circuit and the current circulates for years with no power supply, losing a few parts per million per year.
Real scanners are short compared with their bore, so designers shape the winding, adding extra coils near the ends, to make the field uniform to a few parts per million over a sphere the size of a head. Active shielding coils, wound in the opposite direction outside the main coil, cancel the field that would otherwise extend meters into the hospital. About $13{,}000$ MRI scanners operate in the United States.
A tokamak confines hydrogen plasma, heated to over $100$ million kelvins, in a doughnut-shaped vacuum vessel. Toroidal field coils wound around the vessel produce the main field, which by Ampère's law is $\mu_0NI/2\pi s$: strongest on the inside of the doughnut and weaker toward the outside. Charged particles spiral along the field lines and are kept away from the walls.
Stronger fields mean smaller, cheaper reactors, because the plasma pressure that can be confined grows as $B^2$. The SPARC tokamak under construction in Massachusetts by Commonwealth Fusion Systems, with MIT, uses high-temperature superconducting magnets producing about $12$ T at the plasma. ITER in France, with conventional superconductors, needs a much larger device for comparable performance. In both, the required ampere-turns follow directly from Ampère's law.
It is tempting to apply $B \cdot 2\pi s = \mu_0I$ to any current, such as a short wire segment or a single loop. That fails: for a finite segment the field is not constant around a circle, and a loop's field has no circular symmetry about any axis in the right way. Ampère's law still holds for those currents, but the integral does not reduce to $B$ times a length. For such cases use the Biot–Savart law.
A second error is to think that currents outside the Amperian loop do not affect the field on it. They do affect it; they simply contribute zero to the circulation. Symmetry is what guarantees their effect cancels or can be ignored in the standard cases.
A wire of radius $R$ carries current $I$ uniformly. Choose a circle of radius $s < R$.
$\oint\vec{B} \cdot d\vec{l} = B \cdot 2\pi s$
$\vec{B}$ circles the axis with constant size.
Find the enclosed current.
$I_{\text{enc}} = I\dfrac{\pi s^2}{\pi R^2} = I\dfrac{s^2}{R^2}$
Uniform current density.
Solve for the inside field.
$B = \dfrac{\mu_0Is}{2\pi R^2}$
Linear in $s$.
Solve for the outside field.
$B = \dfrac{\mu_0I}{2\pi s}$
All the current enclosed.
Check continuity at the surface.
$\dfrac{\mu_0IR}{2\pi R^2} = \dfrac{\mu_0I}{2\pi R}$
No surface current, so no jump.
Draw a rectangle of length $L$ with one long side inside and one outside the solenoid.
$\oint\vec{B} \cdot d\vec{l} = B_{\text{in}}L - B_{\text{out}}L$
The short sides are perpendicular to the axial field.
Argue the outside field is zero.
$B_{\text{out}} = 0$
A rectangle entirely outside shows $B_{\text{out}}$ is uniform, and it must vanish far away.
Count the enclosed current.
$I_{\text{enc}} = nLI$
$nL$ turns pass through the rectangle.
Apply Ampère's law.
$B_{\text{in}}L = \mu_0nLI$
Equate the two sides.
Solve for the field.
$B = \mu_0nI$
Independent of position inside.
Evaluate for $n = 1000$ m⁻¹ and $I = 2.0$ A.
$B = 4\pi \times 10^{-7} \times 1000 \times 2.0 = 2.5\ \text{mT}$
Fifty times Earth's field.
A wire of radius $R$ has $J = ks$. Find the enclosed current.
$I_{\text{enc}} = \displaystyle\int_0^sks' \cdot 2\pi s'\,ds' = \dfrac{2\pi ks^3}{3}$
Rings of area $2\pi s'\,ds'$.
Apply Ampère's law inside.
$B \cdot 2\pi s = \mu_0\dfrac{2\pi ks^3}{3}$
Circle of radius $s$.
Solve for the field.
$B = \dfrac{\mu_0ks^2}{3}$
Quadratic in $s$.
Check with the differential form.
$(\nabla \times \vec{B})_z = \dfrac{1}{s}\dfrac{d}{ds}(sB) = \dfrac{1}{s}\cdot\dfrac{\mu_0k \cdot 3s^2}{3} = \mu_0ks$
Equals $\mu_0J$, as required.
Find the total current.
$I = \dfrac{2\pi kR^3}{3}$
At $s = R$.
Write the outside field.
$B = \dfrac{\mu_0I}{2\pi s}$
The distribution inside does not matter outside.
Find the vector potential outside.
$\vec{B} = \nabla \times \vec{A}, \quad \vec{A} = -\dfrac{\mu_0I}{2\pi}\ln\dfrac{s}{R}\,\hat{z}$
Along the current: $B_\phi = -\partial A_z/\partial s$.
Check the vector potential.
$-\dfrac{\partial A_z}{\partial s} = \dfrac{\mu_0I}{2\pi s}$
Recovers the field.
Write the toroid field.
$B = \dfrac{\mu_0NI}{2\pi s}$
From a circular Amperian loop.
Substitute the values.
$B = \dfrac{2 \times 10^{-7} \times 500 \times 2}{0.10}$
$\mu_0/2\pi = 2 \times 10^{-7}$.
Evaluate the field.
Near the axis of a long solenoid the field is $83$ mT. What is the field inside the solenoid halfway from the axis to the windings?
Complete the worked solution: a wire of radius $2$ cm carries $20$ A spread uniformly over its cross section. Find the current enclosed within $1$ cm of the axis, the field there, and the field at the surface, in μT.
Scale the current by the area fraction.
$I_{\text{enc}} = 20 \times \left(\tfrac{1}{2}\right)^2 =$ p A
A quarter of the cross section.
Apply Ampère's law at $1$ cm.
$B = \dfrac{2 \times 10^{-7} \times I_{\text{enc}}}{0.01} =$ q
In μT.
Apply Ampère's law at the surface.
$B = \dfrac{2 \times 10^{-7} \times 20}{0.02} =$ r
All the current is enclosed; the field is largest here.
Match each statement to its equation.
| $\nabla \times \vec{B} = \mu_0\vec{J}$ | $\nabla \cdot \vec{B} = 0$ | $\mu_0nI$ | $\mu_0NI/2\pi s$ | |
|---|---|---|---|---|
| Ampère's law, differential form | ||||
| no magnetic charge | ||||
| a solenoid's field | ||||
| a toroid's field |
A long wire of radius $R$ carries a current spread uniformly over its cross section, with $\mu_0I/2\pi R = 444$ μT. Fill in the field at $s = R/2$, $R$ and $2R$.
| $B$ (μT) | |
|---|---|
| $s = R/2$ | |
| $s = R$ | |
| $s = 2R$ |
A long solenoid has $36$ turns per centimeter and carries $2$ A. What is the field inside, in mT? Use $\mu_0 = 4\pi \times 10^{-7}$ T m/A.
Answer: mT
A toroid is wound with $N = 851$ turns carrying $9$ A. What is the magnetic field inside the winding at $4$ cm from the toroid's central axis, in mT?
Answer: mT
An MRI scanner's superconducting solenoid produces $7$ T with $6000$ turns per meter. Treating it as a long solenoid, what current must it carry, in amperes?
Answer: A
Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.
A long wire of radius $R$ carries a current spread uniformly over its cross section, with $\mu_0I/2\pi R = 885$ μT. Fill in the field at $s = R/2$, $R$ and $2R$.
| $B$ (μT) | |
|---|---|
| $s = R/2$ | |
| $s = R$ | |
| $s = 2R$ |
You can find magnetic fields with Ampère's law. Explain to someone why the field inside a long solenoid is the same everywhere across its interior.
19. Your turn: a toroid with $500$ turns carries $2$ A. What is the field $10$ cm from its axis?, step 3
$B = 2.0\ \text{mT}$
Confined inside the winding.