5.4 A short bar magnet of magnetic moment m = 0.32 JT–1 is placed in a uniform magnetic field of 0.15 T. If the bar is free to rotate in the plane of the field, which orientation would correspond to its (a) stable, and (b) unstable equilibrium? What is the potential energy of the magnet in each case?

Moment of the bar magnet, M=0.32 J T-1
External magnetic field, B=0.15 T
(a) The bar magnet is aligned along the magnetic field. This system is considered as being in stable equilibrium.
hence, the angle θ,  between the bar magnet
and the magnetic field is 0°.
Potential energy of the system =-MB cos θ
=-0.32×0.15 cos0°
=-4.8×10-2 J
(b) The bar magnet is oriented 180° to the magnetic field.
Hence, it is in unstable equilibrium.
θ=180°Potential energy  =-MB cos θ
=-0.32×0.15 cos180°
=4.8×10-2 J