(b) The work done in rotating the magnet through an angle $\theta$ in magnetic field B is given by
$W = \int_{0}^{\theta}{MH\ \sin\theta}d\theta$
$W = MB\left\lbrack - \cos\theta \right\rbrack\begin{matrix}
\theta \\
0
\end{matrix} = MB(\cos{0 - \cos\theta})$
$W = MB(1 - \cos\theta)$
Give, $M = 2JT^{- 1},\ B = 0.1T,\ \ \theta = 90{^\circ}$
$\therefore W = 2 \times 0.1 \times \left( 1 - \cos{90{^\circ}} \right) = 0.2\ J$