Sub topic 7
Field of a straight wire, finite and infinite
This chapter assumes you know the Biot-Savart law, the cross product with right-hand rules, and basic integration. You should also know that the constant mu-zero is 4π × 10⁻⁷ T m/A.
Setting up the integral
Take a straight wire carrying current I. Pick a point P at perpendicular distance d from the wire. Let the foot of the perpendicular be the origin of the wire coordinate, and let a current element sit at distance x along the wire.
The Biot-Savart law gives the field of one element:
dB = (mu0 / 4π) · I dx sin(φ) / r²
Here r is the distance from the element to P, and φ is the angle between the element and the line joining it to P. Every element of a straight wire gives a dB in the same direction at P, so you can add the magnitudes directly.
It is easiest to use the angle θ that the line from the element to P makes with the perpendicular. Then:
- x = d tan θ, so dx = d sec²θ dθ
- r = d sec θ
- sin φ = cos θ
Substituting gives dB = (mu0 I / 4π d) cos θ dθ.
The finite wire
Integrate from θ1 to θ2, with angles measured on opposite sides of the perpendicular and taken as positive on each side:
B = (mu0 I / 4π d) (sin θ1 + sin θ2)
If P lies on one side only, for example opposite one end of the wire, use the difference of the sines instead. Check the sign by asking whether the angle sweeps across the perpendicular or not.
The infinite wire
For an infinite wire, θ1 = θ2 = 90°, so both sines equal 1:
B = mu0 I / (2π d)
For a semi-infinite wire with P opposite its end, only one half contributes, so B = mu0 I / (4π d).
The direction comes from the right-hand grip rule. Point the thumb along the current. The fingers curl in the direction of B, which forms circles around the wire.
Numerical check
The code below evaluates both formulas. A 10 A wire at 5 cm gives about 4 × 10⁻⁵ T. A finite wire of half-length 5 cm, with P at the midpoint 5 cm away, has sin θ = 0.707 on each side, so its field is about 71% of the infinite value.
import math
mu0 = 4 * math.pi * 1e-7 # T m / A
def b_infinite_wire(current, distance):
return mu0 * current / (2 * math.pi * distance)
def b_finite_wire(current, distance, theta1, theta2):
return mu0 * current / (4 * math.pi * distance) * (math.sin(theta1) + math.sin(theta2))
I, d = 10, 0.05
theta = math.atan(0.05 / 0.05) # half-length 5 cm, distance 5 cm
print(b_infinite_wire(I, d)) # about 4e-05 tesla
print(b_finite_wire(I, d, theta, theta)) # about 2.83e-05 teslaCommon errors
| Error | Fix |
|---|---|
| Using B = mu0 I / (2π d) for a finite wire | Use the sine form with the actual angles |
| Measuring angles from the wire instead of from the perpendicular | Define θ from the perpendicular to the line to P |
| Adding the two sines when P is beyond one end | Subtract, since the angles lie on the same side |
| Forgetting that B falls as 1/d | Doubling the distance halves the field |
Worked example
A wire of length 2L carries current I. Find B at a point on its perpendicular bisector at distance d.
Here sin θ = L / √(L² + d²) on each side, so:
B = (mu0 I / 4π d) · 2L / √(L² + d²) = mu0 I L / (2π d √(L² + d²))
When L is much larger than d, the root becomes L and you recover mu0 I / (2π d).
Exercise
A straight wire 20 cm long carries 5 A. Find the field at a point 10 cm from the wire on its perpendicular bisector. Take mu0 = 4π × 10⁻⁷ T m/A.
Show answer
Half-length L = 0.1 m and d = 0.1 m, so sin θ = 0.1 / √(0.1² + 0.1²) = 0.707 on each side. B = (mu0 I / 4π d)(2 × 0.707) = (10⁻⁷ × 5 / 0.1) × 1.414 ≈ 7.07 × 10⁻⁶ T.
Exercise
Why does the field of an infinite straight wire fall as 1/d and not as 1/d²?
Show answer
Each current element gives a field proportional to 1/r². Adding the contributions of all elements along an infinitely long wire, the sum over the length adds one more power of d to the numerator, which leaves a net 1/d dependence.