Let $V'$ be the volume of dipole distribution and $S'$ be the boundary.
The potential of a dipole distribution at a point $P$ is:
$$\psi=-k \int_{V'} \dfrac{\vec{\nabla'}.\vec{M'}}{r}dV' +k \oint_{S'}\dfrac{\vec{M'}.\hat{n}}{r}dS'$$
If $P\in V'$ and $P\in S'$, the integrand is discontinuous (infinite) at the point $r=0$. If we use spherical and polar coordinates, the integrand is continuous everywhere:
\begin{align} \psi &=\bbox[orange,5px]{-k \int_{V'} \dfrac{\vec{\nabla'}.\vec{M'}}{r} r^2 \sin \theta\ d\theta\ d\phi\ dr}\\ &\bbox[pink,5px]{+k\oint_{S'_1} \dfrac{\vec{M'}.\hat{n}}{r} \sqrt{{f_x}^2+{f_y}^2+1}\ R\ dR\ d\theta'} \bbox[yellow,5px]{+ k \oint_{S'_2}\dfrac{\vec{M'}.\hat{n}}{r}dS'}\\ &=\bbox[orange,5px]{-k \int_{V'} \vec{\nabla'}.\vec{M'}\ r \sin \theta\ d\theta\ d\phi\ dr}\\ &\bbox[pink,5px] {+ k \oint_{S'_1} \vec{M'}.\hat{n}\ \sqrt{{f_x}^2+{f_y}^2+1}\ \dfrac{R}{\sqrt{R^2+f^2}} dR\ d\theta'} \bbox[yellow,5px] {+ k \oint_{S'_2}\dfrac{\vec{M'}.\hat{n}}{r}dS'} \end{align}
The field of a dipole distribution at a point $P$ is:
$$\nabla\psi=-k \int_{V'} (\vec{\nabla'}.\vec{M'})\ \nabla \left( \dfrac{1}{r} \right) dV' +k \oint_{S'} (\vec{M'}.\hat{n}) \nabla \left( \dfrac{1}{r} \right) dS'$$
If $P\in V'$ and $P\in S'$, the integrand is discontinuous (infinite) at the point $r=0$. If we use spherical and polar coordinates:
\begin{align} \nabla\psi&=\bbox[orange,5px]{-k \int_{V'} (\vec{\nabla'}.\vec{M'})\ \left( \dfrac{\hat{r}}{r^2} \right) r^2 \sin \theta\ d\theta\ d\phi\ dr}\\ &\bbox[pink,5px]{+ k \oint_{S'_1} (\vec{M'}.\hat{n}) \left( \dfrac{\hat{r}}{r} \right) \sqrt{{f_x}^2+{f_y}^2+1}\ \dfrac{R}{\sqrt{R^2+f^2}} dR\ d\theta'} \bbox[yellow,5px] {+ k \oint_{S'_2}\dfrac{\vec{M'}.\hat{n}}{r}dS'} \end{align}
The first term has the integrand continuous everywhere. The second term has the integrand discontinuous (infinite) at the point $r=0$.
Question:
Is it necessary to remove a small circle around $R=0$ in order to remove the singularity in the second term so that we can compute the integral? Then how shall we show that the second term of $\nabla \psi$ is convergent after removing a small circle around $R=0$ and then taking the limit as the radius of the small circle tends to zero?
