The figure below shows a current loop carrying current I. The

loop is made of rectangular and semicircular sections with
dimensions as shown. The loop lies in the xy-plane.
An external magnetic field is applied B = Bx i + Bz k.
Determine the torque (if any) around the axis labeled AB. If
there is torque, in which direction would the loop tend to
rotate?
Deduce (i.e. without full solution) the answer if the axis of
rotation is the horizontal segment of the loop.

To determine the torque exerted on the loop around the axis labeled AB, we can use the formula:

τ = μ x B,

where τ is the torque, μ is the magnetic moment, and B is the external magnetic field.

The magnetic moment μ of a current loop is given by:

μ = I * A * n,

where I is the current, A is the area enclosed by the loop, and n is a vector perpendicular to the loop's plane, pointing in the direction according to the right-hand rule.

In this case, the loop consists of rectangular and semicircular sections, so let's find the magnetic moment for each section separately and then add them up.

For the rectangular section, the area A is given by A = l * w, where l is the length of the rectangle, and w is its width. The vector n is perpendicular to the loop's plane and points in the positive z-direction.

For the semicircular section, the area A is given by A = (1/2) * π * r^2, where r is the radius of the semicircle. The vector n is perpendicular to the loop's plane and points in the negative z-direction.

Once we have the magnetic moments for both sections, we can add them up to find the total magnetic moment μ of the loop.

Finally, we can calculate the torque τ by taking the cross product of μ and B.

Now, as for determining the direction of rotation if the axis of rotation is the horizontal segment of the loop, we need to consider the right-hand rule for torque. If you place your right hand along the horizontal segment of the loop, with your fingers pointing in the direction of the current, your thumb will point in the direction of the torque.