Verify the Gauss's law for the magnetic field of a point dipole of dipole moment m at the origin for the surface which is a sphere of radius R.

Hint: Use Gauss' law.
Step 1: Let us draw the figure for the given situation.

We have to prove that $\oint \mathrm{B}\cdot \mathrm{dS}=0$. This is called Gauss's law in magnetization.
According to the question, the magnetic moment of the dipole at origin O is;
Let P be a point at distance r from O and OP makes an angle $\mathrm{\theta }$ with the z-axis.
Component of M along OP= M cos $\mathrm{\theta }$.
Now, the magnetic field induction at P due to the dipole of moment Mcos$\mathrm{\theta }$ is:
From the diagram, r is the radius of the sphere with center at O lying in the yz-plane. Take an elementary area dS of the surface at P. Then,
$\begin{array}{l}dS=r\left(r\mathrm{sin}\theta d\theta \right)\stackrel{^}{r}={r}^{2}\mathrm{sin}\theta d\theta \stackrel{^}{r}\\ \oint B.dS=\oint \frac{{\mu }_{0}}{4\pi }\frac{2M\mathrm{cos}\theta }{{r}^{3}}\stackrel{^}{r}\left({r}^{2}\mathrm{sin}\theta d\theta \stackrel{^}{r}\right)\\ =\frac{{\mu }_{0}}{4\pi }\frac{M}{r}{\int }_{0}^{2\pi }2\mathrm{sin}\theta .\mathrm{cos}\theta d\theta \\ =\frac{{\mu }_{0}}{4\pi }\frac{M}{r}{\int }_{0}^{2\pi }\mathrm{sin}2\theta d\theta \\ =\frac{{\mu }_{0}}{4\pi }\frac{M}{r}\left(\frac{-\mathrm{cos}2\theta }{2}{\right)}_{0}^{2\pi }\\ =-\frac{{\mu }_{0}}{4\pi }\frac{M}{2r}\left[\mathrm{cos}4\pi -\mathrm{cos}0\right]\\ =\frac{{\mu }_{0}}{4\pi }\frac{M}{2r}\left[1-1\right]=0\end{array}$