Regarding the notion of having zero divergence everywhere

vector analysis

If a vector field has zero divergence at all points in space, then according to Divergence theorem, the outward flux through the surface enclosing any volume in this space should be zero. Electric field has zero divergence everywhere. Yet the flux through any surface is given by Gauss law. I know I am making a mistake somewhere but I am not able find it out. Could someone help me find the mistake I am making?

Best Answer

I think some confusion can arise when using the divergence theorem to treat, say, a point particle. Consider the force field

\begin{equation*} \mathbf{F} = \frac{\hat{\mathbf{r}}}{r^{2}}. \end{equation*}

Just calculating the divergence, as you say, does yield zero

\begin{equation*} \nabla \cdot \mathbf{F} = \frac{1}{r^{2}}\frac{\partial}{\partial r}\left(r^{2}\cdot\frac{1}{r^{2}}\right) = 0. \end{equation*}

But if we pick a sphere centered at the origin, we have the surface integral

\begin{equation*} \iint{\mathbf{F}\cdot\hat{\mathbf{n}}\,\mathrm{d}S} = 4\pi \end{equation*}

so the divergence theorem, which says that

\begin{equation*} \iint{\mathbf{F}\cdot\hat{\mathbf{n}}\,\mathrm{d}S} = \iiint{\nabla\cdot\mathbf{F}\,\mathrm{d}V} \end{equation*}

seems to fail.

The problem is that $\nabla\cdot\mathbf{F}$ is zero everywhere except at the origin. To correctly define the divergence of $\mathbf{F}$, we need to write

\begin{equation*} \nabla\cdot\left(\frac{\hat{\mathbf{r}}}{r^{2}}\right) = 4\pi\delta^{3}(\mathbf{r}). \end{equation*}

This way, we obtain

\begin{equation*} \iiint{\nabla\cdot\mathbf{F}\,\mathrm{d}V} = \iiint{4\pi\delta^{3}(\mathbf{r})\,\mathrm{d}V} = 4\pi, \end{equation*}

and the divergence theorem holds after all.

(Actually, the divergence theorem together with the fact that the surface integral is $4\pi$ implies the form of the divergence of $\mathbf{F}$, just to keep the logic correct.)