Assume a Gaussian surface in a non-uniform electric field that is directed along X-axis. Say the field is getting weaker as we go along positive X direction and it's constant along Y and Z directions. Then, if the Gaussian surface is a cube and charge enclosed is zero, the electric flux coming into the surface is more than that flowing out. So, shouldn't the net electric flux be non-zero contradicting Gauss's law?

Does it mean such an electric field is impossible without a charge being distributed along the path?


1 Answer 1


Your question contains a contradiction. Basically the last sentence of your question is completely right. If $\mathbf{E}=f(x)\hat{x}$, then $$ \frac{\rho}{\epsilon_0}=\nabla\cdot\mathbf{E}=f'(x)\neq 0 $$ So in order to have an electric field that is only in the $\hat{x}$ direction and changes in magnitude with $x$, there must be charge present. With this electric field, Gaussian surfaces have nonzero flux because there is charge inside of them.

If there is no charge in a Gaussian surface, the net flux through it is zero, and this electric field is not possible. This is an absolute law. There are no exceptions.

This question reminds me of this other one, where OP thought they could specify the charge on a conductor and the voltage. Just like in that situation, the electric field (or rather the divergence of the electric field) is determined by the charge. You cannot freely choose any electric field and separately say there is no charge present.

  • 2
    $\begingroup$ It's worth pointing out that the equation you use is actually also Gauss's Law, but in differential form. $\endgroup$
    – The Photon
    May 8, 2023 at 18:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.