Sub topic 7
Field of a straight wire, finite and infinite
This chapter assumes you know the Biot-Savart law for a current element, the cross product with the right-hand rules, and basic integration of trigonometric functions. You will integrate the law along a straight wire to get a formula that covers finite, semi-infinite and infinite wires.
Setting up the integral
The Biot-Savart law gives the field from a small piece of wire of length dl carrying current I:
dB = (mu0 / 4 pi) · I dl sin(theta) / r²
Here r is the distance from the element to the point P, and theta is the angle between the current direction and the line from the element to P. The direction of dB is along dl × r. For a straight wire, every element gives a dB in the same direction at P, so you can add magnitudes instead of vectors. This is why the straight wire is the simplest case.
Place the wire along the x-axis. Let P sit a perpendicular distance d from the wire. Measure the position x of an element from the foot of the perpendicular.
Describe each element by the angle phi between the line from the element to P and the perpendicular. Three relations follow from the geometry:
- x = d tan(phi), so dx = d sec²(phi) dphi.
- r = d sec(phi).
- sin(theta) = cos(phi), because theta and phi are complementary.
Substitute these into the law:
dB = (mu0 I / 4 pi) · [d sec²(phi) dphi · cos(phi)] / [d² sec²(phi)] = (mu0 I / 4 pi d) · cos(phi) dphi
The wire runs from -phi1 on one side of the perpendicular to +phi2 on the other. Integrate:
B = (mu0 I / 4 pi d) · [sin(phi)] from -phi1 to phi2 = (mu0 I / 4 pi d) (sin phi1 + sin phi2)
Special cases
| Situation | phi1 | phi2 | Field |
|---|---|---|---|
| Infinite wire | 90° | 90° | mu0 I / (2 pi d) |
| Semi-infinite wire, P opposite the end | 0° | 90° | mu0 I / (4 pi d) |
| Finite wire, P on the perpendicular bisector | equal angles phi | phi | mu0 I sin(phi) / (2 pi d) |
| P on the line of the wire | not defined | not defined | 0 |
For the symmetric case, sin(phi) = (L/2) / sqrt((L/2)² + d²) for a wire of length L. The infinite-wire result is the limit as L grows large compared with d.
In the semi-infinite case, P is on the perpendicular through one end of the wire. The wire covers only half of the infinite case, so you get half the field.
The infinite wire
For an infinite wire:
B = mu0 I / (2 pi d)
The field falls off as 1/d, not 1/d². Field lines are circles centred on the wire, in planes perpendicular to it.
The first code example evaluates this formula:
import math
mu0 = 4 * math.pi * 1e-7 # T m / A
def b_infinite_wire(current, distance):
return mu0 * current / (2 * math.pi * distance)
print(b_infinite_wire(10, 0.05)) # about 4e-05 teslaThe value 4 × 10⁻⁵ T is comparable to the Earth's field (about 5 × 10⁻⁵ T). A 10 A wire is therefore noticeable to a compass within a few centimetres.
Direction: the right-hand grip rule
Point the thumb of your right hand along the current. The curled fingers show the direction of B around the wire. Use this to turn the magnitude into a vector.
- Wire along +z, current up: at a point on the +x side, B points along +y. At a point on the +y side, B points along -x.
- Reverse the current and every direction flips.
- Above a wire carrying current to the right (viewed from the side), B points out of the page below the wire and into the page above... check this with the rule yourself, since it is the usual place to lose a mark. Above the wire, your fingers curl into the page. Below it, they curl out of the page.
Checking the finite formula numerically
You can test the general result by adding up the Biot-Savart contributions along the wire. Along the wire, sin(theta)/r² equals d/r³, which is what the code sums.
import math
mu0 = 4 * math.pi * 1e-7 # T m / A
def b_finite_wire(current, d, phi1, phi2):
"""Closed form: angles in radians, measured from the perpendicular."""
return mu0 * current / (4 * math.pi * d) * (math.sin(phi1) + math.sin(phi2))
def b_numeric(current, d, phi1, phi2, n=100000):
"""Midpoint sum of dB = mu0 I/(4 pi) * d / r^3 * dx along the wire."""
x1 = -d * math.tan(phi1)
x2 = d * math.tan(phi2)
dx = (x2 - x1) / n
total = 0.0
for k in range(n):
x = x1 + (k + 0.5) * dx
r = math.hypot(x, d)
total += dx * d / r**3
return mu0 * current / (4 * math.pi) * total
phi = math.radians(30)
print(b_finite_wire(10, 0.05, phi, phi)) # about 2e-05 tesla
print(b_numeric(10, 0.05, phi, phi)) # about 2e-05 teslaBoth lines print about 2 × 10⁻⁵ T. With phi = 30° on each side, the sum of sines is 0.5 + 0.5 = 1. The result is half of the infinite-wire value at the same distance.
Worked examples
A finite wire on its perpendicular bisector
A straight wire of length 0.6 m carries 5 A. Find B at a point 0.4 m from its midpoint, on the perpendicular bisector.
Half the length is 0.3 m, so r = sqrt(0.3² + 0.4²) = 0.5 m. Then sin(phi) = 0.3 / 0.5 = 0.6 for both ends.
B = (mu0 I / 4 pi d) × (0.6 + 0.6) = (10⁻⁷ × 5 / 0.4) × 1.2 = 1.5 × 10⁻⁶ T
A point beside the end of a wire
A wire of length L carries current I. Find B at a point a distance d from one end, on the perpendicular through that end.
At that end phi1 = 0, so sin(phi1) = 0. At the other end, sin(phi2) = L / sqrt(L² + d²). Then:
B = (mu0 I / 4 pi d) × L / sqrt(L² + d²)
When L is much larger than d, the fraction tends to 1 and B tends to mu0 I / (4 pi d), the semi-infinite result.
A bent wire
A wire comes in along a straight line, makes a right-angle turn at a corner, and leaves along a second line. For a point on the extension of one arm, that arm gives zero (the point is on its line). The other arm is semi-infinite with the point at its end, so it gives mu0 I / (4 pi d). Cutting a problem into segments like this and using the special-case table is how most NEET questions work.
Edge cases and common errors
- Point on the wire's line. dl and r are parallel, so sin(theta) = 0 and B = 0. The formula's sin(phi) terms do not apply here, because there is no perpendicular distance d.
- Foot of the perpendicular outside the wire. If P lies off to one side so that the perpendicular's foot is not on the wire, both ends are on the same side. The angles then enter as a difference of sines: sin(phifar) − sin(phinear).
- Using the infinite formula too freely. It is accurate only when the wire is much longer than d, and P is not near an end. Near an end the field drops toward half its value.
- Mixing up 2 pi and 4 pi. The infinite-wire formula has 2 pi. The general finite formula has 4 pi, with the sum of two sines that equals 2 for an infinite wire.
- A single segment is not a closed circuit. The Biot-Savart law applies to current elements. In a real circuit the rest of the circuit also contributes, so a "finite wire" question is really asking about one segment's contribution.
- Direction of a sum. Add vectors, not magnitudes, when segments give fields in different directions.
Exercise
A semi-infinite straight wire carries 8 A. Find B at a point 2 cm from the wire's end, on the perpendicular through that end. Use mu0 = 4 pi × 10⁻⁷ T m/A.
Show answer
phi1 = 0 and phi2 = 90°, so B = mu0 I / (4 pi d) = 10⁻⁷ × 8 / 0.02 = 4 × 10⁻⁵ T. Its direction follows the right-hand grip rule.
Exercise
A point lies on the line that extends a straight current-carrying wire, 10 cm beyond its end. What is B there, and why?
Show answer
B = 0. Every current element is parallel to the line from the element to the point, so sin(theta) = 0 for every element and no element contributes.
Exercise
A wire of length 1.0 m carries 3 A. Find B at a point 0.6 m from the midpoint on the perpendicular bisector, and compare it with the infinite-wire value at 0.6 m.
Show answer
Half the length is 0.5 m, so r = sqrt(0.5² + 0.6²) = sqrt(0.61) = 0.781 m and sin(phi) = 0.5 / 0.781 = 0.640. Then B = (10⁻⁷ × 3 / 0.6) × (2 × 0.640) = 6.4 × 10⁻⁷ T. The infinite-wire value is 2 × 10⁻⁷ × 3 / 0.6 = 1.0 × 10⁻⁶ T, so the finite wire gives about 64% of it.