# Energy of magnetic field

1. Feb 14, 2014

### LayMuon

The total energy of the magnetic field in the matter is $\frac{\mu H^2}{2}$, I want to calculated the energy that is being spent as a the work on magnetizing the material, so I need to subtract the energy of the magnetic field itself $\frac{B^2}{2}$ and the dipolar interaction $-\vec{M} \cdot \vec{B}$, however here is the problem $$\frac{\mu H^2}{2} - \frac{B^2}{2} = \frac{\mu H^2}{2} - \frac{(\mu H)^2}{2} < 0$$ for $\mu > > 1$.

Why the energy of magnetic field itself is given by $\frac{ H^2}{2}$ and not by $\frac{ B^2}{2}$?

2. Feb 15, 2014

### DrZoidberg

That equation is for the energy density of the field, not the total energy.
And it doesn't matter if you write $\frac{\mu H^2}{2}$ or $\frac{B^2}{2\mu}$ because $B = \mu H$

3. Feb 15, 2014

### LayMuon

That all was implied.

The question is why should we take the self energy density of the magnetic field as $H^2/2$ and not $B^2/2$, unlike the electric field where it is $E^2/2$ and not $D^2/2$.

4. Feb 16, 2014

### DrZoidberg

Why do you keep writing $\frac{H^2}{2}$ instead of $\frac{\mu H^2}{2}$?
Anyway, That's due to the way H, B and $\mu$ are defined. And because matter often interacts with magnetic fields in a way that's opposite to how it interacts with electric fields.
If you use different definitions, the equations look different.
e.g. in the cgs system the equations are $\frac{B^2}{8\pi}$ and $\frac{E^2}{8\pi}$