More generally, if we assume that the medium is paramagnetic or diamagnetic so that a linear constitutive equation exists that relates B and H, then it can be shown that the magnetic field stores an energy of