# Interaction between magnetic moments and magnetic field

Consider a particle with a magnetic moment $\vec{m}$. For simplicity, suppose that this particle is a circle in the plane $xy$ which can rotate around its center of mass along the $z$ axis. If this particle is subject to an external magnetic field $\vec{B}$ in the plane $xy$, then its potential energy is:

$$U = -\vec{m} \cdot \vec{B} = -mB\cos(\theta),$$

where $m = \|\vec{m}\|$, $B = \|\vec{B}\|$, and $\theta$ is the angle between $\vec{m}$ and $\vec{B}$.

Reading around, I found that the exerted torque on the particle is

$$\vec{\tau} = \vec{m} \times \vec{B}.$$

In the planar case I'm working on, $\vec{\tau}$ has only the $z$ component, which is $$\tau_z = mB\sin(\theta).$$

Anyway, If I want to obtain the torque from the potential energy, I get this:

$$\tau_z = -\frac{\partial U}{\partial \theta} = -\left[-mB(-\sin(\theta)) \right] = -mB\sin(\theta).$$

Where is the truth? Am I wrong with my calculations?

• Your question can be improved if you make the geometry more clear. If the object is constrained to stay in the xy plane, then other forces act too, to keep it in that plane. And are you restricting $\vec B$ to be in the xy plane too? Neither of those change your cosine formula, which always holds if $\theta$ is the angle in between. But for that $\theta$ your expression with sine is for the magnitude of the torque vector you specified. You need to do something additional if you want to get the z component. Apr 8, 2016 at 14:50

The difference is only how you define $\theta$ and the zero of potential energy.
The $\cos \theta$ expression takes the zero of potential energy to be when $\theta = \frac \pi 2$ whereas you derivation with $\sin \theta$ in it takes the zero of potential to be when $\theta = 0$.

• then, $-mB\sin(\theta)$ is coherent with the choice that the zero of potential energy is $\theta = \frac \pi 2$, while $mB\sin(\theta)$ does not, right? Apr 8, 2016 at 10:17
• I think that the minus sign is put into $U = -\vec{m} \cdot \vec{B} = -mB\cos(\theta),$ to make the minimum of potential energy occur when the magnet moment direct and the magnetic field direction are both in the same direction. The dot product gives a positive number and the minus makes it a minimum. The direction of the magnetic moment could have been defined the opposite way round but it wasn't and so the minus must be there. Apr 8, 2016 at 10:39
• I think the article by Griffiths makes some interesting points relevant to this question, see "Dipoles at rest" Am. J. Phys. 60, 979 (1992);
– jim
Apr 8, 2016 at 15:54
• @jim Thank you for taking the time suggest some further reading. My problem is that I do not have access to most of the cited articles unless I pay a fee which I am usually reluctant to do. Apr 8, 2016 at 16:03
• @Farcher I'll try and get the relevant papers (came across a few more) printed tomorrow and read through them and try and prepare an answer
– jim
Apr 8, 2016 at 20:13

Must admit this got me really worried, and I wondered if the problem was maybe in the use of $\bf{\tau} = \bf{r \times F}$ and identifying the force with the (negative) gradient of some potential. Then, I really got worried because it seemed to me that the same problem would occur if you were to make similar calculations with determining the torque on an electric dipole. However consider the following figure which shows a magnetic dipole, $\bf{m}$ aligned in the $x, y$ plane with the magnetic field, $\bf{B}$, taken to lie along the $y$ axis.

Then when you use plane polar coordinates, the torque is given as $\bf{\tau = -r \times \nabla}$ $V$, with $V = -\bf{m.B} =$ $-m \, B \, cos \theta$. When the vector ${\bf r}$ is taken in the $x, y$ plane the torque reduces to $-[\frac{\partial V}{\partial \phi}\bf{ k} - \rho \frac{\partial V}{\partial z} {\bf \phi}]$ which further reduces to $-\frac{\partial V}{\partial \phi}\bf{ k}$ since the potential does not depend on $z$. This is, I think, where you are starting from? I think your mistake is that $\frac{\partial}{\partial \phi} \ne \frac{\partial}{\partial \theta}$, but rather $\frac{\partial}{\partial \phi} = -\frac{\partial}{\partial \theta}$ (the angles $\phi$ and $\theta$ are not independent, here $\phi + \theta = \frac{\pi}{2}$ so $d \phi = - d \theta$.

Maybe, I found the solution. let's denote with $\theta_k$ the rotation around $k$-axis. Suppose that both $\vec{m}$ and $\vec{B}$ belongs to $xy$ plane. That is:

$$\vec{m} = \begin{pmatrix} m \cos(\theta_z)\\ m \sin(\theta_z)\\ 0 \end{pmatrix} ~\text{and} ~\vec{B} = \begin{pmatrix} B \\ 0\\ 0 \end{pmatrix}.$$

The torque using the formula $\vec{\tau} = \vec{m} \times \vec{H}$ is: $$\vec{\tau} = \det\begin{pmatrix} \vec{x} & \vec{y} & \vec{z} \\ m \cos(\theta_z) & m \sin(\theta_z) & 0\\ B & 0 & 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 0\\ -mB \sin(\theta_z) \end{pmatrix}.$$

On the other hand, if I evaluate the torque using the potential $U = -\vec{m} \cdot \vec{B} = -mB \cos(\theta_z)$, I get:

$$\vec{\tau} = -\nabla U = -\begin{pmatrix} \displaystyle\frac{\partial U}{\partial \theta_x} \\ \displaystyle\frac{\partial U}{\partial \theta_y}\\ \displaystyle\frac{\partial U}{\partial \theta_z} \end{pmatrix} = \begin{pmatrix} 0 \\ 0\\ -mB \sin(\theta) \end{pmatrix}.$$

At the end of the story, $-mB \sin(\theta)$ is just the $z$ component of the torque.