Traditionally, the equations for the magnetic dipole moment (and higher order terms) are derived from theoretical quantities called magnetic potentials which are simpler to deal with mathematically than the magnetic fields.