# Is there a higher-level reason why $\nabla\cdot(\hat{\bf r}/r^2) = 0$ in three dimensions but not two? [duplicate]

I am working through Griffiths, Introduction to Electrodynamics, and finding the divergence of the electric field generated by a single charge sitting at the origin.

$$\mathbf{E}(\mathbf{r}) = \frac{\hat{\bf r}}{|\mathbf{r}|^2}$$

I compute $$\nabla \cdot \mathbf{E}$$ and get 0. This seems very surprising -- I wouldn't have expected it, but the factors cancel out just so.

Sometimes, the book uses two-dimensional drawings, so I assumed that everything would be mostly the same in two dimensions. But to my surprise, it's not -- if I use only two dimensions and compute $$\nabla \cdot \mathbf{E}$$, I don't get zero.

$$\nabla \cdot \mathbf{E} = \frac{\partial}{\partial x}\left(\frac{x}{(x^2 + y^2)^{3/2}}\right) + \frac{\partial}{\partial y}\left(\frac{y}{(x^2 + y^2)^{3/2}}\right) \ne 0$$

Why is this? It seems like such a coincidence that we live in three dimensions, and three dimensions is also where this divergence works out to be zero.

Possible explanations:

• I know vaguely that the inverse square law is related to three dimensions; if I had to summarize my understanding it would be roughly "if you want conservation of energy to work out in three dimensions, you need the force to go as the inverse of the square rather than e.g. as the inverse or the inverse of the cube". Is this related?

## marked as duplicate by Qmechanic♦Oct 30 '18 at 4:25

• I don't think this relates to energy conservation, but maybe I'm missing something. Can you explain why you think energy conservation is relevant here, and why you think the inverse square law only works in 3D? Also note that for your 3D case the divergence is technically $\delta(\vec r)$. – Aaron Stevens Oct 30 '18 at 2:56
• Possible duplicates: physics.stackexchange.com/q/93/2451 , physics.stackexchange.com/q/47084/2451 and links therein. – Qmechanic Oct 30 '18 at 3:20

In $$D$$-dimensional space, the Gauss law says $$\nabla\cdot\mathbf{E}\propto\rho$$, where $$\rho$$ is the charge density. This is a straightforward generalization of the $$D=3$$ case, with a $$D$$-component gradient $$\nabla$$ and a $$D$$-component electric field $$\mathbf{E}$$.
(The appropriate $$D$$-dimensional generalization of the whole set of Maxwell's equations is more interesting, but I won't go into that here.)
Even though the Gauss law itself doesn't look any different in $$D$$-dimensional space except for the number of components, the solution of the Gauss law depends on $$D$$ in an interesting way. In the case of a point charge, the Gauss law is $$\nabla\cdot\mathbf{E}(\mathbf{r})\propto\delta(\mathbf{r})$$, and the solution is $$\mathbf{E}(\mathbf{r})\propto\frac{\mathbf{r}}{|\mathbf{r}|^D}.$$ This is the $$D$$-dimensional version of Coulomb's law. When $$D=3$$, this agrees with your first equation. For any $$D\geq 1$$, this satisfies $$\nabla\cdot\mathbf{E}(\mathbf{r})=0 \hskip2cm \text{for all }\mathbf{r}\neq 0.$$ Your calculation in two dimensions confirms that the $$D=3$$ version does not work in two-dimensional space. The $$D=2$$ version does. Here's the calculation: \begin{align*} \nabla\cdot\frac{\mathbf{r}}{|\mathbf{r}|^D} &= \frac{\nabla\cdot\mathbf{r}}{|\mathbf{r}|^D} - D\frac{\mathbf{r}}{|\mathbf{r}|^{D+1}}\cdot\nabla |\mathbf{r}| \\ &= \frac{D}{|\mathbf{r}|^D} - D\frac{\mathbf{r}}{|\mathbf{r}|^{D+1}}\cdot\frac{\mathbf{r}}{|\mathbf{r}|} \\ &= 0 \ \text{ whenever }\mathbf{r}\neq 0. \end{align*}
• Thanks Dan! So it sounds like you're saying that, starting from Gauss's Law, we can derive that we must have an inverse power law where the power is $D - 1$. But my understanding is that the inverse square law is the experimental fact, and Gauss's Law is derived. Isn't it surprising that it works out so we have Gauss's Law? Is there any deeper "why" here? – Eli Rose Oct 31 '18 at 4:33