As we know that, work done in rotating a magnetic dipole in magnetic field is,
W=MB(cos(θ1)−cos(θ2))...(1)
Now in the above given question we have, Magnetic Moment (M)=10−2i^Am2,Magnetic Field=Bi^cos(ωt) with B=1T , ω=0.125rads−1 and t=1s
Let initial angle (θ1)=0∘ so on reversing the direction of magnetic moment final angle (θ2)=180∘
Now, substituting all the values in equation (1) we get,
⇒W=10−2×(1)cos(0.125×1)(cos(0∘)−cos(180∘))
⇒W=10−2cos(0.125)(1−(−1))(∵cos(0∘)=1andcos(180∘)=−1)
⇒W=2×10−2×0.99
⇒W≈0.02J
Therefore, the work done in reversing the direction of the magnetic moment is 0.02J.