Appearance
4.5 — The Magnetic Field
In April 1820, during a lecture demonstration in Copenhagen, Hans Christian Ørsted noticed that a compass needle sitting near a wire twitched when he closed the circuit. Electricity and magnetism had been studied as separate subjects for two centuries. That twitch joined them.
What made it strange was the direction. The needle did not point towards the wire or away from it. It pointed around it, at right angles to both the wire and the line joining them. Nothing in Coulomb's law or Gauss's law hints at a force that acts sideways.
No magnetic charge
Start with what magnetism is not. Every magnet has a north pole and a south pole, and like poles repel while unlike attract, which looks exactly like electric charge.
Cut the magnet in half and you do not get a north piece and a south piece. You get two smaller magnets, each with both poles. Cut again and again, down to a single atom, and it is still a dipole.
Nobody has ever found an isolated magnetic pole — a magnetic monopole — despite a century of increasingly sensitive searches. In field terms this means magnetic field lines never start or stop anywhere; they always form closed loops. And that is Gauss's law for magnetism:
\oint\vec{B}\cdot d\vec{A} = 0
The magnetic flux out of any closed surface is always zero, because every line that goes in comes out. This is one of Maxwell's four equations, and it is the simplest of them: it says magnetic charge does not exist.
Whether that is a deep truth or a local accident is genuinely open. Dirac showed in 1931 that the existence of even a single monopole anywhere in the universe would explain why electric charge is quantised, which is otherwise unexplained. Grand unified theories predict monopoles should exist. None has been found.
The magnetic force on a moving charge
The defining equation is:
\boxed{\vec{F} = q\vec{v}\times\vec{B}}
Read aloud: F equals q v cross B — the force on a charge equals the charge times the cross product of its velocity with the magnetic field. The magnitude is:
F = qvB\sin\theta
where \theta is the angle between \vec{v} and \vec{B}. The unit of \vec{B} is the tesla (T), and one tesla is a very strong field: the Earth's is about 5\times10^{-5} T, a fridge magnet about 10^{-2} T, an MRI scanner 1.5 to 3 T.
Three features make this force unlike any other in the book.
1. It only acts on moving charges. Set v = 0 and the force vanishes. A stationary charge next to a magnet feels nothing at all.
2. It acts perpendicular to the motion. The cross product is by definition perpendicular to both vectors. So the force is always sideways.
3. It does no work, ever. Work is \vec{F}\cdot d\vec{s}, and d\vec{s} is along \vec{v}, and \vec{F} is perpendicular to \vec{v}, so the dot product is zero. A magnetic field can change a charged particle's direction but never its speed.
That third point causes trouble the first time you meet it, because magnets visibly do work — they pick things up. The resolution is that the work in those cases is done by other agencies: by the electric fields induced when things move (Chapter 4.6), or by the internal forces in the material. The bare q\vec{v}\times\vec{B} force on a point charge does no work, and that is exact.
Getting the direction right is a mechanical skill and it is worth practising until it is automatic, because sign errors here are the single largest source of wrong answers in electromagnetism. For a negative charge, work out the direction as if it were positive and then reverse it.
Motion in a uniform field
Fire a charge into a uniform field at right angles to it. The force is perpendicular to the velocity and has constant magnitude, so it turns the particle without speeding it up. A constant-magnitude force always perpendicular to the motion is exactly the condition for circular motion (Chapter 1.5).
Set the magnetic force equal to the centripetal force required:
qvB = \frac{mv^2}{r}
\boxed{r = \frac{mv}{qB}}
The radius is called the gyroradius. Faster particles curve more gently; stronger fields curve them more tightly; heavier particles are harder to bend.
Now find the period. The circumference is 2\pi r and the speed is v:
T = \frac{2\pi r}{v} = \frac{2\pi}{v}\cdot\frac{mv}{qB} = \frac{2\pi m}{qB}
The v cancelled. The time to go round does not depend on the speed at all. A fast particle travels a bigger circle at a higher speed and takes exactly as long. The frequency:
\boxed{f_c = \frac{qB}{2\pi m}}
is the cyclotron frequency, and its independence from speed is the single fact that makes particle accelerators possible.
The cyclotron

Ernest Lawrence's insight in 1929 was to exploit the cancellation above. Put two hollow D-shaped electrodes in a uniform magnetic field with a small gap between them. Inside a "dee" there is no electric field, so the particle simply coasts round a half-circle. Each time it crosses the gap, an alternating voltage gives it a kick.
Because the period is independent of speed, one fixed radio frequency works for the whole acceleration. The particle gets faster, its circle gets bigger, and it arrives at the gap in perfect time regardless. It spirals outwards and is extracted at the rim.
Lawrence's first working cyclotron was 11 cm across and reached 80 keV. Within five years the machines were reaching 8 MeV. Then they hit a wall, and the wall is relativity: as the particle approaches light speed its effective mass rises (Chapter 6.4), the period grows, and it falls out of step with the fixed frequency. The fix is to vary the frequency as the particle speeds up, which gives the synchrocyclotron and then the synchrotron — the design of every large accelerator today, including the LHC.
Worked example: an electron in the Earth's field
An electron moving at 2.0\times10^6 m/s enters the Earth's magnetic field of 5.0\times10^{-5} T perpendicular to it. Find its radius and period.
r = \frac{mv}{qB} = \frac{(9.109\times10^{-31})(2.0\times10^{6})}{(1.602\times10^{-19})(5.0\times10^{-5})} = \frac{1.822\times10^{-24}}{8.01\times10^{-24}} = 0.227\ \text{m}
T = \frac{2\pi m}{qB} = \frac{2\pi(9.109\times10^{-31})}{8.01\times10^{-24}} = \frac{5.723\times10^{-30}}{8.01\times10^{-24}} = 7.14\times10^{-7}\ \text{s}
A 23 cm circle, completed 1.4 million times a second.
If the velocity is not perpendicular, split it into a component along \vec{B} and a component across it. The along component feels no force (\sin 0 = 0) and continues unchanged; the across component circles. The combination is a helix — a spiral drifting along the field line.
That is exactly what charged particles from the Sun do when they meet the Earth's field. They spiral along field lines towards the poles, where the lines converge and dip into the atmosphere, and there they collide with air molecules and make them glow. The aurora is the helical motion above, drawn in the sky. Green comes from oxygen at around 100–150 km, red from oxygen higher up, and blue and purple from nitrogen.
The same geometry traps particles in the Van Allen belts: where field lines converge near the poles, the field strengthens, and a spiralling particle is reflected back — a magnetic mirror. Particles bounce between the two poles for months. Discovering these belts in 1958 was the first scientific result of the American space programme, from a Geiger counter on Explorer 1.
Force on a current-carrying wire
A wire carrying current is a stream of moving charges, so it feels a magnetic force. Add up the force on all the carriers.
In a wire of length L and cross-section A with n carriers per cubic metre, there are nAL carriers, each feeling qv_dB\sin\theta:
F = (nAL)(qv_dB\sin\theta) = (nAv_dq)LB\sin\theta
The bracket is exactly the current from Chapter 4.4, I = nAv_dq:
\boxed{\vec{F} = I\vec{L}\times\vec{B}, \qquad F = ILB\sin\theta}
This is where electric motors come from. Put a rectangular loop carrying current into a field. The two sides perpendicular to the field feel forces in opposite directions — one up, one down — producing a torque that spins the loop. For a coil of N turns and area A:
\tau = NIAB\sin\theta
Define the loop's magnetic moment \mu = NIA, and this becomes \vec{\tau} = \vec{\mu}\times\vec{B}, which is exactly the form the electric dipole obeyed in Chapter 4.1. A current loop is a magnetic dipole, and it is the only kind of magnetic dipole there is — every magnet in the universe is ultimately current loops, as Chapter 4.8 shows.
The torque falls to zero when the loop has rotated into the plane where its moment lines up with the field, which would stop the motor dead at a quarter turn. The fix is the commutator: a split ring that reverses the current direction every half turn, so the torque always pushes the same way round. That single piece of mechanical cleverness is what turns the equation above into a machine.
The field produced by a current: Biot–Savart
So far we have taken \vec{B} as given. Where does it come from?
Jean-Baptiste Biot and Félix Savart measured it within months of Ørsted's discovery. Their result, for a short piece of wire of length d\vec{l} carrying current I:
d\vec{B} = \frac{\mu_0}{4\pi}\frac{I\,d\vec{l}\times\hat{r}}{r^2}
Read aloud: dee-B equals mu-nought over four pi, times I dee-l cross r-hat, over r-squared. The constant \mu_0 is the permeability of free space:
\mu_0 = 4\pi\times10^{-7}\ \text{T m/A} = 1.2566\times10^{-6}
Compare it with Coulomb's law. Both fall off as 1/r^2. Both have a constant with a 4\pi. The difference is the cross product, which makes the magnetic field circle around the current rather than point away from it. That is Ørsted's compass needle, in an equation.
Worked derivation: the field of a long straight wire
Take an infinite straight wire along the z axis carrying current I, and find \vec{B} at perpendicular distance R.
Every element d\vec{l} points along the wire. The vector \hat{r} from the element to the field point makes some angle with it. The cross product d\vec{l}\times\hat{r} points out of the plane containing the wire and the field point — the same direction for every element, which means we can add magnitudes rather than vectors.
Let the element be at height z above the foot of the perpendicular. Then r = \sqrt{R^2+z^2}, and the angle between d\vec{l} and \hat{r} has \sin\theta = R/\sqrt{R^2+z^2}.
dB = \frac{\mu_0 I}{4\pi}\frac{dz\sin\theta}{r^2} = \frac{\mu_0 I}{4\pi}\frac{R\,dz}{(R^2+z^2)^{3/2}}
Integrate over the whole wire. This is the same integral that appeared for the charged ring in Chapter 4.1:
\int_{-\infty}^{\infty}\frac{dz}{(R^2+z^2)^{3/2}} = \frac{2}{R^2}
B = \frac{\mu_0 IR}{4\pi}\cdot\frac{2}{R^2} = \frac{\mu_0 I}{2\pi R}
\boxed{B = \frac{\mu_0 I}{2\pi R}}
Falls off as 1/R, circling the wire, direction given by wrapping your right hand round the wire with the thumb along the current. Notice this is the same 1/R dependence as the electric field of a line charge (Chapter 4.2), and for the same geometric reason.
Worked number. A wire carrying 10 A, at 5 cm:
B = \frac{(4\pi\times10^{-7})(10)}{2\pi(0.05)} = \frac{1.2566\times10^{-5}}{0.3142} = 4.0\times10^{-5}\ \text{T}
Almost exactly the Earth's field, which is why Ørsted's compass needle deflected by roughly 45° — and why the effect had been missed for so long, since you need a decent current and a close approach.
Ampère's law
The Biot–Savart integral is as painful as the Coulomb integral was, and there is a shortcut for the same reason Gauss's law was a shortcut.
\boxed{\oint\vec{B}\cdot d\vec{l} = \mu_0 I_{\text{enclosed}}}
Read aloud: the closed line integral of B dot dee-l equals mu-nought times the enclosed current. Walk around any closed loop, adding up the component of \vec{B} along your path, and the total depends only on the current threading the loop.
Check it against the straight wire. Take a circular path of radius R centred on the wire. By symmetry, B has the same magnitude everywhere on it and points along the path, so:
\oint\vec{B}\cdot d\vec{l} = B(2\pi R) = \mu_0 I \quad\Longrightarrow\quad B = \frac{\mu_0 I}{2\pi R}\ \checkmark
Two lines instead of an integral over an infinite wire.
The solenoid

A long coil of n turns per metre carrying current I. Inside, the field is uniform and along the axis; outside, it is negligible.
Take a rectangular Amperian loop with one long side of length L inside the solenoid, parallel to the axis, and the opposite long side outside. Then:
- The inside side contributes BL.
- The outside side contributes ~0, since B \approx 0 there.
- The two short sides are perpendicular to \vec{B} inside and contribute nothing.
The current enclosed is the number of turns crossing the loop, nL, times I:
BL = \mu_0(nL)I
\boxed{B = \mu_0 nI}
No dependence on the radius or on where inside you measure. The solenoid is the magnetic equivalent of the parallel-plate capacitor: a controlled uniform field in a defined region, and it is how every electromagnet, relay, MRI magnet and inductor is built.
Worked number. A coil with 1000 turns per metre carrying 2 A:
B = (4\pi\times10^{-7})(1000)(2) = 2.51\times10^{-3}\ \text{T}
2.5 millitesla, about fifty times the Earth's field but far below a fridge magnet. To reach the 1.5 T of an MRI you would need nI = 1.19\times10^6 ampere-turns per metre, which is 1000 turns per metre carrying 1190 A — hence superconducting wire, which can carry that current with no heating (Chapter 4.4).
There are two ways to boost a solenoid without absurd currents, and both are used. Put iron inside, which multiplies the field by a factor of hundreds or thousands (Chapter 4.8). Or make the wire superconducting.
The force between two wires, and the old ampere
Two parallel wires, distance d apart, carrying I_1 and I_2.
Wire 1 produces a field at wire 2 of B_1 = \mu_0I_1/2\pi d. Wire 2, carrying current in that field, feels F = I_2LB_1:
\frac{F}{L} = \frac{\mu_0 I_1I_2}{2\pi d}
Parallel currents attract; antiparallel currents repel. This is the opposite of what charges do, and working the direction out with two applications of the right-hand rule is worth doing once by hand.
From 1948 until 2019, this equation defined the ampere: one ampere was the current which, in two infinitely long parallel wires one metre apart, produces a force of exactly 2\times10^{-7} N per metre. That definition is what fixed \mu_0 at exactly 4\pi\times10^{-7}. Since 2019 the ampere is defined from the elementary charge instead, and \mu_0 has become a measured quantity — though it still equals 4\pi\times10^{-7} to within about one part in 10^{10}.
The force is also why heavy current busbars in a substation are physically braced. During a short circuit, tens of kiloamps flow, and the force between adjacent conductors — going as I^2 — can be thousands of newtons per metre. Unbraced busbars have been known to tear themselves apart.
Where this shows up in your life
Every motor is \vec{F} = I\vec{L}\times\vec{B}: the fan in your laptop, the compressor in your fridge, the actuator that moves your car's windows, and the traction motors in an electric car.
Every loudspeaker is a coil in the field of a permanent magnet, glued to a paper cone. Send an audio current through the coil and the force pushes the cone in and out in step with the signal.
The hard disk in an older computer positions its read head with a voice coil actuator — the same device as a loudspeaker, made to move a head instead of a cone, capable of moving between tracks in a few milliseconds.
Mass spectrometers use r = mv/qB directly. Ionise a sample, accelerate all the ions through the same voltage so they have the same energy, then bend them in a field. Heavier ions curve less. Measuring where they land measures their mass, which identifies the molecule — this is how drug testing, forensic analysis and carbon dating measurements are actually done.
The Earth's magnetic field is why life is possible on land. Solar wind particles that would otherwise strip the atmosphere and irradiate the surface are deflected into helices and guided to the poles. Mars lost its global field about four billion years ago and lost most of its atmosphere afterwards.
What the next chapter fixes
Currents make magnetic fields. It took eleven years after Ørsted for anyone to establish the reverse, and the reverse turns out not to be symmetric: a steady magnetic field produces no current at all. What produces a current is a changing magnetic field. Chapter 4.6 derives that law, shows why its minus sign is not a convention but a requirement of energy conservation, and builds from it the generator, the transformer and the induction hob — that is, essentially the whole of the electrical power industry.