Sub topic 16
Gauss's Law for Magnetism and the Absence of Monopoles
This chapter assumes you know the cross product, surface integrals at the level of "flux through a surface," Gauss's law for electric fields, and the field of a magnetic dipole from the previous chapter. It closes the tutorial by stating what is special about magnetic field lines and showing how to use that fact.
Statement of the law
The magnetic flux through a surface is the surface integral of the field over that surface:
Φ_B = ∫ B · dA
Gauss's law for magnetism says that the net magnetic flux through any closed surface is zero:
∮ B · dA = 0
Compare this with the electric case, ∮ E · dA = q_enclosed / ε0. The electric flux depends on the charge inside. The magnetic flux does not depend on anything inside, because there is no "magnetic charge" to enclose.
Isolated magnetic poles, called magnetic monopoles, have never been observed. Every magnet and every current distribution has a north and a south side together. Cut a bar magnet in half and you get two smaller magnets, each with both poles.
Why field lines always close
Flux through a closed surface counts field lines leaving minus field lines entering. A zero total means every line that enters the surface also leaves it.
- Electric field lines start on positive charges and end on negative charges. They can have ends.
- Magnetic field lines have no start and no end. They form closed loops.
For a bar magnet, the lines leave the north end and curve around outside to the south end. Inside the magnet they continue from south to north, so each line closes on itself. The same is true for the field of a straight wire (circles around the wire) and of a solenoid (lines pass through the coil and return outside).
Consequences
Net flux through any closed surface is zero
If you put a closed surface around a magnet, a loop or a wire segment, the flux entering equals the flux leaving. For a small sphere around the end of a bar magnet, the lines that appear to "emerge" from the north pole are balanced by lines entering elsewhere on the surface. If the surface only cuts the magnet's pole region, the lines continue inside the magnet and cross the surface again.
Poles are not point sources
Pole strength is a useful bookkeeping idea for old problems, but a pole is not a point where lines originate. Never apply the inverse-square law for magnetic charge as a fundamental law.
The field of a dipole has no divergence
The dipole field has an axial value 2μ0m / (4πr³) and an equatorial value μ0m / (4πr³) in the far region. Close to the dipole, the lines are closed loops through the dipole itself. The flux through any closed surface surrounding it is still zero.
Flux through an open surface can be nonzero
The law applies only to closed surfaces. A flat loop of wire has a nonzero flux through the disc it spans. This is the flux used in electromagnetic induction. Because the closed-surface flux is zero, the flux through an open surface depends only on its boundary curve. Any two surfaces sharing the same boundary have the same flux, provided you orient them consistently.
Worked example: a closed surface and a uniform field
A uniform field B = 0.4 T along +z passes through a closed cylinder of radius 0.05 m and length 0.2 m, with its axis along z.
- The flux through the bottom face (outward normal −z) is −B·πr².
- The flux through the top face (outward normal +z) is +B·πr².
- The curved side has B parallel to the surface, so B · dA = 0 there.
The total is zero. Numerically, each end face has area π(0.05)² ≈ 7.85×10⁻³ m², so the flux is ±3.14×10⁻³ Wb and the sum is 0.
import math
B = 0.4 # tesla, along +z
r = 0.05 # metre
area = math.pi * r**2
flux_top = B * area # outward normal +z
flux_bottom = -B * area # outward normal -z
flux_side = 0.0 # B lies in the surface
total = flux_top + flux_bottom + flux_side
print(flux_top, flux_bottom, total)The printed total is exactly 0.0. The unit of magnetic flux is the weber (Wb), where 1 Wb = 1 T m².
Checking the law numerically for a dipole
The following script builds a small current loop as a point dipole at the origin and sums the flux of its field through a sphere of radius 1 m. The dipole field is B = μ0/(4π) · (3(m·r̂)r̂ − m) / r³ for points outside the source. The sum comes out very close to zero.
import numpy as np
MU0 = 4e-7 * np.pi
m = np.array([0.0, 0.0, 2.0]) # dipole moment in A m^2, along z
R = 1.0 # sphere radius in m
n_theta, n_phi = 400, 400
theta = (np.arange(n_theta) + 0.5) * np.pi / n_theta
phi = (np.arange(n_phi) + 0.5) * 2 * np.pi / n_phi
T, P = np.meshgrid(theta, phi, indexing="ij")
rhat = np.stack([np.sin(T) * np.cos(P),
np.sin(T) * np.sin(P),
np.cos(T)], axis=-1)
m_dot_r = rhat @ m
B = MU0 / (4 * np.pi) * (3 * m_dot_r[..., None] * rhat - m) / R**3
dA = R**2 * np.sin(T) * (np.pi / n_theta) * (2 * np.pi / n_phi)
flux = np.sum(np.sum(B * rhat, axis=-1) * dA)
scale = np.sum(np.abs(np.sum(B * rhat, axis=-1)) * dA)
print(flux, flux / scale)The ratio of net flux to total absolute flux is close to zero, showing that the flux leaving through the upper half of the sphere equals the flux entering through the lower half.
Comparison with electric fields
| Property | Electric field | Magnetic field |
|---|---|---|
| Gauss's law | ∮ E · dA = q / ε0 | ∮ B · dA = 0 |
| Isolated sources | Single charges exist | No monopoles observed |
| Field lines | Begin on + and end on − charges | Closed loops |
| Simplest source | Point charge | Dipole (current loop) |
| Unit of flux | V m | Wb (T m²) |
Common errors
- Using ∮ B · dA = μ0 I. That is not Gauss's law. The quantity μ0 I belongs to Ampère's law, which uses a line integral ∮ B · dl around a loop, not a surface integral.
- Treating "lines emerging from the north pole" as a net outflow. Lines are continuous through the magnet.
- Applying the zero-flux result to an open surface such as a coil's face.
- Forgetting the sign convention: for a closed surface the normal points outward, so entering flux is negative.
Exercises
Exercise
A closed surface encloses the north pole of a long bar magnet only, with the south pole far outside the surface. What is the net magnetic flux through the surface, and how do the field lines behave?
Show answer
The net flux is zero. Lines appear to enter the region around the north pole from inside the magnet and leave through the surface, but the bar magnet itself passes through the surface, so lines running inside the magnet cross the surface inward. These inward lines exactly balance the outward lines in the air, so ∮ B · dA = 0.
Exercise
A flat circular coil of radius 0.10 m lies in a uniform field of 0.5 T with its axis at 60° to the field. A hemispherical cap of any shape is stretched over the same circular rim. What is the flux through the cap, and why is it the same as the flux through the flat disc?
Show answer
The flux through the disc is B·πr²·cos 60° = 0.5 × π(0.01) × 0.5 ≈ 7.85×10⁻³ Wb. The disc and the cap together form a closed surface, and the net flux through it is zero, so the flux through the cap (with the same orientation as the disc) is the same, 7.85×10⁻³ Wb.
Exercise
Why can a cut bar magnet never give you an isolated north pole?
Show answer
Magnetism comes from circulating currents and spins, which form dipoles. The field lines are closed loops, so every line leaving a north end must return at a south end. Cutting the magnet creates two new dipoles, each with its own north and south pole.