On this page
Your textbook gives you two energy formulas for magnetism: ½LI² for an inductor and B²/2μ₀ for energy density. They are the same idea: one counts the energy through the circuit, the other says where it sits, in the field. Here is the derivation, a numerical check, and what it means for light.
What is the formula for energy density in a magnetic field?
The magnetic energy density in vacuum is u = B²/2μ₀, measured in joules per cubic metre, as given in OpenStax University Physics Volume 2, section 14.3.
Here B is the field in tesla and μ₀ is the vacuum magnetic permeability, 1.256 637 061 27 × 10⁻⁶ N A⁻² in the 2022 CODATA recommended values published by NIST. That is very close to the 4π × 10⁻⁷ you use in exam numericals.
Its electric twin is u = ½ε₀E², which OpenStax section 8.3 says depends only on the magnitude of the field.
To get a feel for the size: a field of 1 tesla stores 1/(2μ₀) ≈ 3.98 × 10⁵ joules in every cubic metre.
How do you derive u = B²/2μ₀ from ½LI²?
Take a long solenoid: N turns, length l, area A, n = N/l turns per metre, current I. Ignore the ends, as OpenStax does in section 14.2.
Field inside: B = μ₀nI, uniform across the interior.
Self-inductance: L = μ₀N²A/l, which is the same as μ₀n²(Al).
Stored energy: U = ½LI² = ½μ₀n²(Al)I².
Swap current for field: from step 1, I = B/(μ₀n), so U = ½μ₀n²(Al) × B²/(μ₀²n²) = (B²/2μ₀) × Al.
Divide by the volume Al: u = U/(Al) = B²/2μ₀.
Look at what dropped out: n, N, I and A. The result depends only on B, so it belongs to the field, not to this coil. OpenStax runs the same argument in reverse, multiplying B²/2μ₀ by the volume Al to recover ½LI² (section 14.3).
If inductance itself feels slippery, read why self-inductance is called electrical inertia.
Worked example: does a real solenoid agree?
Take a solenoid 0.5 m long with 1000 turns, area 4 × 10⁻⁴ m², carrying 2 A, using the formulas from OpenStax section 14.2 with μ₀ = 4π × 10⁻⁷ N A⁻².
n = 1000/0.5 = 2000 turns per metre.
B = μ₀nI = 4π × 10⁻⁷ × 2000 × 2 ≈ 5.03 × 10⁻³ T.
u = B²/2μ₀ ≈ (5.03 × 10⁻³)² / (2.51 × 10⁻⁶) ≈ 10.05 J/m³.
Volume Al = 4 × 10⁻⁴ × 0.5 = 2 × 10⁻⁴ m³, so U = u × Al ≈ 2.01 × 10⁻³ J.
Second route: L = μ₀N²A/l ≈ 1.005 × 10⁻³ H, and ½LI² = ½ × 1.005 × 10⁻³ × 2² ≈ 2.01 × 10⁻³ J.
Both routes give about 2.01 mJ. If yours disagree, check n versus N. For more practice, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer.
Are electric and magnetic energy equal in an EM wave?
Yes. In an electromagnetic wave in vacuum, the electric and magnetic energy densities are equal, as OpenStax section 16.3 states.
The proof uses two facts from that section: E = cB, and c² = 1/(μ₀ε₀).
Electric part: ½ε₀E² = ½ε₀c²B².
Since ε₀c² = 1/μ₀, this is B²/2μ₀, exactly the magnetic part.
Total: u = ε₀E² = B²/μ₀.
This surprises students because B in light looks tiny. The laser example in OpenStax section 16.3 has peak fields E₀ = 0.87 V/m and B₀ = 2.9 × 10⁻⁹ T. Check it yourself with ε₀ = 8.854 × 10⁻¹² F/m from NIST's CODATA 2022 values: ½ε₀E₀² gives about 3.35 × 10⁻¹² J/m³, and B₀²/2μ₀ gives the same 3.35 × 10⁻¹² J/m³. A tiny B is divided by a tiny μ₀, so nothing is lost.
If E = cB is the step you would not have thought of, read the relation between E₀ and B₀ in an EM wave.
What mistakes do students make with this formula?
Run this checklist before finishing a JEE numerical:
Did you use n (turns per metre) in B = μ₀nI, and N (total turns) in L = μ₀N²A/l?
Did you keep the 2 in B²/2μ₀ for one field, and drop it only for the total in a wave, B²/μ₀?
Are you mixing peak values with averages? Averages over a cycle carry an extra ½.
Is the point near the end of the solenoid? The uniform-field result fails there; see why the field at the end of a solenoid is half.
If a step feels shaky because the idea behind it is fuzzy, the Fermi Concept Library gives each physics concept its own lesson and its place in the map. Then try the solenoid example again with 3 A and check that both routes still agree.



