Divergence of electric field for point charge at origin

electricityVector Fields

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?

Best Answer

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.

Related Question