(d) Both the magnets are placed in the field of one another, hence potential energy of dipole (2) is
$U_{2} = - M_{2}B_{1}\cos 0 = - M_{2}B_{1} = M_{2} \times \frac{\mu_{0}}{4\pi}.\frac{2M_{1}}{r^{3}}$
By using $F = - \frac{dU}{dr},$ force on magnet (2) is
$F_{2} = - \frac{dU_{2}}{dr} = - \frac{d}{dr}\left( \frac{\mu_{0}}{4\pi}.\frac{2M_{1}M_{2}}{r^{3}} \right) = - \frac{\mu_{0}}{4\pi}.6\frac{M_{1}M_{2}}{r^{4}}$
It can be proved that $\left| F_{1} \right| = \left| F_{2} \right| = F = \frac{\mu_{0}}{4\pi}.\frac{6M_{1}M_{2}}{r^{4}}$
$\Rightarrow F \propto \frac{1}{r^{4}}$