Why is the divergence of this vector field 0? And why can't I prove it using the divergence theorem?

This is a question from Stuart Calculus 7ed, section 16.9:

"Verify that $${\rm div}({\bf E})=0$$ for the electric field $${\bf E}=\frac{\epsilon Q}{\|\bf x\|^{3}}{\bf x}$$ ."

We can rewrite: $${\bf E}=\epsilon Q\frac{x}{(x^2+y^2+z^2)^{3/2}}{\bf i}+\epsilon Q\frac{y}{(x^2+y^2+z^2)^{3/2}}{\bf j}+\epsilon Q\frac{z}{(x^2+y^2+z^2)^{3/2}}{\bf k}$$

It's easy to prove it using the definition of divergence

$${\rm div}({\bf E})=\nabla \boldsymbol{\cdot}{\bf E}=\frac{\partial}{\partial x}\frac{\epsilon Qx}{(x^2+y^2+z^2)^{3/2}}+\frac{\partial}{\partial y}\frac{\epsilon Qy}{(x^2+y^2+z^2)^{3/2}}+\frac{\partial}{\partial z}\frac{\epsilon Qz}{(x^2+y^2+z^2)^{3/2}}=\epsilon Q\frac{3(x^2+y^2+z^2)-3x^2-3y^2-3z^2}{(x^2+y^2+z^2)^{5/2}}=0$$

I found this to be a weird result, given that this is the plotted vector field, and it very clearly "diverges" (as in the all vectors point outward) from the origin. Am I misinterpretating the vector plot or the definition of divergence?

I also tried to prove it using the divergence theorem.

Let S be the surface of a sphere of radius 1 with normal vector n, and R the region limited by this sphere. From the divergence theorem:

$$\iint _{S}\left({\bf E}\boldsymbol{\cdot} {\bf n}\right)dS=\iiint _{R}\left( \nabla\boldsymbol{\cdot}{\bf E}\right)dV$$

$$\nabla\boldsymbol{\cdot}{\bf E}=0 \therefore \iiint _{R}\left( \nabla\boldsymbol{\cdot}{\bf E}\right)dV=0 \therefore \iint _{S}\left({\bf E}\boldsymbol{\cdot} {\bf n}\right)dS=0$$

However, I solved the surface integral and found the result $$4\pi \epsilon Q$$. Am I just making a mistake? I can't figure it out where the mistake is in my solving process.

• Its divergence is $0$ everywhere except the origin because the divergence before subtracting all of the terms was not defined there. The divergence for that vector field can be defined as a Dirac delta at the origin. Commented Apr 23, 2020 at 21:27
You didn’t make a mistake. The mistake is in the sloppy problem statement. It should say that you should prove that the divergence is $$0$$ except at the origin. The divergence of the electric field is proportional to the charge density, so for a point charge it’s a delta distribution at the origin. So there’s no contradiction between your two results: Away from the singularity at the origin, the divergence is $$0$$, but if you integrate the flux over a surface that encloses the origin you pick up the delta contribution from the singularity at the origin.
Divergence is the extent to which the fields acts locally as if radiating from a point there. A point charge's electric field only behaves as such at that point. That's the obvious intuition. We want something that can integrate over space to a finite non-zero value, yet vanish except at one point, so it will have to be proportional to the Dirac delta. The proportionality constant will be whatever makes the surface integral come out right. Indeed, $$\mathbf{\nabla}\cdot\mathbf{E}=4\pi\epsilon Q\delta^{(3)}(\mathbf{x})$$.