Solution (source code)

= Solution

<Gauss's law> states
$$
\boxed{\oint_{\partial V}\mathbf E\cdot d\mathbf A=\frac{Q_{\rm enc}}{\epsilon_0},\qquad
\nabla\cdot\mathbf E=\rho_e/\epsilon_0.}
$$
The surface is closed and oriented outward, and $Q_{\rm enc}$ includes all enclosed charge. The integral law follows from the local form through the <divergence theorem>. It is universally valid in classical electromagnetism, but calculating the field directly from the flux requires enough symmetry.

For spherical charge symmetry, $E(r)=Q(<r)/(4\pi\epsilon_0r^2)$. A uniform infinite line gives $E=\lambda/(2\pi\epsilon_0r)$ from a coaxial cylinder. An infinite sheet gives $E=\sigma/(2\epsilon_0)$ on either side from a pillbox, with the direction set by charge sign. The normal field jump is $\sigma/\epsilon_0$; the electrostatic field inside a conductor is zero. Zero enclosed charge implies zero net flux, not generally zero field. <University Physics Volume 2 by Samuel J. Ling and others>[Chapter6, Gaussian surfaces and symmetry applications]{ref}