Deep Dive: Energy in Magnetic Fields
It takes work to establish a current in a circuit because you have to fight against the Back EMF. That work is stored as potential energy in the magnetic field.
Work Done against Back EMF
The work done (per unit time) to drive a current $I$ against a back emf $\mathcal{E}$ is $P = -\mathcal{E}I$. Since $\mathcal{E} = -L \frac{dI}{dt}$, we have:
Integrating this from zero current to a final current $I$:
Energy Density
Just as we did for capacitors ($W = \frac{1}{2}CV^2 \rightarrow u = \frac{1}{2}\epsilon_0 E^2$), we can re-express this total energy in terms of the field itself. Using Ampere's law and vector calculus identities, we can show that the energy is stored in the volume occupied by the field:
Or in terms of energy density (Joules per cubic meter):
This confirms that magnetic fields, like electric fields, store real energy.