Within a mathematical volume \({\mathcal V}\), the total magnetostatic energy is simply the integral of the energy density over \({\mathcal V}\); i.e., \[W_m = \int_{\mathcal V} w_m~dv \nonumber \] Th...Within a mathematical volume \({\mathcal V}\), the total magnetostatic energy is simply the integral of the energy density over \({\mathcal V}\); i.e., \[W_m = \int_{\mathcal V} w_m~dv \nonumber \] This works even if the magnetic field and the permeability vary with position.