Solution (source code)

= Solution

The differential vacuum <Gauss's law> is
$$
\boxed{\nabla\cdot\mathbf E=\rho_{\rm vol}/\epsilon_0}.
$$
Integrate over a volume $\Omega$ with closed boundary $S$. The <divergence theorem> converts the left side into outward electric <flux>:
$$
\oint_S\mathbf E\cdot\hat{\mathbf n}\,dS=\int_\Omega\nabla\cdot\mathbf E\,dV=\frac1{\epsilon_0}\int_\Omega\rho_{\rm vol}\,dV=\boxed{\frac{Q_{\rm enc}}{\epsilon_0}}.
$$
This is the integral form. Surface charge can be treated by a thin-layer limit or by the corresponding jump in the normal field; the enclosed charge then includes the charged sheet. The surface orientation must be outward, and the field entering the integral is the total field, not merely the field of the enclosed charges alone.