Step 1: Determine initial magnetic potential energy. The magnetic potential energy \( U \) of a magnetic dipole in a magnetic field is \( U = -\vec{M} \cdot \vec{B} \). When the loop's plane is perpendicular to \( \vec{B} \), \( \vec{M} \) aligns with \( \vec{B} \), resulting in initial potential energy \( U_i = -M B \).
Step 2: Calculate final magnetic potential energy. After rotating the loop by 45 degrees, the angle \( \theta \) between \( \vec{M} \) and \( \vec{B} \) becomes \( 45^\circ \). Since \( \cos(45^\circ) = \frac{\sqrt{2}}{2} \), the final potential energy \( U_f \) is:
\[ U_f = -MB \cos(45^\circ) = -MB \frac{\sqrt{2}}{2} \]
Step 3: Compute work done. The work done \( W \) in rotating the dipole equals the change in potential energy:
\[ W = U_f - U_i = \left(-MB \frac{\sqrt{2}}{2}\right) - (-MB) \]
\[ W = MB \left(1 - \frac{\sqrt{2}}{2}\right) \]
Using \( \sqrt{2} \approx 1.414 \), this simplifies to:
\[ W = MB \left(1 - 0.707\right) \]
\[ W = MB (0.293) \]
For simplification and clarity in answer choices, this can be approximated as:
\[ W \approx 0.3 MB \]