โ† Part II: Magnetostatics
Chapter 5

Biot-Savart Law & Ampere's Law

Magnetic forces, the Biot-Savart law, Ampere's law, and the divergence and curl of B.

5.1 Magnetic Force & Lorentz Force

A charge $q$ moving with velocity $\mathbf{v}$ in a magnetic field $\mathbf{B}$experiences the magnetic Lorentz force:

$$\mathbf{F} = q(\mathbf{E} + \mathbf{v} \times \mathbf{B})$$

The magnetic force $q\mathbf{v} \times \mathbf{B}$ is always perpendicular to $\mathbf{v}$, so it does no work. The force per unit length between two parallel wires carrying currents$I_1$ and $I_2$ separated by distance $d$ is:

$$\frac{F}{\ell} = \frac{\mu_0}{2\pi}\frac{I_1 I_2}{d}$$

5.2 The Biot-Savart Law

The magnetic field produced by a steady current $I$ in a wire element $d\boldsymbol{\ell}'$ at position $\mathbf{r}'$ is given by the Biot-Savart law:

$$\boxed{d\mathbf{B} = \frac{\mu_0}{4\pi} \frac{I\,d\boldsymbol{\ell}' \times \hat{\mathscr{r}}}{\mathscr{r}^2}}$$

$\boldsymbol{\mathscr{r}} = \mathbf{r} - \mathbf{r}'$, $\mu_0 = 4\pi \times 10^{-7}\,\text{T}\cdot\text{m/A}$

For a general current distribution:

$$\mathbf{B}(\mathbf{r}) = \frac{\mu_0}{4\pi}\int \frac{\mathbf{J}(\mathbf{r}') \times \hat{\mathscr{r}}}{\mathscr{r}^2}\,d\tau'$$

Derivation: The Biot-Savart Law

Starting from the experimental observation that magnetic fields are produced by moving charges, we construct the law by analogy with Coulomb's law, incorporating the velocity-dependent nature of the magnetic interaction.

Step 1: Magnetic field of a moving point charge

Experiment shows that a charge $q$ moving with velocity $\mathbf{v}$ produces a magnetic field:

$$\mathbf{B} = \frac{\mu_0}{4\pi}\frac{q\,\mathbf{v} \times \hat{\mathscr{r}}}{\mathscr{r}^2}$$

Step 2: Express current element as moving charges

A current $I$ in a wire element $d\boldsymbol{\ell}'$ corresponds to charge $dq$ moving with drift velocity $\mathbf{v}_d$. The number of charges in length $d\ell'$ is $n A\,d\ell'$ where $n$ is the number density and $A$ is the cross-sectional area:

$$dq\,\mathbf{v}_d = (nAq\,d\ell')\,\mathbf{v}_d = (nqv_d A)\,d\boldsymbol{\ell}' = I\,d\boldsymbol{\ell}'$$

Step 3: Substitute into the point-charge formula

Replace $q\mathbf{v}$ with $I\,d\boldsymbol{\ell}'$ to get the contribution from one wire element:

$$d\mathbf{B} = \frac{\mu_0}{4\pi}\frac{I\,d\boldsymbol{\ell}' \times \hat{\mathscr{r}}}{\mathscr{r}^2}$$

Step 4: Write the separation vector explicitly

The separation vector is $\boldsymbol{\mathscr{r}} = \mathbf{r} - \mathbf{r}'$, with magnitude $\mathscr{r} = |\mathbf{r} - \mathbf{r}'|$ and unit vector $\hat{\mathscr{r}} = \boldsymbol{\mathscr{r}}/\mathscr{r}$:

$$d\mathbf{B} = \frac{\mu_0 I}{4\pi}\frac{d\boldsymbol{\ell}' \times (\mathbf{r} - \mathbf{r}')}{|\mathbf{r} - \mathbf{r}'|^3}$$

Step 5: Integrate over the entire current distribution

For a complete circuit (line current), integrate over the wire path:

$$\mathbf{B}(\mathbf{r}) = \frac{\mu_0 I}{4\pi}\oint \frac{d\boldsymbol{\ell}' \times \hat{\mathscr{r}}}{\mathscr{r}^2}$$

Step 6: Generalize to volume current density J

For a volume current $\mathbf{J}$, replace $I\,d\boldsymbol{\ell}' \to \mathbf{J}\,d\tau'$ and for a surface current $\mathbf{K}$, replace $I\,d\boldsymbol{\ell}' \to \mathbf{K}\,da'$:

$$\mathbf{B}(\mathbf{r}) = \frac{\mu_0}{4\pi}\int \frac{\mathbf{J}(\mathbf{r}') \times \hat{\mathscr{r}}}{\mathscr{r}^2}\,d\tau'$$

Derivation: Magnetic Field of an Infinite Straight Wire

Starting from the Biot-Savart law, we compute the magnetic field at a perpendicular distance $s$ from an infinitely long straight wire carrying current $I$ along the $z$-axis.

Step 1: Set up the geometry

Place the wire along the $z$-axis. The field point is at $\mathbf{r} = s\,\hat{s}$ (distance $s$ from the wire). A wire element at position $\mathbf{r}' = z'\hat{z}$ has $d\boldsymbol{\ell}' = dz'\,\hat{z}$:

$$\boldsymbol{\mathscr{r}} = s\,\hat{s} - z'\hat{z}, \qquad \mathscr{r} = \sqrt{s^2 + z'^2}$$

Step 2: Compute the cross product

The cross product $d\boldsymbol{\ell}' \times \hat{\mathscr{r}}$ gives:

$$dz'\,\hat{z} \times \frac{(s\,\hat{s} - z'\hat{z})}{(s^2 + z'^2)^{1/2}} = \frac{s\,dz'}{(s^2 + z'^2)^{1/2}}\,\hat{\phi}$$

where we used $\hat{z} \times \hat{s} = \hat{\phi}$ and $\hat{z} \times \hat{z} = 0$.

Step 3: Write the Biot-Savart integral

Substituting into the Biot-Savart law:

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

Step 4: Trigonometric substitution

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

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

Step 5: Evaluate the integral

$$\frac{1}{s}\int_{-\pi/2}^{\pi/2}\cos\alpha\,d\alpha = \frac{1}{s}[\sin\alpha]_{-\pi/2}^{\pi/2} = \frac{1}{s}(1 - (-1)) = \frac{2}{s}$$

Step 6: Final result

Combining all factors:

$$\boxed{\mathbf{B} = \frac{\mu_0 I}{2\pi s}\,\hat{\phi}}$$

The field circles the wire in the $\hat{\phi}$ direction (right-hand rule) and falls off as $1/s$.

5.2.1 Magnetic Field on Axis of a Circular Loop

For a circular loop of radius $R$ carrying current $I$, at a point on the axis distance $z$ from the center:

By symmetry, only the axial component $B_z$ survives. Each element $Rd\phi$contributes $dB_z = (\mu_0 I R\,d\phi)/(4\pi\mathscr{r}^2) \cdot R/\mathscr{r}$ where$\mathscr{r} = \sqrt{R^2 + z^2}$. Integrating over $2\pi$:

$$\boxed{B_z = \frac{\mu_0 I R^2}{2(R^2 + z^2)^{3/2}}}$$

At center ($z=0$): $B = \mu_0 I / (2R)$

Derivation: Magnetic Field on the Axis of a Circular Loop

Starting from the Biot-Savart law, we integrate over a circular loop of radius $R$ in the $xy$-plane to find $\mathbf{B}$ at a point $P = (0,0,z)$ on the axis.

Step 1: Parameterize the loop

The loop position is $\mathbf{r}' = R\cos\phi'\,\hat{x} + R\sin\phi'\,\hat{y}$, so the line element is:

$$d\boldsymbol{\ell}' = R\,d\phi'(-\sin\phi'\,\hat{x} + \cos\phi'\,\hat{y})$$

Step 2: Compute the separation vector

From the source point on the loop to the field point on the axis:

$$\boldsymbol{\mathscr{r}} = -R\cos\phi'\,\hat{x} - R\sin\phi'\,\hat{y} + z\,\hat{z}, \qquad \mathscr{r} = \sqrt{R^2 + z^2}$$

Step 3: Evaluate the cross product

$$d\boldsymbol{\ell}' \times \boldsymbol{\mathscr{r}} = R\,d\phi'\begin{vmatrix} \hat{x} & \hat{y} & \hat{z} \\ -\sin\phi' & \cos\phi' & 0 \\ -R\cos\phi' & -R\sin\phi' & z \end{vmatrix}$$

$$= R\,d\phi'\bigl(z\cos\phi'\,\hat{x} + z\sin\phi'\,\hat{y} + R\,\hat{z}\bigr)$$

Step 4: Symmetry cancellation

The $\hat{x}$ component contains $\cos\phi'$ and the $\hat{y}$ component contains $\sin\phi'$. Integrating over $\phi' \in [0, 2\pi]$, both average to zero:

$$\int_0^{2\pi}\cos\phi'\,d\phi' = 0, \qquad \int_0^{2\pi}\sin\phi'\,d\phi' = 0$$

Only the $\hat{z}$ component survives.

Step 5: Integrate the z-component

The surviving term gives:

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

Step 6: Final result and simplification

$$\boxed{B_z = \frac{\mu_0 I R^2}{2(R^2 + z^2)^{3/2}}}$$

Step 7: Dipole limit at large distance ($z \gg R$)

When $z \gg R$, factor out $z^2$ from the denominator:

$$B_z = \frac{\mu_0 I R^2}{2z^3}\left(1 + \frac{R^2}{z^2}\right)^{-3/2} \approx \frac{\mu_0 I R^2}{2z^3}\left(1 - \frac{3R^2}{2z^2} + \cdots\right) \approx \frac{\mu_0 I R^2}{2z^3}$$

Step 8: Identify the magnetic dipole moment

Since $m = I\pi R^2$ (current times area), this becomes:

$$B_z \approx \frac{\mu_0}{4\pi}\frac{2m}{z^3}$$

This matches the on-axis field of a magnetic dipole, confirming that at large distances, any current loop looks like a dipole.

5.3 Ampere's Law

Analogous to Gauss's law, Ampere's law exploits symmetry to find $\mathbf{B}$ without integrating the Biot-Savart law:

$$\boxed{\oint_C \mathbf{B} \cdot d\boldsymbol{\ell} = \mu_0 I_{\rm enc}} \qquad \Longleftrightarrow \qquad \nabla \times \mathbf{B} = \mu_0 \mathbf{J}$$

Infinite solenoid (n turns/m)

$$B = \mu_0 n I \quad \text{(inside)}, \quad B = 0 \quad \text{(outside)}$$

Infinite wire (radius $s$)

$$\mathbf{B} = \frac{\mu_0 I}{2\pi s}\,\hat{\phi} \quad (s > R)$$

Derivation: Ampere's Law from Biot-Savart

Starting from the Biot-Savart law in differential form, we derive $\oint \mathbf{B}\cdot d\boldsymbol{\ell} = \mu_0 I_{\text{enc}}$ by computing $\nabla \times \mathbf{B}$.

Step 1: Write B in terms of J using Biot-Savart

$$\mathbf{B}(\mathbf{r}) = \frac{\mu_0}{4\pi}\int \frac{\mathbf{J}(\mathbf{r}') \times \hat{\mathscr{r}}}{\mathscr{r}^2}\,d\tau' = \frac{\mu_0}{4\pi}\int \mathbf{J}(\mathbf{r}') \times \nabla\!\left(\frac{-1}{\mathscr{r}}\right)d\tau'$$

where we used the identity $\hat{\mathscr{r}}/\mathscr{r}^2 = -\nabla(1/\mathscr{r})$.

Step 2: Take the curl of B

Using the vector identity $\nabla \times (\mathbf{J} \times \nabla f) = \mathbf{J}(\nabla^2 f) - (\mathbf{J}\cdot\nabla)\nabla f$ (where $\mathbf{J}$ depends on $\mathbf{r}'$, not $\mathbf{r}$):

$$\nabla \times \mathbf{B} = \frac{\mu_0}{4\pi}\int\left[\mathbf{J}(\mathbf{r}')\,\nabla^2\!\left(\frac{1}{\mathscr{r}}\right) - (\mathbf{J}(\mathbf{r}')\cdot\nabla)\nabla\!\left(\frac{1}{\mathscr{r}}\right)\right]d\tau'$$

Step 3: Apply the Laplacian identity

The key identity is $\nabla^2(1/\mathscr{r}) = -4\pi\delta^3(\boldsymbol{\mathscr{r}})$. The first term becomes:

$$\frac{\mu_0}{4\pi}\int \mathbf{J}(\mathbf{r}')\bigl[-4\pi\delta^3(\mathbf{r}-\mathbf{r}')\bigr]\,d\tau' = -\mu_0\,\mathbf{J}(\mathbf{r})\cdot(-1) = \mu_0\,\mathbf{J}(\mathbf{r})$$

Step 4: Show the second integral vanishes for steady currents

The second term can be rewritten using integration by parts. For magnetostatics, $\nabla' \cdot \mathbf{J} = 0$ (continuity equation with $\partial\rho/\partial t = 0$). This ensures the second integral vanishes:

$$\int (\mathbf{J}\cdot\nabla)\nabla\!\left(\frac{1}{\mathscr{r}}\right)d\tau' = 0 \quad \text{(for steady currents)}$$

Step 5: Obtain the differential form of Ampere's law

$$\boxed{\nabla \times \mathbf{B} = \mu_0 \mathbf{J}}$$

Step 6: Convert to integral form using Stokes' theorem

Integrate both sides over a surface $S$ bounded by closed loop $C$ and apply Stokes' theorem to the left side:

$$\int_S (\nabla \times \mathbf{B})\cdot d\mathbf{a} = \oint_C \mathbf{B}\cdot d\boldsymbol{\ell} = \mu_0 \int_S \mathbf{J}\cdot d\mathbf{a} = \mu_0 I_{\text{enc}}$$

Step 7: Final integral form

$$\boxed{\oint_C \mathbf{B}\cdot d\boldsymbol{\ell} = \mu_0 I_{\text{enc}}}$$

where $I_{\text{enc}}$ is the total current passing through the surface bounded by the Amperian loop $C$.

Derivation: The Field of a Solenoid Using Ampere's Law

Starting from Ampere's law, we exploit the symmetry of an infinite solenoid with $n$ turns per unit length carrying current $I$.

Step 1: Symmetry arguments

By the translational symmetry along the axis and rotational symmetry about it, $\mathbf{B}$ can only depend on the distance $s$ from the axis and can only point in the $\hat{z}$ direction (along the axis). Using the right-hand rule: $\mathbf{B} = B(s)\,\hat{z}$.

Step 2: Show B = 0 outside the solenoid

Choose a rectangular Amperian loop entirely outside the solenoid, with two sides parallel to the axis (at distances $s_1 > s_2 > R$). The perpendicular sides contribute nothing (B is along $\hat{z}$). No current is enclosed, so:

$$B(s_1)L - B(s_2)L = \mu_0 \cdot 0 \implies B(s_1) = B(s_2)$$

Since $B \to 0$ as $s \to \infty$, we conclude $B = 0$ everywhere outside.

Step 3: Apply Ampere's law to a loop straddling the solenoid wall

Choose a rectangular Amperian loop with one side (length $L$) inside the solenoid and one side outside. The two short sides are perpendicular to $\hat{z}$ and contribute nothing:

$$\oint \mathbf{B}\cdot d\boldsymbol{\ell} = B_{\text{inside}}\cdot L + 0 \cdot L + 0 + 0 = B_{\text{inside}} \cdot L$$

Step 4: Count the enclosed current

The loop of length $L$ encloses $nL$ turns, each carrying current $I$:

$$I_{\text{enc}} = nLI$$

Step 5: Equate and solve

$$B_{\text{inside}} \cdot L = \mu_0 n L I$$

$$\boxed{B = \mu_0 n I \quad \text{(inside)}, \qquad B = 0 \quad \text{(outside)}}$$

The field inside is uniform and independent of position -- a remarkable result. This makes solenoids essential for creating uniform magnetic fields in laboratories.

5.3.1 Divergence and Curl of B

$$\nabla \cdot \mathbf{B} = 0 \qquad \text{(no magnetic monopoles)}$$$$\nabla \times \mathbf{B} = \mu_0 \mathbf{J} \qquad \text{(Ampere's law, static case)}$$

$\nabla \cdot \mathbf{B} = 0$ is the second of Maxwell's four equations. It states there are no magnetic charges (monopoles).

Derivation: The Divergence of B (No Magnetic Monopoles)

Starting from the Biot-Savart law, we prove that $\nabla \cdot \mathbf{B} = 0$ identically, establishing the absence of magnetic monopoles.

Step 1: Write B in a convenient form

Express the Biot-Savart law using the identity $\hat{\mathscr{r}}/\mathscr{r}^2 = -\nabla(1/\mathscr{r})$:

$$\mathbf{B}(\mathbf{r}) = \frac{\mu_0}{4\pi}\int \mathbf{J}(\mathbf{r}') \times \left[-\nabla\!\left(\frac{1}{\mathscr{r}}\right)\right]d\tau' = -\frac{\mu_0}{4\pi}\int \mathbf{J}(\mathbf{r}') \times \nabla\!\left(\frac{1}{\mathscr{r}}\right)d\tau'$$

Step 2: Rewrite as the curl of an integral

Using the vector identity $\mathbf{J} \times \nabla f = -\nabla \times (f\mathbf{J})$ (when $\mathbf{J}$ does not depend on $\mathbf{r}$):

$$\mathbf{B} = \frac{\mu_0}{4\pi}\nabla \times \int \frac{\mathbf{J}(\mathbf{r}')}{\mathscr{r}}\,d\tau'$$

That is, $\mathbf{B} = \nabla \times \mathbf{A}$ where $\mathbf{A} = \frac{\mu_0}{4\pi}\int \frac{\mathbf{J}(\mathbf{r}')}{\mathscr{r}}\,d\tau'$.

Step 3: Take the divergence

Now compute $\nabla \cdot \mathbf{B}$:

$$\nabla \cdot \mathbf{B} = \nabla \cdot (\nabla \times \mathbf{A})$$

Step 4: Apply the vector calculus identity

The divergence of any curl is identically zero -- this is a fundamental theorem of vector calculus. For any well-behaved vector field $\mathbf{F}$:

$$\nabla \cdot (\nabla \times \mathbf{F}) = 0 \quad \text{(always, identically)}$$

Step 5: Conclude

$$\boxed{\nabla \cdot \mathbf{B} = 0}$$

This holds for any current distribution whatsoever. In integral form (by the divergence theorem): $\oint \mathbf{B}\cdot d\mathbf{a} = 0$. The net magnetic flux through any closed surface is always zero -- there are no magnetic monopoles. Unlike electric field lines that begin and end on charges, magnetic field lines always form closed loops.

Simulation: Biot-Savart for a Circular Loop

Computes $\mathbf{B}$ by direct numerical summation of the Biot-Savart law, compares with the analytic on-axis formula, and maps the 2D field in the $xz$-plane.

Biot-Savart: Circular Current Loop

Numerical Biot-Savart integration for a circular loop, compared against the analytic on-axis result.

Click Run to execute the Python code

First run will download Python environment (~15MB)

5.4 Worked Example: Force Between Parallel Wires

Consider two infinite parallel wires separated by distance $d$, carrying currents $I_1$ and $I_2$. Wire 1 creates a magnetic field at the location of wire 2:

$$B_1 = \frac{\mu_0 I_1}{2\pi d}$$

The force per unit length on wire 2 is $f = I_2 B_1$:

$$\boxed{\frac{F}{\ell} = \frac{\mu_0 I_1 I_2}{2\pi d}}$$

Parallel currents in the same direction attract; opposite directions repel. This force was historically used to define the ampere: two infinite wires 1 m apart carrying 1 A each experience a force of$2 \times 10^{-7}$ N/m.

Historical Note

Until 2019, this force defined the SI ampere. The modern definition (since the 2019 SI revision) fixes the elementary charge $e = 1.602\,176\,634 \times 10^{-19}$ C exactly, making the ampere a derived unit from the coulomb and the second.

Video Lectures & Demonstrations

MIT 8.02 โ€” Walter Lewin derives the Biot-Savart law and demonstrates magnetic field measurements around current-carrying wires.

Clear walkthrough of Ampere's law with symmetric examples โ€” solenoids, toroids, and thick wires.

Fortran Implementation

High-performance Fortran Biot-Savart computation for a Helmholtz coil pair. Helmholtz coils are ubiquitous in experimental physics for producing uniform magnetic fields, from NMR spectroscopy to cosmic ray detector calibration.

Helmholtz Coil Biot-Savart

Fortran

Computes the on-axis magnetic field of a Helmholtz coil pair using the Biot-Savart law

helmholtz_coil.f9060 lines

Click Run to execute the Fortran code

Code will be compiled with gfortran and executed on the server

Griffiths Problem Solutions

Video walkthroughs of Griffiths Chapter 5 problems on magnetostatics and the Biot-Savart law.

Problem 5.1

Problem 5.2

Problem 5.3

Rate this chapter: