# Divergence of electric field for point charge at origin

I'm aware that I've likely made a very simple error/misunderstanding here, but I have some confusion about the divergence of an electric field of a point charge which should be zero at all points in space asides from the location of the charge. When I try to determine the divergence at some points I don't see the divergence becoming zero.

Suppose there's a stationary point charge $$q$$ at the origin of a cartesian system. Now consider a point on the x-axis. The electric field due to a this charge is $$E= \frac{kq}{r^2}\hat r$$. Here $$\hat r$$ and $$\hat x$$ point in the same direction and it seems that the field in the $$y, z$$ directions should be 0. So then $$E=\frac{kq}{x^2}\hat x$$, at least in the positive direction (the fact that this doesn't work for negative $$x$$ seems to suggest to me there might already be an issue). Taking the divergence (only x-component is nonzero) $$\frac{\partial E_x }{\partial x} = \frac{-2kq}{x^3}\neq0$$.

Is there some issue with applying the idea of 0 divergence of the electric field in fewer dimensions, or did I make a straightforward error somewhere?

Careful, the fact that two functions coincide at a point that they must share the same derivatives. The correct theorem is that they need to coincide in a neighborhood.

You made this mistake here. Your formula: $$\vec E\propto \frac{\hat x}{x^2}$$ is only valid on the real axis. As soon as you deviate from it, it is false, so it is hardly surprising that it gives the wrong partial derivatives (note that only the $$x$$ partial derivative is accurate though).

You should rather use the correct formula in cartesian coordinates: $$\vec E\propto \frac{1}{\sqrt{x^2+y^2+z^2}^3}(x\hat x+y\hat y+z\hat z)$$ which will give the correct vanishing divergence away from the origin.

Perhaps you know this already, but it is easier to apply the divergence formula in spherical coordinates. This simplifies the computation, with the same caveat that it is only applicable away from the origin.

Hope this helps.

• Thanks, corrected.
– LPZ
Commented Mar 28, 2023 at 0:31

You need to do the approximations more carefully. Especially you must not totally neglect $$E_y$$ and $$E_z$$.

Considering points near to the $$x$$-axis means you have $$y\ll x$$ and $$z\ll x$$. You need to calculate an approximation for $$\frac{1}{r^2}\hat{r}$$ (Taylor expansion around $$y=0$$ and $$z=0$$). I recommend you do these calculations by yourself. You may neglect terms proportional to $$y^2$$, $$z^2$$ and $$yz$$, but you need to keep terms proportional to $$y$$ and $$z$$. You will finally get: $$E_x \approx \frac{kq}{x^2},\quad E_y \approx \frac{kqy}{x^3}, \quad E_z \approx \frac{kqz}{x^3}$$

With these you get $$\frac{\partial E_x}{\partial x} +\frac{\partial E_y}{\partial y} +\frac{\partial E_z}{\partial z}=0$$ as it should be. Notice that $$E_y$$ and $$E_z$$ are $$0$$ on the $$x$$-axis, but their derivatives are not.