Divergence theorem (source code)

= Divergence theorem
{wiki}

= Gauss theorem
{c}
{synonym}

Let $V$ be a bounded region in <Euclidean space> with piecewise smooth boundary and outward <unit normal vector> $n$. For a continuously differentiable <vector field> $F$ on a neighborhood of its closure,
$$
\int_V\nabla\cdot F\,dV=\int_{\partial V}F\cdot n\,dS.
$$
The total outward <flux> equals the accumulated <divergence> inside. Contributions across shared internal faces cancel when a region is divided into small pieces.

For $F=(x,y,z)$ on a ball of radius $R$, the divergence is $3$, giving $3(4\pi R^3/3)=4\pi R^3$. On the boundary, $F\cdot n=R$, so the <surface integral> is also $R(4\pi R^2)=\boxed{4\pi R^3}$. This agreement turns the derivative into a geometric flux measurement. The required regularity matters: a singular field at the center cannot be included without checking its contribution separately.