01 / 21

Magnetic Field:
Straight Wire

Learn to compute the magnetic field produced by a long, straight current-carrying wire using Biot-Savart law and Ampere's law.

Physics 2

What Is a Magnetic Field?

A magnetic field is a vector field that exerts a force on moving charges and magnetic dipoles. It is produced by moving electric charges (currents) and by changing electric fields.

Symbol
\(\vec{B}\) : magnetic field vector measured in Tesla (T)
Source
Any current-carrying conductor produces \(\vec{B}\) in the surrounding space

The Right-Hand Rule

The direction of \(\vec{B}\) around a straight wire follows the right-hand rule: point your thumb in the direction of conventional current \(I\), and your fingers curl in the direction of \(\vec{B}\).

Current \(I\) (out of page) \(\vec{B}\) field lines Farther = weaker

Why This Matters

The magnetic field from a straight wire is the building block of electromagnetism. Understanding it lets you analyze electromagnets, motors, transformers, and even MRI machines.

Electromagnets
Solenoids are just many straight wire segments wound into a coil
Force Between Wires
Two parallel wires attract or repel via their mutual \(\vec{B}\) fields
SI Unit Definition
The ampere is defined through the force between two wires 1 m apart

The Biot-Savart Law

The Biot-Savart law gives the magnetic field contribution \(d\vec{B}\) from an infinitesimal current element \(Id\vec{\ell}\):

1
\(\mu_0 = 4\pi \times 10^{-7}\;\text{T}\cdot\text{m/A}\) is the permeability of free space
2
\(d\vec{\ell}\) is a tiny segment of the wire in the direction of current
3
\(\hat{r}\) is the unit vector from the element to the field point, and \(r\) is the distance

Integrating for an Infinite Wire

For an infinitely long, straight wire carrying current \(I\), we integrate the Biot-Savart law over the entire wire. At perpendicular distance \(r\) from the wire, the result is:

\(I\) \(r\) P \(B\) (into page) Side view of wire with current flowing upward

Ampere's Law: A Powerful Shortcut

For systems with high symmetry, Ampere's law provides a faster route to the same result:

Choose a circular Amperian loop of radius \(r\) centered on the wire. By symmetry, \(\vec{B}\) is constant in magnitude and tangent to the loop everywhere:

This is identical to the Biot-Savart result, obtained in one line instead of a full integration.

Biot-Savart vs Ampere's Law

Biot-Savart Ampere's Law
Type Integration over source Circulation integral
Symmetry needed? No: works for any shape Yes: needs high symmetry
Best for Finite wires, arcs, loops Infinite wires, solenoids, toroids
Key formula \(dB = \frac{\mu_0}{4\pi}\frac{I\,d\ell\sin\theta}{r^2}\) \(\oint \vec{B}\cdot d\vec{\ell}=\mu_0 I_{\text{enc}}\)
Difficulty Harder (full integral) Easier (algebra)

How to Apply the Formula

1
Identify the current \(I\) and the perpendicular distance \(r\) from the wire to the field point
2
Check symmetry: if the wire is effectively infinite (or very long compared to \(r\)), use \(B = \frac{\mu_0 I}{2\pi r}\)
3
Substitute values: plug in \(\mu_0 = 4\pi \times 10^{-7}\;\text{T}\cdot\text{m/A}\), \(I\), and \(r\)
4
Find the direction using the right-hand rule: thumb along \(I\), fingers curl in the direction of \(\vec{B}\)
5
For multiple wires: compute \(\vec{B}\) from each wire separately, then add them as vectors (superposition)

Example 1: Single Wire

A long, straight wire carries a current of \(I = 5\;\text{A}\). Find the magnetic field at a distance \(r = 0.10\;\text{m}\) from the wire.

\(I = 5\) A \(r = 0.10\) m P

Example 2: Two Parallel Wires

Two long, parallel wires are separated by \(d = 0.20\;\text{m}\). Wire 1 carries \(I_1 = 3\;\text{A}\) (up) and Wire 2 carries \(I_2 = 3\;\text{A}\) (up). Find \(\vec{B}\) at the midpoint.

\(I_1 = 3\) A \(I_2 = 3\) A Midpoint \(d = 0.20\) m \(B_1\) (into page) \(B_2\) (out of page)

Example 3: Antiparallel Currents

Same two wires (\(d = 0.20\;\text{m}\)), but now Wire 2 carries current downward: \(I_1 = 3\;\text{A}\) up, \(I_2 = 3\;\text{A}\) down. Find \(\vec{B}\) at the midpoint.

\(B\) vs \(r\): The \(1/r\) Decay

\(r\) (m) \(B\) (T) 0.05 0.10 0.15 0.20 \(B \propto 1/r\)

Superposition of Magnetic Fields

When multiple wires are present, the total magnetic field at any point is the vector sum of the fields from each wire:

1
Compute magnitude of each \(\vec{B}_i\) using \(B = \frac{\mu_0 I}{2\pi r}\)
2
Find direction of each \(\vec{B}_i\) at the field point using the right-hand rule
3
Add as vectors: if fields point in the same direction they add; if opposite, they subtract

Common Mistakes

✕ Using \(1/r^2\)
The field from a long wire is \(1/r\), not \(1/r^2\). The inverse-square law applies to point charges and gravity, not extended wires.
✕ Forgetting the \(2\pi\)
The denominator is \(2\pi r\), not \(2r\). Dropping the \(\pi\) gives a result off by a factor of \(\approx 3.14\).
✕ Scalar Addition
Magnetic fields are vectors. You must determine direction first, then add. Opposite directions can cancel!

Summary at a Glance

Property Detail
Formula \(B = \dfrac{\mu_0 I}{2\pi r}\)
Field shape Concentric circles around wire
Direction rule Right-hand rule (thumb = \(I\))
Distance dependence \(B \propto 1/r\)
Multiple wires Vector superposition
\(\mu_0\) \(4\pi \times 10^{-7}\;\text{T}\cdot\text{m/A}\)
Preferred method Ampere's law (symmetric) or Biot-Savart (general)

Question 1 of 5

A long, straight wire carries a current of \(I = 10\;\text{A}\). What is the magnitude of the magnetic field at a distance \(r = 0.05\;\text{m}\) from the wire?

Question 2 of 5

If the distance from a long straight wire is tripled, the magnetic field magnitude:

Question 3 of 5

Two parallel wires carry equal currents in the same direction. At the midpoint between them, the net magnetic field is:

Question 4 of 5

In Ampere's law \(\oint \vec{B} \cdot d\vec{\ell} = \mu_0 I_{\text{enc}}\), the Amperian loop for a long straight wire should be:

Question 5 of 5

A wire carries \(I = 2\;\text{A}\). At what distance is the magnetic field equal to \(1.0 \times 10^{-6}\;\text{T}\)?