= Solution
Define positive $\alpha$ by the <right-hand rule> about $+x$, starting from the loop in the $x$-$y$ plane at $\alpha=0$. Its <magnetic dipole moment> becomes
$$
\mathbf m(\alpha)=m(0,-\sin\alpha,\cos\alpha),\qquad m=I\pi a^2.
$$
The corresponding $x$ component of <magnetic dipole torque> is $\tau_x=-m(B_z\sin\alpha+B_y\cos\alpha)$. Integrating $\tau_x=-dE/d\alpha$ gives the mechanical <magnetic dipole potential energy>
$$
E=-\mathbf m\cdot\mathbf B=m(B_y\sin\alpha-B_z\cos\alpha),
$$
where the arbitrary additive constant is chosen as zero. Set $B_\perp=\sqrt{B_y^2+B_z^2}$. For $B_\perp>0$, a positive-amplitude form is
$$
\boxed{E=E_0\cos(\alpha-\alpha_0),\qquad E_0=mB_\perp,\qquad
\cos\alpha_0=-\frac{B_z}{B_\perp},\quad \sin\alpha_0=\frac{B_y}{B_\perp}.}
$$
Equivalently, $\alpha_0=\operatorname{atan2}(B_y,-B_z)$ modulo $2\pi$. With this positive choice, minimum <potential energy> occurs at $\alpha=\alpha_0+\pi$, where the rotating <magnetic dipole moment> aligns with the projection of $\mathbf B$ into the $y$-$z$ plane. If $B_y=B_z=0$, the allowed <torque> vanishes, $E_0=0$ and $\alpha_0$ is arbitrary. Holding <electric current> constant includes exchange with its supply; differentiating only the isolated loop's stored <magnetic energy> would not give the appropriate mechanical <potential energy>.
Back to article page