# Is the divergence of electric field in a solid cube of uniform charge density position dependent?

Within a solid, uniformly charged non-conducting cube, the electric field is clearly position dependent, does that make the divergence of the electric field position dependent as well? If that is the case how does one reconcile it with the differential form of Gauss's law that relates the divergence of the electric field and the charge distribution? A special case to consider would be at the center of the aforementioned cube, the electric field at the center is zero(due to symmetry) but the divergence of the electric field is not because the charge distribution everywhere within the cube is non-zero.

• Welcome to Physics! I'm not clear exactly what your question is, though. The divergence of the electric field is equal to $\rho/\epsilon_0$, which is position-dependent (it's zero outside the cube and non-zero inside the cube.) But it looks like you already knew that. Can you elaborate on what aspect of the situation you're confused about? Commented Sep 29, 2021 at 12:20
• I want to know what the divergence is at the center of a uniformly charged cube, the electric field is zero but the divergence given by ρ/ϵ0 clearly isn't , if the electric field is zero at the center, i.e. non-existent how is it that the divergence at that point has a non-zero value ? Commented Sep 29, 2021 at 12:25

The reason that we can have $$\vec{E} = 0$$ at the center of the cube but $$\vec{\nabla} \cdot \vec{E} \neq 0$$ is the same reason that we can have a function $$f(x)$$ that vanishes at $$x_0$$ but for which $$f'(x_0) \neq 0$$. The two pieces of information are not incompatible.
If you recall, the divergence of $$\vec{E}$$ is defined as $$\vec{\nabla} \cdot \vec{E} = \frac{\partial E_x}{\partial x} + \frac{\partial E_y}{\partial y} + \frac{\partial E_z}{\partial z}.$$ If we look at the first term here, it corresponds to the rate of change of $$E_x$$ with respect to $$x$$ near the center of the cube. If we imagine starting at the center of the cube and moving away from it along the $$x$$-axis, we will see that $$E_x$$ increases along this line; after all, near the center, we would expect the electric field to be small but to point away from the center. So it should seem plausible (at least) that $$\partial E_x/\partial x \neq 0$$. Similar arguments hold for the $$y$$- and $$z$$-directions.
Finally, note that the same "paradox" happens for a solid sphere of charge: we have $$\vec{E} = 0$$ and $$\vec{\nabla} \cdot \vec{E} \neq 0$$ at its center as well. The resolution there is exactly the same.