In all these expressions m is the dipole and B is the magnetic field at its position. Note that if there are no currents or time-varying electrical fields or magnetic charge, ∇× B = 0, ∇⋅ B = 0 and the two expressions agree.