# Energy density in magnetic field

If an electric field $$\mathbf{E}$$ exists at a point in free space then the energy density in that point is $$\frac{1}{2} \epsilon_0 |\mathbf{E}|^2$$.

When a field with same magnitude $$|\mathbf{E}|$$ exists in a material with relative permettivity $$k$$, the energy density becomes $$\frac{1}{2} \epsilon_0 k |\mathbf{E}|^2$$, i.e. it increases $$k$$ times.

A similar analysis for energy density in magnetic field $$\frac{1}{2 \mu_0} |\mathbf{B}|^2$$ states that: if the field $$\mathbf{B}$$ exists in a material with relative permeability $$k$$ (consider a ferromagnetic material, for example) then $$\mu = k \mu_0$$ and thus the energy density decreases $$k$$ times (?). But this does not seem right because inductors with ferromagnetic cores store more energy.