The proof of the divergence theorem is very similar to the proof of Green's theorem. We start with very simple vector fields and domains, and then combine everything to get the general formula. Hence suppose that
\(D\) is an
\(xy\)-simple domain
\(D\subset\mathbb R^3\) with projection
\(D_0\) onto the
\(xy\)-plane. Moreover let
\(\varphi,\psi\) be smooth functions such that
\(D\) has the form
(12.1). Finally assume that
\begin{equation*}
\vect f=(0,0,f_3)\text{.}
\end{equation*}
We then compute the surface integral
\begin{equation*}
\int_{\partial D}\vect f\cdot\vect n\,dS\text{.}
\end{equation*}
The boundary of \(D\) can be written as the union of three surfaces, namely \(S_1:=\graph(\psi)\text{,}\) \(S_2:=\graph(\varphi)\) and the vertical pieces, \(S_3\text{.}\) Denote the unit normal vector to \(\partial D\) by \(\vect n=(n_1,n_2,n_3)\text{.}\) As \(n_3=0\) on \(S_3\) it follows that \(\vect f\cdot\vect n=f_3n_3=0\text{.}\) Hence
\begin{equation*}
\int_{S_3}\vect f\cdot\vect n\,dS
=\int_{S_3}f_3n_3\,dS=0
\end{equation*}
We next compute the integral over
\(S_1\text{.}\) According to
Proposition 9.32 we have
\begin{align*}
\int_{S_1}f_3n_3\,dS
\amp=\int_{S_1}\vect f\cdot\vect n\,dS\\
\amp=\iint_{D_0}f_3\bigl(x_1,x_2,\psi(x_1,x_2)\bigr)\,dx_1\,dx_2
\end{align*}
Using the same formula we get
\begin{align*}
\int_{S_2}f_3n_3\,dS
\amp=\int_{S_2}\vect f\cdot\vect n\,dS\\
\amp=-\iint_{D_0}f_3\bigl(x_1,x_2,\varphi(x_1,x_2)\bigr)\,dx_1\,dx_2,
\end{align*}
where the negative sign appears because \(S_2\) is oriented downwards. Adding up the three integrals we get
\begin{equation*}
\int_{\partial D}f_3n_3\,dS
=\iint_{D_0}f_3\bigl(x_1,x_2,\psi(x_1,x_2)\bigr)
-f_3\bigl(x_1,x_2,\varphi(x_1,x_2)\bigr)\,dx_1\,dx_2\text{.}
\end{equation*}
Setting \(g(x_3):=f_3(x_1,x_2,x_3)\) it follows from the fundamental theorem of calculus and the definition of partial derivatives that
\begin{align*}
f_3\bigl(x_1,x_2,\psi(x_1,x_2)\bigr)\amp-f_3\bigl(x_1,x_2,\varphi(x_1,x_2)\bigr)\\
\amp=g(\psi(x_1,x_2)\bigr)-g\bigl(\varphi(x_1,x_2)\bigr)\\
\amp=\int_{\varphi(x_1,x_2)}^{\psi(x_1,x_2)}\frac{d}{dx_3}g(x_3)\,dx_3\\
\amp=\int_{\varphi(x_1,x_2)}^{\psi(x_1,x_2)}\frac{\partial}{\partial x_3}f_3(x_1,x_2,x_3)\,dx_3
\end{align*}
If we substitute the above into the previous formula and apply Fubini's
Theorem 6.2 we get
\begin{align}
\int_{\partial D}f_3n_3\,dS
\amp=\iint_{D_0}\Bigl(\int_{\varphi(x_1,x_2)}^{\psi(x_1,x_2)}
\frac{\partial}{\partial x_3}f_3(x_1,x_2,x_3)\,dx_3\Bigr)\,dx_1\,dx_2\notag\\
\amp=\int_D\frac{\partial}{\partial x_3}f_3(\vect x)\,d\vect x\text{.}\tag{12.2}
\end{align}
If \(D\) is \(xz\)-simple we can apply the same procedure with \(x_1,x_2\) replaced by \(x_1,x_3\) and the vector field \(\vect f=(0,f_2,0)\text{.}\) Hence
\begin{equation}
\int_{\partial D}f_2n_2\,dS
=\int_D\frac{\partial}{\partial x_2}f_2(\vect x)n_2\,d\vect x\text{.}\tag{12.3}
\end{equation}
Likewise we get for a \(yz\)-simple domain and \(\vect f=(f_1,0,0)\) that
\begin{equation}
\int_{\partial D}f_1n_1\,dS
=\int_D\frac{\partial}{\partial x_1}f_1(\vect x)n_1\,d\vect x\text{.}\tag{12.4}
\end{equation}
Now assume that
\(D\) is simple. By definition
\(D\) is
\(xy\)-simple,
\(xz\)-simple and
\(yz\)-simple at the same time. Hence if
\(\vect f=(f_1,f_2,f_3)\) we can apply
(12.2) to
\((0,0,f_3)\text{,}\) then
(12.3) to
\((0,f_2,0)\) and finally
(12.4) to
\((f_1,0,0)\text{.}\) Adding up the three identities and using the definition of the divergence (see
Definition 11.3 we get
\begin{align*}
\int_{\partial D}\vect f\cdot\vect n\,dS
\amp=\int_{\partial D}f_1n_1+f_2n_2+f_3n_3\,dS\\
\amp=\int_D\frac{\partial}{\partial x_1}f_1(\vect x)
+\frac{\partial}{\partial x_2}f_2(\vect x)
+\frac{\partial}{\partial x_3}f_3(\vect x)\,d\vect x\\
\amp=\int_D\divergence\vect f\,d\vect x\text{.}
\end{align*}
This proves the divergence theorem for simple domains. If \(D\) is a domain which can be decomposed into simple domains then the integrals over all adjoining interior boundaries appear twice in opposite orientations. Hence the corresponding surface integrals have opposite signs and therefore cancel when we add them up over all sub-domains. Hence the Divergence Theorem follows.