The forces on a current loop; energy of a dipole
In the last chapter we studied the magnetic field produced by a small rectangular current loop. We found that it is a dipole field, with the dipole moment given by \begin{equation} \label{Eq:II:15:1} \mu=IA, \end{equation}  where $I$ is the current and $A$ is the area of the loop. The direction of the moment is normal to the plane of the loop, so we can also write \begin{equation*} \FLPmu=IA\FLPn, \end{equation*}  where $\FLPn$ is the unit normal to the area $A$. A current loop—or magnetic dipole—not only produces magnetic fields, but will also experience forces when placed in the magnetic field of other currents. We will look first at the forces on a rectangular loop in a uniform magnetic field. Let the $z$-axis be along the direction of the field, and the plane of the loop be placed through the $y$-axis, making the angle $\theta$ with the $xy$-plane as in Fig. 15–1. Then the magnetic moment of the loop—which is normal to its plane—will make the angle $\theta$ with the magnetic field. Since the currents are opposite on opposite sides of the loop, the forces are also opposite, so there is no net force on the loop (when the field is uniform). Because of forces on the two sides marked $1$ and $2$ in the figure, however, there is a torque which tends to rotate the loop about the $y$-axis. The magnitude of these forces $F_1$ and $F_2$ is \begin{equation*} F_1=F_2=IBb. \end{equation*}  Their moment arm is \begin{equation*} a\sin\theta, \end{equation*}  so the torque is  \begin{equation*} \tau=IabB\sin\theta. \end{equation*}  or, since $Iab$ is the magnetic moment of the loop,  \begin{equation*} \tau=\mu B\sin\theta. \end{equation*}  The torque can be written in vector notation:  \begin{equation} \label{Eq:II:15:2} \FLPtau=\FLPmu\times\FLPB. \end{equation}  Although we have only shown that the torque is given by Eq. (15.2) in one rather special case, the result is right for a small loop of any shape, as we will see. The same kind of relationship holds for the torque of an electric dipole in an electric field:  \begin{equation*} \FLPtau=\FLPp\times\FLPE. \end{equation*}  We now ask about the mechanical energy of our current loop. Since there is a torque, the energy evidently depends on the orientation. The principle of virtual work says that the torque is the rate of change of energy with angle, so we can write  \begin{equation*} dU=\tau\,d\theta. \end{equation*}  Setting $\tau=\mu B\sin\theta$, and integrating, we can write for the energy  \begin{equation} \label{Eq:II:15:3} U=-\mu B\cos\theta+\text{a constant}. \end{equation}  (The sign is negative because the torque tries to line up the moment with the field; the energy is lowest when $\FLPmu$ and $\FLPB$ are parallel.) For reasons which we will discuss later, this energy is not the total energy of a current loop. (We have, for one thing, not taken into account the energy required to maintain the current in the loop.) We will, therefore, call this energy $U_{\text{mech}}$, to remind us that it is only part of the energy. Also, since we are leaving out some of the energy anyway, we can set the constant of integration equal to zero in Eq. (15.3). So we rewrite the equation:  \begin{equation} \label{Eq:II:15:4} U_{\text{mech}}=-\FLPmu\cdot\FLPB. \end{equation}  Again, this corresponds to the result for an electric dipole:  \begin{equation} \label{Eq:II:15:5} U=-\FLPp\cdot\FLPE. \end{equation}  Now the electrostatic energy $U$ in Eq. (15.5) is the true energy, but $U_{\text{mech}}$ in (15.4) is not the real energy. It can, however, be used in computing forces, by the principle of virtual work, supposing that the current in the loop—or at least $\mu$—is kept constant. We can show for our rectangular loop that $U_{\text{mech}}$ also corresponds to the mechanical work done in bringing the loop into the field. The total force on the loop is zero only in a uniform field; in a nonuniform field there are net forces on a current loop. In putting the loop into a region with a field, we must have gone through places where the field was not uniform, and so work was done. To make the calculation simple, we shall imagine that the loop is brought into the field with its moment pointing along the field. (It can be rotated to its final position after it is in place.) Imagine that we want to move the loop in the $x$-direction—toward a region of stronger field—and that the loop is oriented as shown in Fig. 15–2. We start somewhere where the field is zero and integrate the force times the distance as we bring the loop into the field. First, let’s compute the work done on each side separately and then take the sum (rather than adding the forces before integrating). The forces on sides $3$ and $4$ are at right angles to the direction of motion, so no work is done on them. The force on side $2$ is $IbB(x)$ in the $x$-direction, and to get the work done against the magnetic forces we must integrate this from some $x$ where the field is zero, say at $x=-\infty$, to $x_2$, its present position: \begin{equation} \label{Eq:II:15:6} W_2=-\int_{-\infty}^{x_2}F_2\,dx=-Ib\int_{-\infty}^{x_2}B(x)\,dx. \end{equation}  Similarly, the work done against the forces on side $1$ is \begin{equation} \label{Eq:II:15:7} W_1=-\int_{-\infty}^{x_1}F_1\,dx=Ib\int_{-\infty}^{x_1}B(x)\,dx. \end{equation}  To find each integral, we need to know how $B(x)$ depends on $x$. But notice that side $1$ follows along right behind side $2$, so that its integral includes most of the work done on side $2$. In fact, the sum of (15.6) and (15.7) is just \begin{equation} \label{Eq:II:15:8} W=-Ib\int_{x_1}^{x_2}B(x)\,dx. \end{equation}  But if we are in a region where $B$ is nearly the same on both sides $1$ and $2$, we can write the integral as \begin{equation*} \int_{x_1}^{x_2}B(x)\,dx=(x_2-x_1)B=aB, \end{equation*}  where $B$ is the field at the center of the loop. The total mechanical energy we have put in is \begin{equation} \label{Eq:II:15:9} U_{\text{mech}}=W=-Iab\,B=-\mu B. \end{equation}  The result agrees with the energy we took for Eq. (15.4). We would, of course, have gotten the same result if we had added the forces on the loop before integrating to find the work. If we let $B_1$ be the field at side $1$ and $B_2$ be the field at side $2$, then the total force in the $x$-direction is \begin{equation*} F_x=Ib(B_2-B_1). \end{equation*}  If the loop is “small,” that is, if $B_2$ and $B_1$ are not too different, we can write \begin{equation*} B_2=B_1+\ddp{B}{x}\,\Delta x=B_1+\ddp{B}{x}\,a.\notag \end{equation*}  So the force is \begin{equation} \label{Eq:II:15:10} F_x=Iab\,\ddp{B}{x}. \end{equation}  The total work done on the loop by external forces is \begin{equation*} -\int_{-\infty}^xF_x\,dx=-Iab\int\ddp{B}{x}\,dx=-IabB, \end{equation*}  which is again just $-\mu B$. Only now we see why it is that the force on a small current loop is proportional to the derivative of the magnetic field, as we would expect from \begin{equation} \label{Eq:II:15:11} F_x\,\Delta x=-\Delta U_{\text{mech}}=-\Delta(-\FLPmu\cdot\FLPB). \end{equation}  Our result, then, is that even though $U_{\text{mech}}=-\FLPmu\cdot\FLPB$ may not include all the energy of a system—it is a fake kind of energy—it can still be used with the principle of virtual work to find the forces on steady current loops.