Step 1: Understanding the magnetic potential energy.
The potential energy \( U \) of a magnetic dipole in a magnetic field is given by \( U = -\vec{M} \cdot \vec{B} \). Initially, the plane of the loop is normal to \( \vec{B} \), meaning \( \vec{M} \) is aligned with \( \vec{B} \), so the initial potential energy is \( U_i = -M B \).
Step 2: Calculating the final potential energy.
When the loop is rotated by 45 degrees, the angle \( \theta \) between \( \vec{M} \) and \( \vec{B} \) changes to \( 45^\circ \). The cosine of 45 degrees is \( \cos(45^\circ) = \frac{\sqrt{2}}{2} \). Thus, the final potential energy \( U_f \) becomes:
\[ U_f = -MB \cos(45^\circ) = -MB \frac{\sqrt{2}}{2} \]
Step 3: Calculating the work done.
The work done \( W \) in rotating the dipole is 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) \]
Given \( \sqrt{2} \approx 1.414 \), this simplifies to:
\[ W = MB \left(1 - 0.707\right) \]
\[ W = MB (0.293) \]
Approximating for simplicity and clarity in the answer choices:
\[ W \approx 0.3 MB \]