Solution (source code)

= Solution

For a bounded volume $V$ with piecewise smooth closed boundary $S=\partial V$, and a continuously differentiable <vector field> $\mathbf F$ on a neighbourhood of $\overline V$, the <divergence theorem> states
$$
\boxed{\iint_S\mathbf F\cdot\hat{\mathbf n}\,dS=\iiint_V\nabla\cdot\mathbf F\,dV.}
$$
Here $\hat{\mathbf n}$ is the outward <unit normal vector>. The left side is the outward <flux>; the right side integrates the <divergence> over the enclosed volume.