The divergence theorem is a theorem in vector calculus which relates the surface integral to the divergence inside the surface. Mathematically, it is stated as
where D is the volume of the region enclosed by the surface and S is the projection of the surface onto the plane.
The divergence theorem holds in other dimensions as well; for example, for a flux integral in two dimensions, the divergence theorem becomes
which is a version of Green's theorem.