Thank you for reporting, we will resolve it shortly
Q.
Two short magnets placed along the same axis with their like poles facing each other repel each other with a force which varies inversely as
Magnetism and Matter
Solution:
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^{\circ}=-M_{2} B_{1}$
$=M_{2} \times \frac{\mu_{0}}{4 \pi} \cdot \frac{2 M_{1}}{r^{3}}$
By using $F=-\frac{d U}{d r}$, force on magnet $(2)$ is
$F_{2}=-\frac{d U_{2}}{d r}=-\frac{d}{d r}\left(\frac{\mu_{0}}{4 \pi} \cdot \frac{2 M_{1} M_{2}}{r^{3}}\right)$
$=-\frac{\mu_{0}}{4 \pi} \cdot 6 \frac{M_{1} M_{2}}{r^{4}}$
It can be proved $\left| F_{1}\right|=\left| F_{2}\right|=F$
$=\frac{\mu_{0}}{4 \pi} \cdot \frac{6 M_{1} M_{2}}{r^{4}}$
$\Rightarrow F \propto \frac{1}{r^{4}}$