Physics 2 • Magnetism

Magnetic Field: Straight Wire — Compute magnetic field from long straight wires (Biot–Savart/Ampère)

Two powerful methods to determine the magnetic field created by current-carrying conductors.

A magnet with electricity and wave symbols for second-level physics.
Inside this lesson 10 sections 5 questions 8 figures

SECTION 1

Historical Context & Motivation

The relationship between electricity and magnetism was unknown before the nineteenth century; electric currents and magnetic compasses were studied as completely separate phenomena. The pivotal moment came in 1820 when the Danish physicist Hans Christian Ørsted noticed that a compass needle deflected when placed near a wire carrying an electric current, revealing that moving charges generate magnetic fields. Within months of this startling discovery, French physicist André-Marie Ampère formulated a quantitative law relating the circulation of the magnetic field to the enclosed current, while Jean-Baptiste Biot and Félix Savart independently derived a law that gives the magnetic field contribution from an infinitesimal current element. Together, these two approaches — the Biot–Savart law and Ampère's law — form the twin pillars for computing magnetic fields from steady currents, and they remain indispensable tools in electromagnetism courses and engineering practice.

1820 • Ørsted's Discovery

Ørsted demonstrates that a current-carrying wire deflects a nearby compass needle, establishing the first link between electricity and magnetism.

1820 • Biot–Savart Law

Biot and Savart quantify the magnetic field produced by an infinitesimal current element, laying the foundation for field calculations from arbitrary conductor geometries.

1826 • Ampère's Circuital Law

Ampère publishes his circuital relation, connecting the line integral of the magnetic field around a closed loop to the net enclosed current — a prototype of one of Maxwell's equations.

1865 • Maxwell's Unification

James Clerk Maxwell absorbs Ampère's law (with an added displacement-current term) into his four equations, completing the classical theory of electromagnetism.

The central question this lesson addresses is deceptively simple: given a long, straight wire carrying a steady current I, what is the magnitude and direction of the magnetic field B at a perpendicular distance r from the wire? We will derive the answer using both the Biot–Savart law and Ampère's law, compare the two strategies, and build the geometric intuition necessary to tackle more complex configurations.

SECTION 2

Core Principles & Definitions

Before diving into calculations, it is essential to establish the physical principles that underpin both the Biot–Savart law and Ampère's law. The magnetic field produced by a steady current is a vector field that permeates the space around the conductor. Unlike the electric field of a point charge, which radiates outward in all directions, the magnetic field lines form closed loops that encircle the current. Understanding the geometry of these loops and the mathematical tools that describe them is the key to mastering this topic.

1

Biot–Savart Law

Gives the differential contribution dB to the magnetic field from an infinitesimal current element I dl. It is the magnetic analogue of Coulomb's law and works for any geometry.
2

Ampère's Law

States that the closed line integral of B · dl around any Amperian loop equals μ₀ times the enclosed current. Most powerful when high symmetry simplifies the integral.
3

Right-Hand Rule

Point the thumb of your right hand in the direction of conventional current; your fingers curl in the direction of the magnetic field lines. This determines B's direction at every point.
4

Superposition

The total magnetic field at any point is the vector sum of the fields produced by each current element or each separate wire. This allows extension from a single wire to multi-wire configurations.
✦

KEY TAKEAWAY

Think of the Biot–Savart law as a precision scalpel: it works everywhere but requires careful integration. Ampère's law is more like an express lane on the highway — it gets you to the answer almost instantly, but only when the geometry has enough symmetry (infinite straight wire, infinite solenoid, toroid) to pull B out of the integral. Knowing when to use each method is as important as knowing the formulas themselves.

SECTION 3

Visual Explanation — Field Around a Straight Wire

Cross-Section: Magnetic Field Lines Around a Straight Wire⊙I (out of page)B₁B₂B₃r₁r₂LegendCurrent I (out of page)Magnetic field lines (concentric circles)B ∝ 1/r — field weakens with distanceRight-Hand RuleThumb → direction of ICurled fingers → direction of B
Cross-sectional view of the magnetic field around a long straight wire carrying current I directed out of the page. The concentric dashed circles represent field lines at increasing radii r1, r2, r3. Notice that the spacing between circles increases, reflecting the 1/r fall-off of the field magnitude.

The diagram above presents the end-on (cross-sectional) view of a long straight wire. The current I flows out of the page, indicated by the dot symbol (think of the tip of an arrow approaching you). The magnetic field lines form concentric circles centered on the wire, and their direction — counterclockwise here — is determined by the right-hand rule. A critical geometric observation is that B is everywhere tangent to these circles and its magnitude is constant along any single circle of radius r. This azimuthal symmetry is precisely what makes Ampère's law so efficient for this geometry: the integral ∮ B · dl around one of these circles immediately factors into B(2πr).

SECTION 4

Mathematical Framework

Derivation via the Biot–Savart Law

The Biot–Savart law expresses the infinitesimal magnetic field dB produced at a field point P by a tiny current element I dl located at a source point on the wire. To obtain the total field from an infinitely long straight wire, one integrates over all current elements from −∞ to +∞ along the wire.

BIOT–SAVART LAW (DIFFERENTIAL FORM)

dB=(μ0/4π)×(Idl×r^)/r2dB = (μ₀ / 4π) × (I dl × r̂) / r²

μ₀ = 4π × 10⁻⁷ T·m/A (permeability of free space); I = current; dl = infinitesimal length element along wire; r̂ = unit vector from source to field point; r = distance from source to field point.

Place the wire along the z-axis and the field point P at perpendicular distance s from the wire in the xy-plane. Parametrise the source position as z' so that dl = dz' ẑ. The displacement vector from the source element to P has magnitude r = √(s² + z'²), and the cross product |dz' ẑ × r̂| = s dz' / (s2+z2)1/2(s² + z'²)^{1/2}. Substituting into the Biot–Savart expression and integrating z' from −∞ to +∞ yields the standard integral ∫ dz' / (s2+z2)3/2(s² + z'²)^{3/2} = 2 / s². After simplification, the result is the well-known formula for the magnitude of B.

MAGNETIC FIELD — INFINITE STRAIGHT WIRE (BIOT–SAVART RESULT)

B=μ0I/(2πr)B = μ₀I / (2πr)

B = magnitude of magnetic field (T); I = current (A); r = perpendicular distance from wire (m). Direction: tangent to the concentric circle at the field point, determined by the right-hand rule.

Derivation via Ampère's Law

Ampère's law provides the same result with far less algebra when the geometry possesses sufficient symmetry. For an infinitely long straight wire, the magnetic field has only an azimuthal component that is constant on any circle concentric with the wire. Choose an Amperian loop — a circle of radius r in a plane perpendicular to the wire, centered on the wire. Along this loop, B is parallel to dl everywhere and has constant magnitude, so the line integral simplifies immediately.

AMPÈRE'S LAW

∮B⋅dl=μ0Ienc∮ B · dl = μ₀ I_enc

The closed integral is taken around any Amperian loop. Ienc is the net current threading through the loop. For the circular loop: B(2πr) = μ₀I, giving B = μ₀I / (2πr).

ℹ

Why Do Both Methods Give the Same Answer?

The Biot–Savart law and Ampère's law are not independent postulates — Ampère's law can be derived from the Biot–Savart law using vector calculus (specifically, taking the curl of B and applying Stokes' theorem). They encode the same physics; the difference is purely in the mathematical route to the answer.

SECTION 5

Detailed Geometry — Biot–Savart Integration Setup

The most common challenge students encounter with the Biot–Savart derivation is setting up the geometry correctly. The diagram below shows a side view of the infinite wire, a single current element at position z' on the wire, and the field point P at perpendicular distance s. All angles, vectors, and distances are labelled to make the integration transparent.

Biot–Savart Geometry for an Infinite Straight WireI ↑z-axis (wire)I dlat z'Ps (perpendicular distance)r = √(s² + z'²)separation vectorθdB(out of plane)Key Relationssin θ = s / r = s / √(s²+z'²)|dl × r̂| = dl sin θIntegrate z' from −∞ to +∞z'
Side-view geometry for the Biot–Savart integration. The wire lies along the z-axis carrying current I upward. A current element at position z' produces a field contribution dB at point P that is perpendicular to the plane defined by the wire and P. The angle θ and distance r = √(s² + z'²) vary as the integration runs from −∞ to +∞.

The crucial trigonometric substitution is z' = s tan φ, which transforms the integral into one over the angle φ from −π/2 to +π/2. After evaluating, the factors of 4π cancel neatly against the prefactor, leaving the familiar result B = μ₀I / (2πs). For a finite wire segment subtending angles θ₁ and θ₂ at the field point, the result generalises to B = (μ₀I / 4πs)(cos θ₁ − cos θ₂), which reduces to the infinite-wire formula when θ₁ → 0 and θ₂ → π.

FINITE STRAIGHT WIRE (GENERAL FORM)

B=(μ0I/4πs)(cosθ1−cosθ2)B = (μ₀I / 4πs)(cos θ₁ − cos θ₂)

θ₁ and θ₂ are the angles measured from the perpendicular (at point P) to the lines connecting P to each end of the wire segment. For an infinite wire, θ₁ → 0 and θ₂ → π, so cos θ₁ − cos θ₂ = 1 − (−1) = 2, recovering B = μ₀I / (2πs).

SECTION 6

Worked Example

Magnetic Field from Two Parallel Wires

  1. 1

    Step 1 — Problem Statement

    Two long, straight, parallel wires are separated by a distance d = 0.20 m. Wire 1 carries a current I1 = 5.0 A to the right, and Wire 2 carries I2 = 3.0 A to the left. Find the net magnetic field at point P, located midway between the wires.
  2. 2

    Step 2 — Identify the Geometry

    Point P is at a perpendicular distance r = d/2 = 0.10 m from each wire. We need to compute B1 and B2 at P using B = μ₀I / (2πr) and then apply superposition.
  3. 3

    Step 3 — Compute Individual Fields

    B₁ = μ₀I₁ / (2πr) = (4π × 10⁻⁷ T·m/A)(5.0 A) / (2π × 0.10 m) = (2.0 × 10⁻⁶) / (0.6283) = 1.0 × 10⁻⁵ T = 10 μT. Similarly, B₂ = μ₀I₂ / (2πr) = (4π × 10⁻⁷)(3.0) / (2π × 0.10) = 6.0 × 10⁻⁶ T = 6.0 μT.
    B₁ = 10 μT, B₂ = 6.0 μT
  4. 4

    Step 4 — Determine Directions (Right-Hand Rule)

    For Wire 1 (current to the right), the right-hand rule gives B1 directed into the page at P (above the wire) and out of the page below. At the midpoint (above Wire 1), B1 points into the page. For Wire 2 (current to the left, positioned above P), the right-hand rule also gives B2 into the page at P. Both fields point in the same direction.
  5. 5

    Step 5 — Superpose

    Since both fields point into the page, the magnitudes add: B_net = B₁ + B₂ = 10 μT + 6.0 μT = 16 μT, directed into the page.
    B_net = 16 μT, into the page
⚠

Common Pitfall

When currents flow in opposite directions, the fields at the midpoint add (both into or both out of the page). When currents flow in the same direction, the fields at the midpoint subtract (they point in opposite directions). Always sketch the field directions before combining magnitudes!

SECTION 7

Biot–Savart vs. Ampère's Law — When to Use Which

Students frequently ask which method to use on an exam. The answer depends almost entirely on the symmetry of the current distribution. The table below provides a concise decision guide. In general, attempt Ampère's law first whenever the geometry allows you to identify a loop on which B is constant and parallel (or perpendicular) to dl; resort to Biot–Savart when no such loop exists.

FeatureBiot–Savart LawAmpère's Law
ApplicabilityAny steady-current geometryHigh-symmetry geometries only
Mathematical effortRequires integration over entire current distributionAlgebraic after choosing the correct Amperian loop
Ideal geometriesFinite segments, curved arcs, arbitrary loopsInfinite straight wire, infinite solenoid, toroid, coaxial cable
Analogy to electrostaticsCoulomb's law (sum field from each element)Gauss's law (exploit symmetry to bypass integration)
Direction informationCross product gives direction automaticallyDirection inferred from symmetry + right-hand rule

Comparison of Biot–Savart and Ampère's law approaches

✦

KEY TAKEAWAY

The Biot–Savart law is to magnetostatics what Coulomb's law is to electrostatics: universally valid but often computationally demanding. Ampère's law is the magnetic counterpart of Gauss's law: elegant and efficient, but only when the symmetry of the current configuration allows you to pull B out of the line integral. In an engineering context, choosing the right tool is half the battle.

SECTION 8

Connection to Advanced Electromagnetic Theory

The infinite-straight-wire result is not merely an isolated formula — it is a gateway to several more advanced topics. When Maxwell extended Ampère's law to include the displacement current term (ε₀ ∂E/∂t), the law became valid for time-varying fields as well, ultimately leading to the prediction of electromagnetic waves. In differential form, Ampère–Maxwell's equation reads ∇ × B = μ₀J + μ₀ε₀ ∂E/∂t. The steady-state version (∇ × B = μ₀J) is precisely what we used in integral form in this lesson.

ConceptThis LessonAdvanced Extension
Current typeSteady (DC) current in wiresTime-varying currents, displacement current
Law formIntegral form: ∮ B · dl = μ₀I_encDifferential form: ∇ × B = μ₀J + μ₀ε₀ ∂E/∂t
GeometryInfinite straight wireSolenoids, toroids, coaxial cables, waveguides
ApplicationsForce between parallel wires, definition of the ampereElectromagnetic wave propagation, antenna design, transformer theory

From the straight wire to Maxwell's equations

Historically, the force per unit length between two parallel current-carrying wires, F/L = μ₀I₁I₂ / (2πd), served as the basis for the SI definition of the ampere until 2019 when it was redefined in terms of the elementary charge. The straight-wire magnetic field formula thus sits at the intersection of fundamental physics and metrology. As you proceed to study solenoids and Faraday's law, the intuitions you build here — circling field lines, the 1/r dependence, the role of symmetry in simplifying calculations — will transfer directly.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

A long straight wire carries a steady current I. If you double the distance from the wire, how does the magnetic field magnitude change? Explain why this 1/r dependence differs from the 1/r² dependence of a point charge's electric field.
Show answer
Doubling the distance halves the magnetic field because B = μ₀I/(2πr) is inversely proportional to r. The 1/r (rather than 1/r²) behaviour arises because the source is a line of current, not a point. In the Biot–Savart integration over an infinite wire, each element contributes a 1/r² piece, but the integration over the infinite length adds an extra factor of r in the numerator (geometrically, there are more contributing elements at larger distances). Dimensionally and physically, a line source in three dimensions produces a field that falls off as 1/r, analogous to the electric field of an infinite line charge obtained via Gauss's law.

Question 2: BASIC CALCULATION

A long straight wire carries a current of 8.0 A. Calculate the magnitude of the magnetic field at a perpendicular distance of 0.050 m from the wire. Use μ₀ = 4π × 10⁻⁷ T·m/A.
Show answer
Applying B = μ₀I/(2πr): B = (4π × 10⁻⁷ T·m/A)(8.0 A) / (2π × 0.050 m) = (4π × 8.0 × 10⁻⁷) / (2π × 0.050). The π factors simplify: B = (4 × 8.0 × 10⁻⁷) / (2 × 0.050) = (32 × 10⁻⁷) / (0.10) = 3.2 × 10⁻⁵ T = 32 μT. This is roughly comparable to Earth's magnetic field (~50 μT), which makes physical sense for a household-level current at a few centimetres distance.

Question 3: INTERMEDIATE

Two long parallel wires are 0.30 m apart. Wire A carries 10 A northward and Wire B carries 10 A southward. Find the magnetic field (magnitude and direction) at a point P that lies in the plane of the wires, 0.10 m from Wire A and 0.20 m from Wire B.
Show answer
First, compute each field: BAB_A = μ₀(10)/(2π × 0.10) = 2.0 × 10⁻⁵ T = 20 μT. BBB_B = μ₀(10)/(2π × 0.20) = 1.0 × 10⁻⁵ T = 10 μT. Since the currents are antiparallel and P lies between the wires, the right-hand rule shows that both BAB_A and BBB_B point in the same direction at P (both into or both out of the page, depending on orientation). If A carries current north (upward in the page) and P is to the east of A, BAB_A points into the page. Wire B carries current south (downward) and P is to the west of B, so BBB_B also points into the page. Therefore B_net = 20 + 10 = 30 μT = 3.0 × 10⁻⁵ T, directed into the page.

Question 4: APPLIED

A high-voltage DC transmission line carries 500 A and must be routed past a hospital where sensitive MRI equipment requires the ambient field perturbation to remain below 0.5 μT. What is the minimum perpendicular distance the transmission line must be placed from the MRI suite?
Show answer
Rearrange B = μ₀I/(2πr) for r: r = μ₀I/(2πB). Substituting: r = (4π × 10⁻⁷)(500) / (2π × 0.5 × 10⁻⁶) = (2π × 10⁻⁴) / (π × 10⁻⁶) = 2 × 10⁻⁴ / 10⁻⁶ = 200 m. The transmission line must be at least 200 metres from the MRI suite to keep the field perturbation below 0.5 μT. In practice, engineers would add a safety margin and might also consider shielding, but this calculation provides the fundamental constraint dictated by the inverse-distance law.

Question 5: CRITICAL THINKING

Using the Biot–Savart law result for a finite straight wire, B = (μ₀I/4πs)(cos θ₁ − cos θ₂), show that in the limit where the wire extends from z' = −L/2 to z' = +L/2 and the field point is at perpendicular distance s, the expression approaches μ₀I/(2πs) as L → ∞. Discuss the physical meaning of this limit and under what conditions the infinite-wire approximation breaks down.
Show answer
For a wire of length L centred at the origin, the angles are determined by cos θ₁ = (L/2)/√(s² + (L/2)²) and cos θ₂ = −(L/2)/√(s² + (L/2)²), where θ₁ is the angle subtended at P by the near end and θ₂ by the far end, measured from the perpendicular. Thus cos θ₁ − cos θ₂ = 2(L/2)/√(s² + L²/4) = L/√(s² + L²/4). Substituting: B = (μ₀I/4πs) × L/√(s² + L²/4). As L → ∞, L/√(s² + L²/4) → L/(L/2) = 2, so B → (μ₀I/4πs)(2) = μ₀I/(2πs), recovering the infinite-wire result. The approximation breaks down when the field point's distance s is comparable to or larger than L/2, because then the wire no longer 'looks' infinite. A common rule of thumb is that the infinite-wire formula is accurate to within ~1% when s < L/20.

SUMMARY

Lesson Summary

Summary

A long, straight wire carrying a steady current I creates a magnetic field whose field lines form concentric circles around the wire. The magnitude of this field is given by B = μ₀I / (2πr), where r is the perpendicular distance from the wire. This result can be derived two ways: the Biot–Savart law integrates contributions from every infinitesimal current element along the wire, while Ampère's law exploits the cylindrical symmetry to bypass the integration entirely by choosing a circular Amperian loop.

The direction of B is always determined by the right-hand rule: point your thumb along the current and your fingers curl in the direction of the field. For systems of multiple wires, superposition dictates that you compute the field from each wire independently and sum them as vectors. The finite-wire generalisation, B = (μ₀I/4πs)(cos θ₁ − cos θ₂), reduces to the infinite-wire formula in the appropriate limit. This foundational result connects forward to solenoids, toroids, electromagnetic induction, and ultimately Maxwell's equations.

Varsity Tutors • Physics 2 • Magnetic Field: Straight Wire — Compute magnetic field from long straight wires (Biot–Savart/Ampère)