
\section{The Divergence Theorem}

\begin{enumerate}[1.]




\item
{\it Compute the flux of the vector field ${\bf F}= x{\bf i}+y{\bf j} -x\kk $
out of a closed surface consisting of the part of the cylinder $x^2+y^2=4$ between the planes $z=0$ and $z=3$, together with the discs at the top and bottom, with the normal vector pointing outward.
}

\medskip

{\it Direct computation:} We write the flux integral as $\iint_{\mathcal{S}}= \iint_{\mathcal{S}_1}+ \iint_{\mathcal{S}_2}+ \iint_{\mathcal{S}_3}$, where $\mathcal{S}_1$ is the disc at the top, $\mathcal{S}_2$ is the disc at the bottom, and $\mathcal{S}_3$ is the surface of the cylinder.

\begin{itemize}
\item On $\mathcal{S}_1$, we have ${\bf N}=\kk$, so that 
$$
\iint_{\mathcal{S}_1}{\bf F}\cdot {\bf N}dS = \iint_{\mathcal{S}_1}(-x) dS.
$$
By symmetry, this integral is 0.
\item On $\mathcal{S}_2$, we have ${\bf N}=-\kk$, so that 
$$
\iint_{\mathcal{S}_2}{\bf F}\cdot {\bf N}dS = \iint_{\mathcal{S}_2}x\, dS.
$$
This integral is also 0 by symmetry.

\item On $\mathcal{S}_3$, the unit normal ${\bf N}$ points in the direction of $x\ii + y\jj$, so that
$$
{\bf N}=\frac{x\ii +y\jj}{\sqrt{x^2+y^2}}=\frac{1}{2}(x\ii+y\jj).
$$
Thus ${\bf F}\cdot {\bf N}=\frac{1}{2}(x^2+y^2)=2$, and
$$
\iint_{\mathcal{S}_3}{\bf F}\cdot {\bf N}dS = 2(\hbox{area of }\mathcal{S}_3)=2\cdot 4\pi \cdot 3 = 24\pi.
$$
\end{itemize}
Adding up, we get that 
$\iint_{\mathcal{S}}{\bf F}\cdot {\bf N}dS=24\pi$.


\medskip

{\it Alternative solution using Divergence Theorem:}
We have
\[
\text{div}\ \mathbf{F} = \frac{\partial }{\partial x} x + \frac{\partial }{\partial y}y + \frac{\partial }{\partial z}(-x) = 1+1+0=2. 
\]
Applying the Divergence Theorem to the closed surface $\mathcal{S}$, we get
\[
\iint_{\mathcal{S}} \mathbf{F} \cdot d\mathbf{S} = \iiint_D 2 dV = 2 (\text{volume of $D$}) = 2 (12\pi )=24\pi
\]
where $D$ is the part of the solid cylinder between the given planes. 


\bigskip






\item
{\it Evaluate $\iint_{\mathcal S} {\bf F}\cdot d{\bf S}$, if ${\bf F}=(e^{y^2}-x^3){\bf i}+(y^2+e^{2z^2}){\bf j}
+e^{x^2}{\bf k}$ and $\mathcal{S}$ is the sphere $x^2+y^2+z^2=1$, oriented so that the normal vector points outward.}

\medskip

We use the Divergence Theorem, with $\mathcal{S}$ as above and $D=\{(x,y,z):\ x^2+y^2+z^2\leq 1\}$:
\begin{align*}
\iint_{\mathcal S} {\bf F}\cdot d{\bf S}
&= \iiint_D \nabla\cdot{\bf F} dV 
= \iiint_D (-3x^2+2y)  dV 
\\
&= \iiint_D (-3x^2)  dV \ \ \ \ \ \hbox{ (since $\iiint_D ydV=0$)}
\\
&= - \iiint_D (x^2+y^2+z^2)  dV \ \ \hbox{ (by symmetry in the $x,y,z$ variables)}
\\
&= -\int_0^1 \int_0^{2\pi} \int_0^\pi R^2 R^2\sin\phi d\phi\,d\theta\,dR
\\
&= -\int_0^1 R^4dR \cdot 2\pi \cdot  \int_0^\pi \sin\phi d\phi
\\
&= -\frac{R^5}{5}\Big|_0^1 \cdot 2\pi \cdot  (-\cos\phi)\Big|_0^\pi 
\\
&=-\frac{1}{5}\cdot 2\pi \cdot 2 =-\frac{4\pi}{5}.
\end{align*}


\bigskip


\item {\it Evaluate
$\iint_{\mathcal S} {\bf F}\cdot d{\bf S}$, if ${\bf F}=(x^2+y^2){\bf i}+z^2{\bf j}
+ {\bf k}$ and $\mathcal{S}$ is the half-sphere $x^2+y^2+z^2=1$, $z\geq 0$, oriented so that the normal vector points away from the origin.
(Hint: complete the sphere to a closed surface, then apply the Divergence Theorem.)

}

\medskip


We apply the Divergence Theorem to the region $R=\{(x,y,z):\ x^2+y^2+z^2\leq 1,\ z\geq 0\}$.
The divergence of ${\bf F}$ is $2x$, so 
$$\iiint_R \nabla\cdot{\bf F}\,dV=\iiint_R 2x dV = 0,
$$
by symmetry. The oriented boundary of $R$ consists of $\mathcal S$ and 
$D:= \{(x,y,0):\ x^2+y^2\leq 1\}$, with the normal on $D$ equal to $-\kk$. So
$$
0 = \iiint_R \nabla\cdot{\bf F}\, dV = \iint_{\mathcal S} {\bf F}\cdot d{\bf S}
+ \iint_{D} {\bf F}\cdot d{\bf S},
$$
$$
\iint_{\mathcal S} {\bf F}\cdot d{\bf S}
= - \iint_{D} {\bf F}\cdot (- {\bf k}) dS = \iint_D 1 dS = \pi.
$$


\bigskip



\item
{\it Evaluate the integral
$\iint_{\mathcal S} {\bf F}\cdot d{\bf S}$, if ${\bf F}=y^2\sin y \cos z {\bf i}+x^2\cos x \sin z {\bf j}
+ (z^2+1) {\bf k}$ and $\mathcal{S}$ is the surface consisting of the cylinder $x^2+y^2=1$, $0\leq z\leq 2$, together with the disc at the top, oriented so that the normal vector points away from the origin.}

\bigskip


We apply the Divergence Theorem to the region $R=\{(x,y,z):\ x^2+y^2\leq 1,\ 0\leq z\leq 2\}$.
The divergence of ${\bf F}$ is $2z$, so 
\begin{align*}
\iiint_R \nabla\cdot{\bf F}& =\iiint_R 2 z dV 
\\
&= \iint_{x^2+y^2\leq 1} \int_0^2 2z\, dzdydx
\\
&= \iint_{x^2+y^2\leq 1} z^2\Big|_0^2 \, dzdydx
\\
&= \iint_{x^2+y^2\leq 1} 4\, dydx =  4\pi .
\end{align*}
The oriented boundary of $R$ consists of $\mathcal S$ and the disc at the bottom
$D:= \{(x,y,0):\ x^2+y^2\leq 1\}$, with the normal on $D$ equal to $-\kk$. 
On $D$, we have $z=0$, so that ${\bf F}\cdot {\bf N}=-1$ and
$$
\iint_{D} {\bf F}\cdot d{\bf S} = \iint_{x^2+y^2\leq 1}(-1)dA = -\pi.
$$
Therefore, by the Divergence Theorem,
$$
4\pi  = \iiint_R \nabla\cdot{\bf F} = \iint_{\mathcal S} {\bf F}\cdot d{\bf S} -\pi,
$$
$$
\iint_{\mathcal S} {\bf F}\cdot d{\bf S}=4\pi - (-\pi)=5\pi.
$$

 \bigskip
 









\item
{\it Suppose that $g(x,y,z)$ is a smooth function on all of $\rr^3$, that the
level surface 
$\mathcal{S}=\{(x,y,z):\ g(x,y,z)=0\}$ is closed, and that
$\nabla g \neq 0$ on $\mathcal{S}$.

(a)
Prove that there is a point where the vector field
${\bf F}=\nabla g$ has nonzero divergence.}

\medskip

Suppose for contradiction that $\nabla\cdot F\equiv 0$. By the Divergence Theorem,
it follows that
$$
0= \iiint_R \nabla\cdot{\bf F} = \iint_{\mathcal S} {\bf F}\cdot d{\bf S}
= \iint_{\mathcal S} {\bf F}\cdot {\bf N} \,dS,
$$
where ${\bf N}$ is the unit normal vector pointing outward. Since $\mathcal{S}$ is a level surface of $g$
with $\nabla g \neq 0$,
we have ${\bf N}=\pm \frac{\nabla g}{|\nabla g|}$, with the choice of $\pm$ sign depending on whether 
$\nabla g$ points inward or outward. 
Since both ${\bf N}$ and $ \frac{\nabla g}{|\nabla g|}$ are continuous on $\mathcal{S}$, the $\pm$ sign is
in fact the same for all points on $\mathcal{S}$. So
$$
0=\iint_{\mathcal{S} } {\bf F}\cdot {\bf N} dS
= \pm \iint_{\mathcal{S} } \nabla g \cdot  \frac{\nabla g}{|\nabla g|} dS = 
\pm \iint_{\mathcal{S}}
|\nabla g| dS.
$$
This is a contradiction, since $\nabla g \neq 0$ on $\mathcal{S}$.


\medskip

{\it (b) Does there have to exist a point where ${\bf F}=\nabla g$ has positive divergence?
If yes, explain why. If no, give a counterexample.}

\medskip

No. For example, let $g(x,y,z)=4-x^2-y^2-z^2$ with $\mathcal{S}=\{(x,y,z): x^2+y^2+z^2=4\}$. Then
${\bf F}=\nabla g = -2x\ii -2y\jj -2z\kk\neq 0$ on $\mathcal{S}$, and $\nabla\cdot{\bf F}\equiv -6 <0$.




\bigskip



\item 
{\it 
Assume that a solid $D$ in $\rr^3$ and its boundary $\mathcal{S}$ satisfy the assumptions
of the Divergence Theorem.  Let $f,g:\rr^3\to\rr$ be $C^2$ functions.
Prove that
$$\iint_\mathcal{S}(f\nabla g-g\nabla f)\cdot d{\bf S}
=\iiint_D(f\nabla^2 g-g\nabla^2 f)dV.$$
Here $\nabla^2 f=\nabla\cdot(\nabla f)=f_{xx}+f_{yy}+f_{zz}$.}

\medskip
Let ${\bf F}=f\nabla g-g\nabla f$.  We have
$$\nabla\cdot (f \nabla g)=
\frac{\partial (f g_x)}{\partial x}
+\frac{\partial (f g_y)}{\partial y}
+\frac{\partial (f g_z)}{\partial z}$$
$$=(f_xg_x+fg_{xx}) +(f_yg_y+fg_{yy})+(f_zg_z+fg_{zz})
=\nabla f\cdot\nabla g+f\nabla^2 g,$$
and similarly, 
$\nabla\cdot (g \nabla f)
=\nabla g\cdot\nabla f+g\nabla^2 f$.  Hence
\begin{align*}
\nabla\cdot{\bf F}&= \nabla\cdot (f \nabla g-g \nabla f)
=\nabla f\cdot\nabla g+f\nabla^2 g
-\nabla g\cdot\nabla f-g\nabla^2 f
\\
&=f\nabla^2 g-g\nabla^2 f,
\end{align*}
which together with the Divergence Theorem implies the claimed equality.

\bigskip

 
 

\item {\it  Let ${\bf F}$ be an incompressible smooth vector field such that its field lines are the hyperbolas
$$
x^2+y^2=c(z^2+1),\ ax+by=0,
$$
for $c\geq 0$ and $a,b\in\rr$, all oriented towards increasing $z$. (For $c=0$, this is the $z$-axis.)  
Suppose that 
$$
\iint_{D_A} {\bf F}\cdot \kk \,dS = \ln(A+1)
$$
for all $A\geq 0$, where $D_A=\{(x,y,0):\ x^2+y^2\leq A^2\}$.

What is $\iint_{\mathcal{S}} {\bf F}\cdot d{\bf S}$, if $\mathcal{S}$ is the disc $\{(x,y,4):\ x^2+y^2\leq 9\}$ with the normal vector pointing up? Justify your answer.}

\medskip


Let $\mathcal{S}'=\mathcal{S}\cup \mathcal{S}_1\cup\mathcal{S}_2$, where:
\begin{itemize}
\item 
$\mathcal{S}_1$ is the part of the hyperboloid $\displaystyle x^2+y^2=\frac{9}{17} (z^2+1)$ that lies between the planes $z=0$ and $z=4$, oriented with the normal vector pointing away from the $z$-axis,
\item $\mathcal{S}_2$ is the disc $\displaystyle x^2+y^2=\frac{9}{17}$ in the plane $z=0$, with ${\bf N}=-\kk$.

\end{itemize}
Then $\mathcal{S}'$ is an oriented closed surface bounding a region $R\subset\rr^3$. By the Divergence Theorem,
$$
\iint_{\mathcal{S}'} {\bf F}\cdot d{\bf S}=\iiint_D \nabla\cdot{\bf F}\,dV =0,
$$
where we used that ${\bf F}$ is incompressible. Therefore
$$
0=\iint_{\mathcal{S}'} {\bf F}\cdot d{\bf S}
= \iint_{\mathcal{S}} {\bf F}\cdot d{\bf S}+ \iint_{\mathcal{S}_1} {\bf F}\cdot d{\bf S}
+ \iint_{\mathcal{S}_2} {\bf F}\cdot d{\bf S}.
$$
From the assumption above, we have
$$
\iint_{\mathcal{S}_2} {\bf F}\cdot d{\bf S}= - \iint_{\sqrt{9/17}} {\bf F}\cdot \kk \,dS = -\ln(\sqrt{9/17}+1).
$$
Also, since the field lines of ${\bf F}$ passing through points of the hyperboloid $\displaystyle x^2+y^2=\frac{9}{17} (z^2+1)$ lie on that hyperboloid, it follows that the vectors of ${\bf F}$ are tangent to the hyperboloid, therefore perpendicular to the vector normal to the hyperboloid. Therefore
$$
\iint_{\mathcal{S}_1} {\bf F}\cdot d{\bf S}= 0.
$$
Putting everything together, we get
$$
\iint_{\mathcal{S}} {\bf F}\cdot d{\bf S}=- \iint_{\mathcal{S}_2} {\bf F}\cdot d{\bf S}=\ln(\sqrt{9/17}+1).
$$





\end{enumerate}

