29.3. THE DIVERGENCE THEOREM 575

Note that this only requires that ∂V be piecewise continuous. As discussed earlier, theedges end up not contributing to the surface integral. The divergence theorem holds formuch more general regions than this. Suppose for example you have a complicated regionwhich is the union of finitely many disjoint regions of the sort just described which arecylindrical in each of the coordinate directions. Then the volume integral over the unionof these would equal the sum of the integrals over the disjoint regions. If the boundariesof two of these regions intersect, then the area integrals will cancel out on the intersectionbecause the unit exterior normals will point in opposite directions. Therefore, the sum ofthe integrals over the boundaries of these disjoint regions will reduce to an integral over theboundary of the union of these. Hence the divergence theorem will continue to hold. Forexample, consider the following picture. If the divergence theorem holds for each Vi in thefollowing picture, then it holds for the union of these two.

V1 V2

General formulations of the divergence theorem involve Hausdorff measures and theLebesgue integral, a better integral than the old fashioned Riemannn integral which hasbeen obsolete now for almost 100 years. In general, one finds that the conclusion of thedivergence theorem is usually true and the theorem can be used with confidence. Minormodifications show that the divergence theorem holds in any dimension. In particular, itholds in two dimensions. In two dimensions, the dS refers to length and the dV refersto area dxdy. In four dimensions, the dS would refer to three dimensional area usingdS =

√1+ψ2

x1+ψ2

x2+ψ2

x3dx1dx2dx3 or something involving another subset of the four

variables on the ends.

Example 29.3.5 Let V = [0,1]× [0,1]× [0,1]. That is, V is the cube in the first octanthaving the lower left corner at (0,0,0) and the sides of length 1. Let F (x,y,z) = xi+yj+zk. Find the flux integral in which n is the unit exterior normal.∫

∂VF ·ndS

You can certainly inflict much suffering on yourself by breaking the surface up into 6pieces corresponding to the 6 sides of the cube, finding a parametrization for each face andadding up the appropriate flux integrals. For example, n= k on the top face and n=−kon the bottom face. On the top face, a parametrization is (x,y,1) : (x,y)∈ [0,1]× [0,1]. Thearea element is just dxdy. It is not really all that hard to do it this way but it is much easierto use the divergence theorem. The above integral equals∫

Vdiv(F )dV =

∫V

3dV = 3.

Example 29.3.6 This time, let V be the unit ball,{(x,y,z) : x2 + y2 + z2 ≤ 1

}and let

F (x,y,z) = x2i+ yj+ (z−1)k.

Find∫

∂V F ·ndS.