Gauss's law finds the electric field from the charge enclosed. Ampere's circuital law does the same job for magnetism: it finds the magnetic field from the current enclosed. It works best when the current has a lot of symmetry, and the choice of the loop is the only skill needed.

An Amperian loop around a wire: B falls as 1/r as the loop grows

Statement

∮ B · dl = μ₀ I_enclosed   |   μ₀ = 4π × 10⁻⁷ T m/A

The integral is taken around an imaginary closed loop, called an Amperian loop. Only the current that passes through the loop counts, and its sign comes from the right-hand rule. As with Gauss's law, the law is always true, but it helps find B only when B is constant along the loop.

1. Long straight wire

Take a circle of radius r around the wire. By symmetry, B is tangent to it and has the same size everywhere, so B × 2πr = μ₀I:

B = μ₀ I / 2πr

Inside a thick wire of radius R carrying a uniform current, only part of the current is enclosed by a smaller loop. This gives B = μ₀ I r / 2πR², which grows linearly from the axis. For I = 10 A, R = 2 mm, at r = 1 mm: B = 5 × 10⁻⁴ T. At the surface, it takes its maximum value, then it falls as 1/r outside.

2. Long solenoid

Take a rectangular loop with one side inside the solenoid and the other outside, where the field is almost zero. Only the inside side contributes, and the enclosed current is nI × l:

B = μ₀ n I (inside), B ≈ 0 (outside)

For n = 5000 turns/m and I = 2 A, B = 4π × 10⁻⁷ × 5000 × 2 ≈ 12.6 mT, uniform across the cross-section.

3. Toroid

A toroid is a solenoid bent into a ring. Taking a circular loop of radius r inside the ring, which encloses all N turns:

B = μ₀ N I / 2πr
Numbers: N = 1000 turns, I = 2 A, mean radius r = 0.2 m. B = 4π × 10⁻⁷ × 1000 × 2 / (2π × 0.2) = 2 × 10⁻³ T. The field is zero outside the ring and in the hollow centre, since the loop encloses either no current or the same current in both directions.

Ampere's law and the Biot-Savart law

The Biot-Savart law gives B from every small element of the current, and always works, but needs an integral. Ampere's law is the shortcut when the symmetry is high. If the shape is a loop or a finite wire, use Biot-Savart. Our earlier note compares the two methods.

Mistakes to avoid

Counting current outside the loop, forgetting that n is turns per metre and not the total turns, and using the solenoid formula near its ends, where the field is only half of the central value.

More solved problems

Problem 1: A long straight wire
A wire carries 25 A. At a distance of 10 cm, B = μ₀I/2πr = 2 × 10⁻⁷ × 25 / 0.1 = 5 × 10⁻⁵ T, which is 50 μT, similar to the Earth's field.
Problem 2: A solenoid
A solenoid of length 0.5 m has 400 turns and carries 1.5 A. n = 400/0.5 = 800 turns/m, so B = μ₀nI = 4π × 10⁻⁷ × 800 × 1.5 ≈ 1.51 × 10⁻³ T.
Problem 3: A toroid
A toroid has N = 500 turns, a mean radius of 0.1 m and carries 1 A. B = μ₀NI/2πr = 2 × 10⁻⁷ × 500 / 0.1 = 1 × 10⁻³ T.
Problem 4: Inside a thick wire
A solid wire of radius 1 cm carries 50 A uniformly. At r = 0.5 cm, only (r/R)² of the current is enclosed, so B = μ₀Ir/2πR² = 2 × 10⁻⁷ × 50 × 0.005 / 10⁻⁴ = 5 × 10⁻⁴ T.

Practice questions (with answers)

  1. Ampere's circuital law relates the line integral of B around a closed loop to
    (a) the total current in the circuit   (b) the current enclosed by the loop   (c) the charge enclosed   (d) the area of the loop
  2. The magnetic field inside an ideal long solenoid is
    (a) zero   (b) uniform   (c) proportional to r   (d) proportional to 1/r
  3. The magnetic field outside a toroid is
    (a) μ₀nI   (b) zero   (c) μ₀NI/2πr   (d) infinite
  4. Inside a thick wire carrying a uniform current, B is proportional to
    (a) r   (b) 1/r   (c) r²   (d) constant
  5. A loop that encloses no current has ∮ B · dl equal to
    (a) μ₀   (b) infinity   (c) zero   (d) B
Show answers
  1. (b) the current enclosed by the loop, times μ₀.
  2. (b) uniform.
  3. (b) zero.
  4. (a) r, up to the surface.
  5. (c) zero.

Common doubts

When do we use Ampere's law and when Biot-Savart?

Use Ampere's law when the current has high symmetry (long straight wire, solenoid, toroid, a flat sheet), so B is constant along the loop. Use Biot-Savart for a circular loop, a finite wire or an irregular shape.

Why is the field outside a long solenoid almost zero?

The fields from the turns on the nearby side and the far side point in opposite directions outside and cancel, while they add up inside. The longer the solenoid, the better the cancellation.

What did Maxwell add to Ampere's law?

He added the displacement current (a changing electric field acts like a current), so the law also works for a charging capacitor. This extra term led to the prediction of electromagnetic waves.

Try it yourself

Biot-Savart Law Magnetic Field of a Conductor Electromagnet