# Derivation: Energy of the magnetic field

## Video: Maxwell Equations. Here You Get the Deepest Intuition!

We want to derive a formula for the energy $$W_{\text m}$$ stored in a magnetic field. Even if we use a coil for the derivation, the formula is valid in general.

Given a circuit with an resistance $$R$$ (e.g. the internal resistance of a coil) and a coil of inductance $$L$$ connected in series with $$R$$. In addition, an AC voltage $$U(t)$$ is applied to the circuit. It causes a time-dependent current $$I(t)$$ to flow through the coil, which generates a magnetic field in the coil due to induction.

If the circuit is interrupted (voltage source switched off), the current $$I(t)$$ through the coil does not immediately drop to zero, but decreases exponentially. The time-decaying current is described by the following exponential function:

Current through the RL circuit after switch-off
Formula anchor

Here $$I_0$$ is the maximum current through the coil before the switch-off process.

The energy is not lost after the circuit is switched off, but is released in the form of thermal energy at the resistor. We can use the dissipated power $$P(t)$$ (energy dissipated per time) at the resistor to calculate the total energy dissipated at the resistor. This dissipated energy must be the energy $$W_{\text m}$$, which was previously stored in the magnetic field of the coil. So integrate the power over time from the time $$t=0$$ of switching off, to the time $$t = \infty$$ when the current has dropped to zero. Since the exponential function theoretically never reaches zero, the final time is infinite:

Magnetic energy as integral of the power transferred
Formula anchor

The electric power $$P(t) = U \, I$$, in combination with Ohm's law, becomes $$P(t) = R \, I^2$$. Substituting in Eq. 2, we get an integration over the current:

Magnetic energy as integral of the current
Formula anchor

The time-dependent, decaying current 1 is inserted into Eq. 3:

Magnetic energy as integral of the exponentially decreasing current
Formula anchor

Now we have to calculate the integral:

Magnetic energy as integrated current over time
Formula anchor

Here the resistance $$R$$ is cancelled. We can pull out the factor $$-\frac{L}{2}$$ in front of the bracket and insert the two integration limits. The exponential function is zero at infinity:

Magnetic energy as integrated current over time with inserted integration limits
Formula anchor

The magnetic energy of the coil is thus determined by the inductance $$L$$ and by the current $$I_0$$ (amount of the current before the switch-off process) which has passed through the coil:

Formula anchor

## Magnetic energy expressed with B-field

The just derived energy of the magnetic field of the coil, expressed in terms of inductance, can also be formulated with the help of the B-field of the coil. By bringing the B-field into play, we can interpret the derived energy formula as an energy stored in the B-field.

Let the circuit described above be uninterrupted in the following. The magnitude of the magnetic field $$B$$ inside a long coil is given by:

Formula anchor

Here $$N$$ is the number of turns, $$l$$ is the coil length and $$\mu_0$$ is the magnetic field constant. Since the circuit has not been switched off, the current $$I(t)$$ continues to oscillate continuously, that is, it is a time-dependent quantity and, because of Eq. 8, so is the B-field.

The magnetic flux $$\Phi_{\text m} = B \, A$$ penetrating the cross-sectional area $$A$$ of the coil, combined with Eq. 8, is:

Magnetic flux through the coil interior
Formula anchor

The law of induction, once expressed with $$L$$ and once expressed with the time variation of the magnetic flux $$\frac{\text{d} \Phi_{\text m}}{\text{d} t}$$, is:

Induction voltage via inductance and magnetic flux change
Formula anchor

The number of turns $$N$$ occurs here because the magnetic flux passes through the coil cross-sectional area $$N$$-times. And $$U_{\text{ind}}$$ is the induction voltage between the two ends of the coil.

Let's equate the two induction voltages in Eq. 10 and bring $$N$$ to the right-hand side:

Magnetic flux change and current change
Formula anchor

To connect Eq. 9 with Eq. 11, 9 is differentiated with respect to time $$t$$. In this way, the time derivative of the current and the magnetic flux come into play as in Eq. 11:

Temporal change of magnetic flux linked to current change
Formula anchor

Coefficients of Eq. 11 and 12 must be equal:

Formula for inductance per number of turns
Formula anchor

Bring the number of turns $$N$$ to the right side of the equation:

Formula anchor

Rearrange Eq. 8 for the B field (but this time with current $$I_0$$) with respect to current $$I_0$$ and insert in magnetic energy 7. By doing this, you eliminate the current:

Magnetic energy via B-field and inductance
Formula anchor

Substitute the inductance $$L$$ from equation 14 into equation 15 to eliminate $$L$$:

Magnetic energy via B-field and coil length and cross-sectional area not simplified
Formula anchor

Cancel $$\mu_0$$, $$N$$ and $$l$$, then you get:

Magnetic energy via B-field and coil length and cross-sectional area
Formula anchor

Here the product $$A \, l$$ corresponds to the volume $$V$$ of the coil:

Formula anchor

You get the energy density $$w_{\text m} = W_{\text m} / V$$ of the B-field by dividing Eq. 18 by the volume $$V$$:

Energy density of the B-field
Formula anchor

## The Most Useful Physics Formula Collection on the Internet

+ Perfect for high school and undergraduate physics students
+ Contains over 500 illustrated formulas on just 140 pages
+ Contains tables with examples and measured constants
+ Easy for everyone because without vectors and integrals