Sub topic 13
The Biot-Savart law: fields from current elements
This chapter assumes you can take cross products and use the right-hand rule, and that you know the magnetic force on a moving charge and on a wire. It also assumes basic vector components and trigonometry. Until now, the magnetic field B was something we put in a region and then asked what it did to charges and wires. Here we reverse the question and ask how moving charges and currents create B.
From a field that acts to a field that is produced
Experiments from the early 1800s showed that a current deflects a nearby compass needle. Jean-Baptiste Biot and Félix Savart measured how the deflection depends on the wire's shape and distance. Their results are summarized by a rule for the contribution of a small piece of current to the field.
Take a short segment of wire with vector length dl. The vector points along the direction of the conventional current I. Let r be the displacement from the segment to the point P where you want the field. This segment contributes
dB = (μ₀ / 4π) · I dl × r̂ / r²
Here r is the magnitude of the displacement and r̂ = r / r is its unit vector. The constant μ₀ is the permeability of free space. It is approximately 4π × 10⁻⁷ T·m/A, so μ₀ / 4π ≈ 10⁻⁷ T·m/A.
The total field is the vector sum of the contributions from every segment. For a continuous wire this sum is an integral:
B = (μ₀ I / 4π) ∫ dl × r̂ / r²
Compare this with Coulomb's law. Both laws fall off as 1/r². The electric field of a point charge points along r̂. The magnetic contribution points along dl × r̂, which is perpendicular to both the current direction and the line to the point. That perpendicularity is why magnetic field lines of a current curl around it instead of pointing outward.
Reading the formula
The magnitude of a single contribution is
dB = (μ₀ / 4π) · I dl sinθ / r²
where θ is the angle between dl and r̂. Three consequences follow.
- On the line of the wire itself (θ = 0 or 180°), sinθ = 0, so a segment contributes nothing straight ahead of or behind it.
- The contribution is largest when the point lies perpendicular to the segment (θ = 90°).
- The direction comes from the right-hand rule: point the fingers of your right hand along dl, curl them toward r̂, and your thumb gives dB.
For a single point charge q moving with velocity v (with v much smaller than the speed of light), the same law gives
B = (μ₀ / 4π) · q v × r̂ / r²
This follows because I dl corresponds to q v for a moving charge.
Setting up a Biot-Savart calculation
Most problems follow the same steps.
- Choose a coordinate system that matches the geometry of the wire.
- Write dl and r for a generic segment, and find r̂.
- Compute dl × r̂ and determine which components survive after integrating.
- Integrate over the whole wire.
Symmetry often cancels some components. This shortens the work.
Example: the field on the axis of a circular loop
Consider a circular loop of radius R carrying current I. The loop lies in the xy-plane, centered at the origin. We want B at a point on the z-axis, a distance z above the center.
Every segment dl is tangent to the circle. The displacement from a segment to the point has length r = √(R² + z²). The angle between dl and r̂ is 90° for every segment, so |dl × r̂| = dl and
dB = (μ₀ I / 4π) · dl / (R² + z²)
The vector dB is perpendicular to both dl and r̂. It points partly along the axis and partly radially outward. The radial parts from opposite sides of the loop cancel. Only the axial component remains, which is dB multiplied by R / √(R² + z²), the cosine of the angle between dB and the axis.
Integrating around the circle, ∮ dl = 2πR, gives
B_z = μ₀ I R² / (2 (R² + z²)^(3/2))
At the center of the loop (z = 0) this becomes B = μ₀ I / (2R). Far from the loop (z ≫ R) it falls as 1/z³, the same dependence as the field of a dipole. That matches the magnetic moment μ = I πR² from the previous treatment of current loops: B ≈ μ₀ μ / (2π z³) on the axis.
Computing the field numerically
When a wire has no convenient symmetry, you can approximate the integral by splitting the wire into many short straight pieces. The code below does this for a circular loop and compares the result with the analytic formula.
import numpy as np
MU0 = 4e-7 * np.pi # permeability of free space, T*m/A
def biot_savart(points, current, field_point):
"""Field at field_point from a closed polyline of vertices `points`.
points: (N, 3) array of vertices; the last vertex connects back to the first.
current: current in amperes, flowing from vertex i to vertex i+1.
field_point: length-3 array.
"""
nxt = np.roll(points, -1, axis=0)
dl = nxt - points # segment vectors
mid = 0.5 * (points + nxt) # segment midpoints
r = field_point - mid # from segment to field point
r_mag = np.linalg.norm(r, axis=1)
# dB = mu0 I / (4 pi) * dl x r / |r|^3 (since r_hat / r^2 = r / r^3)
dB = np.cross(dl, r) / r_mag[:, None] ** 3
return MU0 * current / (4 * np.pi) * dB.sum(axis=0)
R = 0.10 # loop radius, m
I = 5.0 # current, A
z = 0.05 # height of the field point above the center, m
n = 2000
phi = np.linspace(0, 2 * np.pi, n, endpoint=False)
loop = np.column_stack([R * np.cos(phi), R * np.sin(phi), np.zeros(n)])
B_num = biot_savart(loop, I, np.array([0.0, 0.0, z]))
B_exact = MU0 * I * R**2 / (2 * (R**2 + z**2) ** 1.5)
print(B_num)
print(B_exact)The numerical Bz matches the formula to many digits, and the x and y components are essentially zero, as the symmetry argument predicts. Because the code uses r / |r|³ instead of r̂ / r², you avoid a separate normalization step.
Common errors
- Using the wrong r. The vector r points from the source (the current element) to the field point, not the other way round. Reversing it flips the sign of the field.
- Forgetting that dl follows the current. If you integrate against the current direction, the field direction reverses.
- Treating the magnitude formula as the whole answer. Components can cancel. Adding magnitudes of contributions that point in different directions overestimates B.
- Dropping the 1/r² dependence on the wrong r. In loop problems, r is the distance from the segment to the point, not the distance from the center of the loop.
- Applying the point-charge version at high speed. The expression B = (μ₀ / 4π) q v × r̂ / r² holds only for speeds much smaller than the speed of light, and only for charges that move at constant velocity.
When the Biot-Savart law is the right tool
| Situation | Best approach |
|---|---|
| Highly symmetric current (infinite wire, ideal solenoid) | Ampère's law, covered next |
| Finite wire, loop, or arc | Biot-Savart integral |
| Irregular shape | Biot-Savart, evaluated numerically |
| Field at a point on a symmetry axis | Biot-Savart with component cancellation |
The Biot-Savart law is more general because it works for any current distribution. Ampère's law is quicker only when symmetry lets you pull B out of an integral. The next chapter develops Ampère's law, and the chapter after it uses both to find the fields of a long straight wire, a loop, and a solenoid.
Exercise
A circular loop of radius 0.20 m carries 3.0 A. Find the magnetic field magnitude at the center of the loop, and state its direction if the current runs counterclockwise when viewed from above.
Show answer
At the center, B = μ₀ I / (2R) = (4π × 10⁻⁷ T·m/A)(3.0 A) / (2 × 0.20 m) ≈ 9.4 × 10⁻⁶ T. Curling the fingers of the right hand counterclockwise (viewed from above) puts the thumb pointing up, so the field points upward, toward the viewer.
Exercise
Explain why a short straight segment of wire produces zero field at a point located on the line extending the segment, even though the point is close to the segment.
Show answer
The contribution is dB = (μ₀ / 4π) I dl sinθ / r². On the line extending the segment, the angle θ between dl and r̂ is 0° or 180°, so sinθ = 0 and dl × r̂ = 0. Equivalently, dB must be perpendicular to dl, and no consistent perpendicular direction is selected along that line, so the cross product vanishes.