At stable equilibrium U=−mBcos0∘=−mB
At unstable equilibrium $\begin{aligned}
& \mathrm{U}=-\mathrm{mB} \cos 180^{\circ}=+\mathrm{mB} \
& \mathrm{W}=\Delta \mathrm{U} \
& \text { W.D. }=2 \mathrm{mB} \
& =2(0.5) 8 \times 10^{-2}=8 \times 10^{-2} \mathrm{~J}
\end{aligned}$