Force and torque on magnetic dipole

Under an external magnetic field $\v B(\v x)$ that varies slowly over the length scale $R$, the current distribution experiences a torque (Derivation) $$ \begin{align*} \v τ \approx \v m\times \v B \end{align*} $$ and a force (Derivation) $$ \begin{align*} \v F \approx ∇(\v m\cdot \v B) \end{align*} $$ up to first order.

Thus the force is conservative: $$ \begin{align*} \v F \approx -∇U, \qquad U = -\v m\cdot \v B, \end{align*} $$ with the potential energy $U$ minimised when $\v m$ is aligned with $\v B$.