Generating Magnetic Fields: From Current to B-Field

The Biot-Savart Law

The Biot-Savart Law is the fundamental principle used to calculate the magnetic field produced by a steady electric current. It plays a role in magnetism analogous to Coulomb's Law in electrostatics. While Coulomb's Law calculates the electric field from a point charge, the Biot-Savart Law calculates the differential magnetic field contribution (dB⃗d\vec{B}) from a differential current element (Idl⃗Id\vec{l}).

The Formula

For a small segment of wire of length dl⃗d\vec{l} carrying current II, the magnetic field dB⃗d\vec{B} at a point PP is given by:

dB⃗=μ04πIdl⃗×r^r2d\vec{B} = \frac{\mu_0}{4\pi} \frac{I d\vec{l} \times \hat{r}}{r^2}

Where:

  • μ0\mu_0 is the permeability of free space (4π×10−7 T⋅m/A4\pi \times 10^{-7} \ T\cdot m/A).
  • II is the steady current (Amperes).
  • dl⃗d\vec{l} is the vector representing the infinitesimal length element pointing in the direction of current.
  • r^\hat{r} is the unit vector pointing from the current element to the point of observation PP.
  • rr is the distance from the current element to point PP.

A diagram illustrating the Biot-Savart Law geometry. A curved wire carrying current I has a small segment dl highlighted. A vector r points from dl to a point P in space. The resulting magnetic field vector dB is shown at point P, perpendicular to both dl and r, determined by the right-hand rule.

Key Principles
  • Vector Nature: Since this involves a cross product (dl⃗×r^d\vec{l} \times \hat{r}), the resulting magnetic field is always perpendicular to both the current direction and the position vector. You must use the Right-Hand Rule to determine direction.
  • Superposition: To find the total magnetic field B⃗\vec{B}, you must integrate the contribution over the entire length of the current distribution:
    B⃗=∫μ0I4πdl⃗×r^r2\vec{B} = \int \frac{\mu_0 I}{4\pi} \frac{d\vec{l} \times \hat{r}}{r^2}
Worked Example: Field of a Finite Straight Wire

Consider a straight wire of length LL lying on the x-axis from −L/2-L/2 to L/2L/2. Calcuate the BB-field at a point PP located distance yy above the center of the wire.

  1. Setup: dl⃗=dx i^d\vec{l} = dx \ \hat{i}. The vector r⃗\vec{r} points from xx to yy, so magnitude r=x2+y2r = \sqrt{x^2 + y^2}.
  2. Cross Product: The angle θ\theta between the wire and r⃗\vec{r} satisfies sin⁡(θ)=yx2+y2\sin(\theta) = \frac{y}{\sqrt{x^2+y^2}}. The direction is k^\hat{k} (out of page).
  3. Integration:
    B=μ<em>0I4π∫</em>−L/2L/2sin⁡(θ)x2+y2dxB = \frac{\mu<em>0 I}{4\pi} \int</em>{-L/2}^{L/2} \frac{\sin(\theta)}{x^2+y^2} dx
    Using trigonometric substitution (where x=ytan⁡αx = y \tan \alpha), the result simplifies to:
    B=μ0I2πyLL2+4y2B = \frac{\mu_0 I}{2\pi y} \frac{L}{\sqrt{L^2 + 4y^2}}

Ampere’s Law

While the Biot-Savart Law is universal, the integration can be mathematically difficult. Ampere’s Law relates the integrated magnetic field around a closed loop to the electric current passing through the loop. It is highly effective for calculating magnetic fields in situations with high symmetry (cylindrical or planar).

The Formula

∮B⃗⋅dl⃗=μ<em>0I</em>enc\oint \vec{B} \cdot d\vec{l} = \mu<em>0 I</em>{enc}

  • ∮B⃗⋅dl⃗\oint \vec{B} \cdot d\vec{l}: The line integral of the magnetic field around a closed path (Amperian Loop).
  • IencI_{enc}: The net current enclosed by (passing through) the area defined by the Amperian Loop.
Applying Ampere’s Law

To use this law effectively, you must choose an Amperian Loop such that:

  1. The magnetic field B⃗\vec{B} is constant in magnitude everywhere on the loop.
  2. The angle between B⃗\vec{B} and dl⃗d\vec{l} is constant (usually 0∘0^\circ or 90∘90^\circ).

When these conditions are met, the vector dot product simplifies to standard multiplication, allowing you to pull BB out of the integral:
B∮dl=μ<em>0I</em>enc  ⟹  B(L)=μ<em>0I</em>encB \oint dl = \mu<em>0 I</em>{enc} \implies B(L) = \mu<em>0 I</em>{enc}

FeatureBiot-Savart LawAmpere's Law
AnalogyCoulomb's LawGauss's Law
ApplicabilityAny steady current distributionHighly symmetric currents
Math DifficultyHigh (Vector calculus integration)Low (Algebraic if symmetry exists)

Magnetic Fields of Common Configurations

There are four specific geometries you must master for the AP Physics C exam.

1. The Long Straight Wire

For an infinitely long wire carrying current II, we use a circular Amperian loop of radius rr.

  • Circumference: 2πr2\pi r
  • Symmetry: B⃗\vec{B} is tangent to the circle everywhere.
  • Result:
    B=μ0I2πrB = \frac{\mu_0 I}{2\pi r}

Note: If the wire has a physical radius RR and uniform current density JJ, the field inside the wire (r<Rr < R) increases linearly with rr, while the field outside (r>Rr > R) drops off as 1/r1/r.

Graph showing Magnetic Field B vs Distance r for a thick wire of radius R. From r=0 to r=R, the line is linear increasing. At r=R, it peaks. From r>R, it is a curve decaying towards zero (1/r relationship).

2. Force Between Parallel Wires

Two parallel wires carrying currents I<em>1I<em>1 and I</em>2I</em>2 separated by distance dd exert magnetic forces on each other.

  • Wire 1 creates a field B<em>1=μ</em>0I12πdB<em>1 = \frac{\mu</em>0 I_1}{2\pi d} at the location of Wire 2.
  • Wire 2 experiences a force F=I<em>2LB</em>1F = I<em>2 L B</em>1.
  • Force per unit length:
    FL=μ<em>0I</em>1I22πd\frac{F}{L} = \frac{\mu<em>0 I</em>1 I_2}{2\pi d}

Memory Aid:

  • Currents in the SAME direction ATTRACT.
  • Currents in OPPOSITE directions REPEL.
3. The Solenoid

A solenoid is a long coil of wire consisting of many loops.

  • Ideal Solenoid: Long length compared to diameter. The field inside is uniform; the field outside is approximately zero.
  • Derivation: Use a rectangular Amperian loop partially inside and partially outside the solenoid.
  • Formula:B=μ0nIB = \mu_0 n I
    • Here, n=N/Ln = N/L is the number of turns per unit length (turns per meter), NOT the total turns NN.

Cross-sectional diagram of a solenoid. Circles with dots represent current coming out at the top, circles with crosses represent current going in at the bottom. Magnetic field lines inside are dense, straight, and parallel (uniform). Field lines outside are sparse and curve widely.

4. The Toroid

A toroid is essentially a solenoid bent into a circle (like a donut).

  • Field Inside: The field is confined entirely inside the coils.
  • Formula: Derived using a circular Amperian loop inside the toroid of radius rr. B=μ0NI2πrB = \frac{\mu_0 N I}{2\pi r}
    • Here, NN is the total number of turns.
    • Note that BB is not uniform; it is stronger at the inner radius and weaker at the outer radius (1/r1/r dependence).

Common Mistakes & Pitfalls

  1. Confusing nn and NN: In solenoid problems, students often plug in the total turns NN instead of the turn density nn. Remember: n=N/Ln = N/L.
  2. The "Radius" Trap in Biot-Savart: The denominator in Biot-Savart is r2r^2, but the integration often involves variables like x2+y2x^2 + y^2. Don't forget to rewrite dl⃗d\vec{l} and rr in terms of the integration variable properly before integrating.
  3. Right-Hand Rule Orientation: When using Ampere's Law, the direction of the integration path determines the sign of the enclosed current. If you curl your fingers in the direction of integration, your thumb points in the direction of positive current.
  4. Enclosed Current: For thick wires or coaxial cables, calculating I<em>encI<em>{enc} often requires a ratio of areas (current density J=I</em>total/A<em>totalJ = I</em>{total}/A<em>{total}) if the loop is inside the conductor. Do not assume I</em>enc=ItotalI</em>{enc} = I_{total} if r<Rr < R.