\documentclass{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{enumerate}
\usepackage{ifthen}
\usepackage{ulem} % for strikethrough \sout{...} command
\usepackage{color}
\setlength{\oddsidemargin}{-0.5in}
\setlength{\evensidemargin}{-0.5in}
\setlength{\topmargin}{-0.5in}
\setlength{\headheight}{0.0in}
\setlength{\headsep}{0.0in}
\setlength{\topskip}{0.0in}
\setlength{\textheight}{9.6in}
\setlength{\textwidth}{7.5in}

\usepackage{tikz,pgfplots}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{arrows.meta}
\pgfplotsset{compat=1.6}

\newcommand{\bdot}{\, {\scriptstyle{\bullet}} \,}
\newcommand{\B}[1]{{\bf {#1}}}
\newcommand{\la}{\langle}
\newcommand{\ra}{\rangle}

\newcommand{\myspace}{\parbox[c][0.2in]{0.2in}{\hfill}}
\newcommand{\varspace}[2]{\mbox{\parbox[c][#1]{#2}{\hfill}}}
\newcommand{\force}{{$\mbox{\,\!}$}}

\begin{document}

%\pagestyle{empty}

%\iffalse

\noindent
\parbox{2in}{\bf Math 2130-101}
\hfill {\Large \bf Final Exam} \hfill
\parbox{2in}{\bf \hfill May $3^\mathrm{rd}$\!,\  2021}

\vspace{0.05in}

\noindent {\large\bf Name:} \underline{\Large\sc\color{red}\quad Answer Key \quad}
\hfill {\bf Be sure to show your work!}

\vspace{0.05in}

\noindent
{\bf\large 1. (6 points)} Let $\B F(x,y,z) = \la \ln(x^3+1), y\sin(xz), x^2y+z^5 \ra$. Compute $\nabla \times \B F$ and $\nabla \bdot \B F$.

%\vspace{0.05in}

$$\nabla \times \B F= \begin{vmatrix} \B i & \B j & \B k \vspace{0.05in} \\ \partial/\partial x & \partial/\partial y & \partial/\partial z  \vspace{0.05in} \\ \ln(x^3+1) &  y\sin(xz) & x^2y+z^5 \end{vmatrix}$$
$$
= \left\langle \dfrac{\partial}{\partial y}\left[x^2y+z^5 \right] - \dfrac{\partial}{\partial z}\left[ y\sin(xz) \right], -\left(\dfrac{\partial}{\partial x}\left[ x^2y+z^5 \right] - \dfrac{\partial}{\partial z}\left[ \ln(x^3+1) \right]\right), \dfrac{\partial}{\partial x}\left[ y\sin(xz) \right] - \dfrac{\partial}{\partial y}\left[ \ln(x^3+1) \right] \right\rangle
$$ 
$$=\left\langle x^2-xy\cos(xz), -2xy, yz\cos(xz) \right\rangle \qquad \text{{\it Unnecessary note:} } \nabla \times \B F \not= \B 0 \text{ so $\B F$ is not conservative.}$$

\vspace{-0.15in}

$$\nabla \bdot \B F = \dfrac{\partial}{\partial x}\left[ \ln(x^3+1) \right] + \dfrac{\partial}{\partial y}\left[ y\sin(xz) \right] + \dfrac{\partial}{\partial z}\left[ x^2y+z^5 \right] = \dfrac{3x^2}{x^3+1}+\sin(xz)+5z^4$$

\vspace{0.05in}

\noindent
{\bf\large 2. (11 points)} Let $\B F(x,y,z) = \left\la 2x+z, 1+2yz, y^2+x \right\ra$, and let $C$ be the line segment from $(0,1,1)$ to $(2,1,0)$.\\
\force \hfill {\it Note:} $\B F$ is a conservative vector field (I've checked for you).

\vspace{-0.1in}

\begin{enumerate}[(a)]
\item Use the \underline{\bf fundamental theorem of line integrals} to compute $\int_C \B F \bdot d\B r$.

\vspace{0.05in}

We need to construct a potential function for $\B F$. We need $f(x,y,z) = \int 2x+z\,dx = x^2+xz+C_1(y,z)$ and $f(x,y,z)=\int 1+2yz\,dy = y+y^2z+C_2(x,z)$ and $f(x,y,z) = \int y^2+x\,dz = y^2z+xz+C_3(x,y)$. Reconciling these three descriptions of $f$ yields: \underline{$f(x,y,z)=x^2+xz+y+y^2z$} ($+$an arbitrary constant). Keep in mind that we only keep each term once (and anything involving $k$ variables should show up $k$ times -- like $xz$ showed up twice). Also, we could double check and quickly verify that $\nabla f = \B F$. 

\vspace{-0.25in}

$$\hspace*{-0.15in} \int_C \B F \bdot d\B r = \int_C \nabla f \bdot d \B r = f(\text{end of }C) - f(\text{start of }C) = f(2,1,0)-f(0,1,1) = (2^2+0+1+0)-(0+0+1+1^2(1))=5-2=\mbox{\fbox{3}}$$

\vspace{-0.15in}

\item Recompute $\int_C \B F \bdot d\B r$ directly (i.e. parameterize $C$ etc.).

\vspace{0.05in}

First, we must paramterize $C$, a line segment: $\B r(t) = A+\vec{AB}t$, $0 \leq t \leq 1$ where $A=(0,1,1)$ and $B=(2,1,0)$ so that $\vec{AB} = B-A= \langle 2,0,-1\rangle$. Thus $\B r(t)= \langle 0,1,1 \rangle +\langle 2,0,-1\rangle t = \langle 2t,1,1-t\rangle$ where $0 \leq t \leq 1$. We could double check and verify that $\B r(0)=(0,1,1)$ and $\B r(1) = (2,1,0)$ as desired. Next, the derivative of our parameterization: $\B r'(t) =\langle 2,0,-1\rangle$. Now we are ready to plug in and integrate:

\vspace{-0.2in}

$$\int_C \B F \bdot d\B r = \int_0^1 \B F(\B r(t)) \bdot \B r'(t)\,dt = \int_0^1 \left\langle 2(2t)+(1-t),1+2(1)(1-t), 1^2+2t \right\rangle \bdot \langle 2,0,-1\rangle\,dt$$

\vspace{-0.1in}

where we used our parameterization to get $x=2t$, $y=1$, $z=1-t$, and $d\B r =\B r'(t)\,dt$.

\vspace{-0.15in}

$$\int_C \B F \bdot d\B r = \int_0^1 \langle 3t+1, 3-2t, 1+2t\rangle\bdot \langle 2,0,-1\rangle\,dt = \int_0^1 6t+2+0-1-2t\,dt = \int_0^1 4t+1\,dt = 2t^2+t\;\Bigg|_0^1=\mbox{\fbox{3}}$$

\vspace{-0.15in}

\end{enumerate}

\noindent 
{\bf\large 3. (5 points)} Suppose $\B F = \langle M,N,P \rangle$ is a vector field where $M,N,P$ have continuous partial derivatives of all orders defined on all of $\mathbb{R}^3$.
Fill in the blank and circle the correct answers.

\vspace{0.05in}

If $\nabla \times \B F=\B 0$, then $\B F$ is a \underline{\large\sc \quad Conservative \quad} vector field.

\vspace{0.05in}

$\nabla \times \B F=\B 0$ implies $\B F$'s \quad {\Large \fbox{line}\quad/\quad flux} \quad integrals are \quad {\Large \fbox{path}\quad/\quad surface} \quad independent.

\vspace{0.05in}

$\nabla \bdot \B F=\B 0$ implies $\B F$'s \quad {\Large line\quad/\quad \fbox{flux}} \quad integrals are \quad {\Large path\quad/\quad \fbox{surface}} \quad independent.

\vspace{0.05in}

Recall that conservative vector fields are exactly those which have path independent line integrals. The fact that $\nabla \times \B F=\B 0$ is equivalent to $\B F$ having path independent line integrals follows from Green's (in 2D) and Stokes' (in 3D) theorems. The fact that $\nabla \bdot \B F=0$ implies that $\B F$'s flux integrals are surface independent follows from the divergence theorem.

\vspace{0.05in}

\noindent
{\bf\large 4. (9 points)} Let $C$ be the counter-clockwise oriented boundary of the region bounded by $y=1$ and $y=2-x^2$.\\ \force \hfill
Compute $\displaystyle \int_C \left(-y^2+\sqrt{x^6+e^{3x}}\right)\,dx+\sin(y^8+ye^y)\,dy$.

\vspace{-0.25in}

\begin{minipage}{2in}
\begin{tikzpicture}[arrowmark/.style 2 args={decoration={markings,mark=at position #1 with \arrow{#2}}}]
\begin{axis}[
  axis lines=none,
  %axis line style={draw=none},
  %tick style={draw=none},
  %axis x line=middle, axis y line=middle,
  width=5cm, height=5cm,     % size of the image = rigged to keep scaling=constrained
  ymin=-0.5, ymax=2.5, %ytick={0}, ylabel={},
  xmin=-1.35, xmax=1.35, %xtick={0}, xlabel={},
]

\addplot[gray, thick, dashed, domain=-1.35:1.35, smooth] ({x}, {1});
\addplot[gray, thick, dashed, domain=-1.35:1.35, smooth] ({x}, {2-x^2});

\addplot[name path=A,black, ultra thick, domain=-1:1, smooth] ({x}, {1});
\addplot[name path=B,black, ultra thick, domain=-1:1, smooth] ({x}, {2-x^2});

\addplot[yellow!50] fill between[of=A and B];

% redraw wiped out portion of axes
%\addplot[black, domain=1:2, smooth] ({0}, {x});
%\addplot[black, domain=1:2, smooth] ({x}, {0});


\addplot[black, ultra thick, domain=-0.25:0.25, smooth, ->] ({x}, {1});
\addplot[black, ultra thick, domain=-0.25:0.25, smooth, <-] ({x}, {2-x^2});

\node at (axis cs:0,1.5) {$R$};
\node at (axis cs:0.75,1.85) {$\partial R$};

\node at (axis cs:-0.6,0.3) {$y=2-x^2$};

\node at (axis cs:-0.45,0.8) {$y=1$};

\end{axis}
\end{tikzpicture}
\end{minipage} \quad
\begin{minipage}{5in}
Since we are computing a line integral (of some nasty stuff) around the {\bf boundary} of a (simply connected) region in $\mathbb{R}^2$, we should use Green's theorem. Notice that $C=\partial R$ is counter-clockwise oriented where $R$ is the region bounded by $y=1$ and $y=2-x^2$. Thus $R$ can be described as the points such that $1 \leq y \leq 2-x^2$ and $-1 \leq x \leq 1$ since $1=y=2-x^2$ implies $x^2=1$ so that $x=\pm 1$.
\end{minipage}

Green's says $\displaystyle \iint_R (N_x - M_y)\,dA = \int_{\partial R} M\,dx+N\,dy$ where here $M=-y^2+\sqrt{x^6+e^{3x}}$ and $N=\sin(y^8+ye^y)$. Notice that $N_x=0$ and $M_y=-2y$ so that $N_x-M_y=2y$. Therefore,

\vspace{-0.25in}

$$\int_{\partial R} \left(-y^2+\sqrt{x^6+e^{3x}}\right)\,dx+\sin(y^8+ye^y)\,dy = \iint_R 2y\,dA = \int_{-1}^1\int_{1}^{2-x^2} 2y\,dy\,dx = \int_{-1}^1 y^2\;\Bigg|_{1}^{2-x^2}\,dx = \int_{-1}^1 (2-x^2)^2-(1)^2\,dx$$ $$ = \int_{-1}^1 4-4x^2+x^4-1\,dx = \int_{-1}^1 x^4-4x^2+3\,dx =  2\int_0^1 x^4-4x^2+3 \,dx = 2\left(\dfrac{1}{5}-\dfrac{4}{3}+3\right) = 2\left(\dfrac{3}{15}-\dfrac{20}{15}+\dfrac{45}{15}\right) = \mbox{\fbox{$\dfrac{56}{15}$}}$$

\noindent
where we simplified some final calculations using the fact that $x^4-4x^2+3$ is an even function and $-1\leq x\leq 1$ is a symmetric interval.

\vspace{0.4in}

\force \hfill
\begin{tikzpicture}[arrowmark/.style 2 args={decoration={markings,mark=at position #1 with \arrow{#2}}}]
\begin{axis}[
  axis lines=none,
  %axis line style={draw=none},
  %tick style={draw=none},
  %axis x line=middle, axis y line=middle,
  width=7cm, height=5cm,     % size of the image = rigged to keep scaling=constrained
  ymin=-0.5, ymax=3.5, %ytick={0}, ylabel={},
  xmin=-3.5, xmax=3.5, %xtick={0}, xlabel={},
]

\addplot[name path=A,black, thick, domain=0:180, smooth] ({3*cos(x)}, {3*sin(x)});
\addplot[name path=B,black, thick, domain=0:180, smooth] ({0.75*cos(x)}, {0.75*sin(x)+1.25});
\addplot[name path=C,black, thick, domain=180:360, smooth] ({0.75*cos(x)}, {0.75*sin(x)+1.25});
\addplot[name path=D,black, thick, domain=-3:3, smooth] ({x}, {0});

\addplot[yellow!50] fill between[of=A and B];
\addplot[yellow!50] fill between[of=C and D];
\addplot[white] fill between[of=B and C];

\addplot[black, thick, domain=40:70, smooth, -{>[scale=2]}] ({3*cos(180-x)}, {3*sin(180-x)});
\addplot[black, thick, domain=40:70, smooth,  -{<[scale=2]}] ({0.75*cos(x)}, {0.75*sin(x)+1.25});
\addplot[black, thick, domain=-1:0.5, smooth,  -{>[scale=2]}] ({x}, {0});

% redraw wiped out portion of axes
%\addplot[black, domain=1:2, smooth] ({0}, {x});
%\addplot[black, domain=1:2, smooth] ({x}, {0});

\node at (axis cs:-2,1) {$R$};

\node at (axis cs: 1.7,2.85) {$C_2$};
\node at (axis cs: 0.35,1.2) {$C_1$};
\node at (axis cs: -0.5,-0.35) {$C_3$};
\end{axis}
\end{tikzpicture}


\vspace{-1.7in}

\noindent
{\bf\large 5. (9 points)} $C_1$ is a circle of radius 1 (oriented clockwise), $C_2$ is an upper-half of a circle of radius 3 (oriented clockwise), and $C_3$ is a line segment closing off the semi-circle (oriented left to right). Let $\B F(x,y) = \langle M(x,y), N(x,y) \rangle$ be a vector field such that $M$ and $N$ have continuous first partials and in addition, $N_x-M_y = 4$ for all points in\\ region $R$. We also know $\displaystyle \int_{C_2} \B F \bdot d\B r = \pi$ and $\displaystyle \int_{C_3} \B F \bdot d\B r = 5\pi$. {\it Note:} The area of $R$ is $7\pi/2$.

%\vspace{0.1in}

\noindent
Compute $\displaystyle \int_{C_1} M(x,y)\,dx + N(x,y)\,dy \quad = \quad \underline{\quad 10\pi \quad}$.

\vspace{0.05in}

Notice that $\partial R = C_3-C_2+C_1$ since we go around outer edges in the counter-\\clockwise direction and inner edges in the clockwise direction and Green's theorem\\ (with holes) says $\displaystyle \iint_R 4\,dA = \iint_R (N_x -M_y)\,dA = \int_{\partial R} \B F\bdot d\B r= \int_{C_3-C_2+C_1} \B F\bdot d\B r$.\\ Thus $\displaystyle \int_{C_1} \B F\bdot d\B r = 4\iint_R 1\,dA+\int_{C_2} \B F\bdot d\B r-\int_{C_3} \B F\bdot d\B r=4 \cdot \mathrm{Area}(R)+\pi-5\pi = 4\cdot\dfrac{7\pi}{2}-4\pi = 14\pi-4\pi=10\pi$.

\vspace{0.1in}

\noindent
{\bf\large 6. (10 points)} Let $S_1$ be the upper hemisphere: $x^2+y^2+z^2=4$, $z \geq 0$ and $S_2$ be the disk $x^2+y^2 \leq 4$ in the $xy$-plane. Orient both $S_1$ and $S_2$ upward. Let $\B F$ be a smooth vector field such that $\iint_{S_2} \B F \bdot \B n\,d\sigma= \pi$ and $\nabla \bdot \B F = z$.\\ \force \hfill Find $\iint_{S_1} \B F \bdot \B n\,d\sigma$.

%\iffalse %%%%%%%%%%%%%%%%%%%%%%%% block comment %%%%%%%%%%%%%%%%%%%%%%%%%%
\noindent
\begin{minipage}{5.25in}
Notice that $S_1$ and $S_2$ bound the solid upper-half ball $E$: $x^2+y^2+z^2 \leq 4$, $z \geq 0$. We know the divergence of $\B F$ and are dealing with the boundary of a solid region, so we should use the divergence theorem! Note that the surface of a solid region should be outward oriented (to be compatible with the divergence theorem), so $\partial E = S_1 -S_2$.

To use the divergence theorem we need to know $\iiint_E \nabla \bdot \B F \,dV = \iiint_E z\,dV$. Obviously, we should set this integral up in spherical coordinates where $\rho^2=x^2+y^2+z^2 \leq 4$ so that $0 \leq \rho \leq 2$ and $z \geq 0$ tells us that $0 \leq \varphi \leq \pi/2$. Therefore, keeping in mind that $z=\rho\cos(\varphi)$ and our Jacobian is $J=\rho^2\sin(\varphi)$ we get:
\end{minipage}
\quad
\begin{minipage}{2in}

\vspace{-0.4in}

\pgfplotsset{
  /pgfplots/colormap={mypink}{%
    color(0cm) = (purple);
    color(1cm) = (pink!80!purple);
    color(2cm) = (pink!90);
    color(3cm) = (pink) }
}
\pgfplotsset{
  /pgfplots/colormap={myblue}{%
    color(0cm) = (blue!55);
    color(1cm) = (blue!60);
    color(2cm) = (blue!65);
    color(3cm) = (blue!70) }
}
\pgfplotsset{
  /pgfplots/colormap={mygreen}{%
    color(0cm) = (green!40);
    color(1cm) = (green!60);
    color(2cm) = (green!80);
    color(3cm) = (green) }
}
\begin{tikzpicture}
    \begin{axis}[%
        axis equal,
        width=7cm,
        height=7cm,
        axis lines = none,  % vs. center
%        xlabel = {$x$},
%        ylabel = {$y$},
%        zlabel = {$z$},
        ticks=none,
%        enlargelimits=0.3,
%        view/h=15,
         view={35}{15},
%        colormap = {whiteblack}{color(0cm)  = (white);color(1cm) = (black)},
        scale uniformly strategy=units only,
    ]
    \addplot3[%
        opacity = 0.5,
        surf,
        z buffer = sort,
        samples = 25,
        colormap name=myblue,
        variable = \u,
        variable y = \v,
        domain = 0:360,
        y domain = 0:1,
    ]
    ({2*v*cos(u)}, {2*v*sin(u)}, {0});

\addplot3[ultra thick, color=black, domain = 0:1,->]({0},{0},{x});

    \addplot3[%
        opacity = 0.25,
        surf,
        z buffer = sort,
        samples = 20,
        colormap name=mygreen,
        variable = \u,
        variable y = \v,
        domain = 0:360,
        y domain = 0:90,
    ]
    ({2*cos(u)*sin(v)}, {2*sin(u)*sin(v)}, {2*cos(v)});

\addplot3[ultra thick, color=black, domain = 0:1,->]({(2+x)*cos(270)*sin(30)},{(2+x)*sin(270)*sin(30)},{(2+x)*cos(30)});

\node at (rel axis cs: 1,0,0.85) {$S_1$};

\node at (rel axis cs: 1,0,0.25) {$S_2$};

    \end{axis}
\end{tikzpicture}
\end{minipage}

\vspace{-0.15in}
%\fi %%%%%%%%%%%%%%%%%%%%%%%%end block comment %%%%%%%%%%%%%%%%%%%%%%%%%%

$$\iiint_E \nabla \bdot \B F\,dV = \iiint_E z \,dV = \int_0^{2\pi} \hspace*{-0.05in} \int_0^{\pi/2} \hspace*{-0.05in}\int_0^2 \rho\cos(\varphi)\cdot \rho^2\sin(\varphi)\,d\rho\,d\varphi\,d\theta = \int_0^{2\pi}\hspace*{-0.175in}\,d\theta \int_0^{\pi/2} \hspace*{-0.1in}\sin(\varphi)\cos(\varphi)\,d\varphi \int_0^2 \rho^3\,d\rho = 2\pi \dfrac{1}{2}\sin^2(\varphi)\Bigg|_0^{\pi/2}\hspace*{-0.1in} \cdot \dfrac{\rho^4}{4}\Bigg|_0^2 $$

\vspace{-0.1in}

$=\pi(\sin(\pi/2)-\sin(0))\cdot\dfrac{16}{4} = 4\pi$. Finally, 

\vspace{-0.15in}

$$4\pi= \iiint_E \nabla \bdot \B F \,dV = \iint_{\partial E} \B F\bdot \B n\,d\sigma = \iint_{S_1-S_2} \B F\bdot \B n\,d\sigma = \iint_{S_1} \B F\bdot \B n\,d\sigma - \iint_{S_2} \B F\bdot \B n\,d\sigma = \iint_{S_1} \B F\bdot \B n\,d\sigma - \pi$$

\vspace{-0.1in}

\noindent
Thus $\iint_{S_1} \B F\bdot \B n\,d\sigma=$ \fbox{$5\pi$}.

\vspace{0.05in}

\noindent
{\bf\large 7. (12 points)} Let $S_1$ be the surface parameterized by $\B r(u,v) = \langle v\sin(u),v\cos(u),2v \rangle$\\ \force \hfill where $-\pi/2 \leq u \leq 2\pi$ and $4 \leq v \leq 11$.

\vspace{-0.15in}

%\end{document}

\begin{enumerate}[(a)]
\item Find both orientations for $S_1$.

\vspace{0.05in}

$\B r_u = \langle v\cos(u),-v\sin(u),0\rangle$ and $\B r_v = \langle \sin(u),\cos(u),2 \rangle$ so $\B r_u \times \B r_v = \langle -2v\sin(u),-2v\cos(u),v \rangle = v\langle -2\sin(u),-2\cos(v),1\rangle$. Thus $|\B r_u \times \B r_v| = v\sqrt{4\sin^2(u)+4\cos^2(u)+1}=v\sqrt{5}$.\\ In the ratio, cancel off a $v$ and get:

\vspace{-0.4in}

\force \hfill \hfill
$\displaystyle \B n = \pm\dfrac{\B r_u \times \B r_v}{|\B r_u \times \B r_v|} =$ \fbox{$\displaystyle \pm \dfrac{1}{\sqrt{5}}\langle -2\sin(u),-2\cos(u),1\rangle$}
\qquad \force

\vspace{-0.1in}
  
\item Set up but {\bf do not evaluate} the surface integral $\displaystyle \iint_{S_1} \sqrt{x^2+y^2}\cdot e^z\,d\sigma$. \quad [Don't worry about simplifying.] 

\vspace{-0.05in}

Our parameterization tells us that $x=v\sin(u)$, $y=v\cos(u)$, and $z=2v$. Thus $\sqrt{x^2+y^2}=v$ and we already computed the surface area element $d\sigma$: $|\B r_u \times \B r_v|=v\sqrt{5}$. Therefore,

\vspace{-0.2in}

\force \hfill
$\displaystyle \iint_{S_1} \sqrt{x^2+y^2}\cdot e^z\,d\sigma =$  \fbox{$\displaystyle \int_{-\pi/2}^{2\pi}\int_4^{11} v\cdot e^{2v}\cdot v\sqrt{5}\,dv\,du$}
\qquad \force

\vspace{-0.1in}

\item Set up but {\bf do not evaluate} the flux integral $\displaystyle \iint_{S_1} \B F \bdot \B n\,d\sigma$ where $S_1$ is \underline{oriented downward} and $\B F(x,y,z) = \la z,y^2,9+x \ra$. \quad [Don't worry about computing the dot product or any significant simplification.] 

\vspace{0.05in}

Our only note is that we want $\B n\,d\sigma = -\B r_u \times \B r_v = \langle 2v\sin(u),2v\cos(u),-v\rangle$ since $S_1$ is oriented downward (and thus the $\B k$-component, $-v$, should be negative).

\vspace{-0.15in}

\force\hfill
$\displaystyle \iint_{S_1} \B F \bdot \B n\,d\sigma =$ \fbox{$\displaystyle \int_{-\pi/2}^{2\pi}\int_4^{11} \langle 2v,(v\cos(u))^2,9+v\sin(u)\rangle \bdot \langle 2v\sin(u),2v\cos(u),-v\rangle\,dv\,du$}
\qquad\force 

\vspace{0.05in}

\end{enumerate}

\noindent
{\bf\large 8. (12 points)} Find the centroid of the part of the sphere $x^2+y^2+z^2=4$ in the first octant (i.e., $x,y,z \geq 0$).\\ \force \hfill Note: This is a {\bf surface}. You should be computing {\bf surface integrals}.

%\[ m = \iint_{S_1} 1\,d\sigma \qquad M_{yz} = \iint_{S_1} x\,d\sigma \qquad M_{xz} = \iint_{S_1} y\,d\sigma \qquad M_{xy} = \iint_{S_1} z\,d\sigma \]

\vspace{0.05in}

This is an eighth of a sphere centered at the origin and of radius 2. I will forego a picture. Since permuting $x$, $y$, and $z$ coordinates does not change our surface, we get the following fact from symmetry: $\bar{x}=\bar{y}=\bar{z}$. Thus we only need to compute one of the centroid's coordinates. Next, we know that the surface area of a sphere of radius 2 is $4\pi\cdot 2^2 = 16\pi$. Thus $m=$ the surface area of $S_1$ $= \frac{1}{8}\cdot 16\pi = 2\pi$. 

To compute a moment, we will need a parameterization. Spherical coordinates are an obvious choice where $\rho^2=x^2+y^2+z^2=4$ implies $\rho=2$. Thus we have $\B r(\varphi,\theta) = \langle 2\cos(\theta)\sin(\varphi), 2\sin(\theta)\sin(\varphi), 2\cos(\varphi) \rangle$ and $0 \leq \varphi \leq \pi/2$ (since $z \geq 0$), $0 \leq \theta \leq \pi/2$ (since $x,y \geq 0$). Next, we need to compute the surface area element $d\sigma = |\B r_\varphi \times \B r_\theta|\,dA$. 

We get: $\B r_\varphi = \langle 2\cos(\theta)\cos(\varphi), 2\sin(\theta)\cos(\varphi), -2\sin(\varphi)$ and $\B r_\theta = \langle -2\sin(\theta)\sin(\varphi),2\cos(\theta)\sin(\varphi),0\rangle$ and so $\B r_\varphi \times \B r_\theta = \dots = 4\sin(\varphi)\langle \cos(\theta)\sin(\varphi),\sin(\theta)\sin(\varphi),\cos(\varphi)\rangle$ and thus $|\B r_\varphi \times \B r_\theta| = 4\sin(\varphi)$ (as expected). As this point, since $\bar{x}=\bar{y}=\bar{z}$, we could choose to compute $M_{yz}$, $M_{xz}$, or $M_{xy}$ (they all must be the same). However, in our parameterization $\B r(\varphi,\theta)$, $z=2\cos(\varphi)$ is the simplest formula, so we choose to compute $M_{xy}$.

\vspace{-0.25in}

$$M_{xy} = \iint_{S_1} z\,d\sigma = \int_0^{\pi/2} \int_0^{\pi/2} 2\cos(\varphi) \cdot 4\sin(\varphi)\,d\varphi\,d\theta = \int_0^{\pi/2}\,d\theta \int_0^{\pi/2} 8\sin(\varphi)\cos(\varphi)\,d\varphi = \dfrac{\pi}{2} \cdot 4\sin^2(\varphi)\Bigg|_0^{\pi/2}$$ 

\vspace{-0.1in}

$= 2\pi(\sin(\pi/2)-\sin(0))=2\pi$ Therefore, $\bar{z}=\dfrac{M_{xy}}{m}=\dfrac{2\pi}{2\pi}=1$. Finally, we get that the centroid is \fbox{$(\bar{x},\bar{y},\bar{z})=(1,1,1)$}.

\vspace{0.05in}

\noindent
{\bf\large 9. (11 points)} Consider the solid cylinder $E$: $x^2+y^2 \leq 1$ and $1 \leq z \leq 3$ and let $S_1=\partial E$ be its outward oriented surface.  In addition, let $\B F(x,y,z) = \left\la xz+\sqrt[6]{y^{4}+z^4+12},\;  yz+\sin^{10}(x+z^2),\; \ln(x^8+y^2+99) \right\ra$.  Compute the flux integral $\iint_{S_1} \B F \bdot \B n\,d\sigma$.

\vspace{-0.25in}

\noindent
\begin{minipage}{1.1in} \hspace{-0.2in}
%\iffalse %%%%%%%%%%%%%%%%%%%%%%%% block comment %%%%%%%%%%%%%%%%%%%%%%%%%%
\pgfplotsset{
  /pgfplots/colormap={mypink}{%
    color(0cm) = (purple);
    color(1cm) = (pink!80!purple);
    color(2cm) = (pink!90);
    color(3cm) = (pink) }
}
\pgfplotsset{
  /pgfplots/colormap={myblue}{%
    color(0cm) = (blue!55);
    color(1cm) = (blue!60);
    color(2cm) = (blue!65);
    color(3cm) = (blue!70) }
}
\pgfplotsset{
  /pgfplots/colormap={mygreen}{%
    color(0cm) = (green!40);
    color(1cm) = (green!60);
    color(2cm) = (green!80);
    color(3cm) = (green) }
}
\begin{tikzpicture}
    \begin{axis}[%
        axis equal,
        width=7cm,
        height=7cm,
        axis lines = none,  % vs. center
%        xlabel = {$x$},
%        ylabel = {$y$},
%        zlabel = {$z$},
        ticks=none,
%        enlargelimits=0.3,
%        view/h=15,
         view={35}{15},
%        colormap = {whiteblack}{color(0cm)  = (white);color(1cm) = (black)},
        scale uniformly strategy=units only,
    ]

\addplot3[ultra thick, color=black, domain = 0:0.8,->]({0},{0},{1-x});

    \addplot3[%
        opacity = 0.75,
        surf,
        z buffer = sort,
        samples = 20,
        colormap name=mypink,
        variable = \u,
        variable y = \v,
        domain = 0:360,
        y domain = 0:1,
    ]
    ({v*cos(u)}, {v*sin(u)}, {1});

    \addplot3[%
        opacity = 0.75,
        surf,
        z buffer = sort,
        samples = 20,
        colormap name=mygreen,
        variable = \u,
        variable y = \v,
        domain = 0:360,
        y domain = 1:3,
    ]
    ({cos(u)}, {sin(u)}, {v});

    \addplot3[%
        opacity = 0.75,
        surf,
        z buffer = sort,
        samples = 20,
        colormap name=mypink,
        variable = \u,
        variable y = \v,
        domain = 0:360,
        y domain = 0:1,
    ]
    ({v*cos(u)}, {v*sin(u)}, {3});

\addplot3[ultra thick, color=black, domain = 0:0.6,->]({0},{0},{3+x});

\addplot3[ultra thick, color=black, domain = 0:0.6,->]({(1+x)*cos(390)},{(1+x)*sin(390)},{2});

%\node at (rel axis cs: 1.5,0,2) {$E$};

    \end{axis}
\end{tikzpicture}
%\fi %%%%%%%%%%%%%%%%%%%%%%%% end block comment %%%%%%%%%%%%%%%%%%%%%%%%%%
\end{minipage}
\quad
\begin{minipage}{6.15in}
Obviously, we should use the divergence theorem since we are computing a flux integral over a {\it closed} surface, $S_1=\partial E$, that is the boundary of
a solid region (and even oriented outward). Also, our vector field is pretty nasty, but its divergence is pretty nice: $\nabla \bdot \B F = z+z+0=2z$. Also, since 
we are dealing with a cylindrical region, we should set up our triple integral in cylindrical coordinates: $1 \leq z \leq 3$, $r^2=x^2+y^2\leq 1$ so $0 \leq r \leq 1$. Don't forget the Jacobian $J=r$:

$$\hspace*{-0.4in}\iint_{\partial E} \B F \bdot \B n\,d\sigma = \iiint_E \nabla \bdot \B F \,dV = \int_0^{2\pi}\int_0^1\int_1^3 2z\cdot r\,dz\,dr\,d\theta = \int_0^{2\pi}\,d\theta \int_0^1 r\,dr \int_1^3 2z\,dz = 2\pi \cdot \dfrac{1}{2} \cdot (3^2-1^2) = \mbox{\fbox{$8\pi$}}$$
\end{minipage}

\vspace{0.05in}

%\fi

\noindent
{\bf\large 10. (15 points)} Let $S_1$ be the surface $z=x^2+y^2$, $1 \leq z \leq 4$ (i.e., part of a circular paraboloid). Orient $S_1$ downward. \\ \force \hfill  Verify Stokes' Theorem for the surface $S_1$, its boundary, and the vector field $\B F = \langle y+x^2,y,xz+5 \rangle$.

\noindent
\begin{minipage}{5.6in}
To verify Stoke's theorem, we need to compute some line integrals and a flux integral. Let us start with the line integral (boundary of $S_1$: $\partial S_1$) side. Notice that the boundary of our surface has two components: The circle at the bottom $C_1$ (where $z=1$): $x^2+y^2=1$ and $z=1$. And the circle the top $C_2$ (where $z=4$): $x^2+y^2=4$ and $z=4$. Notice the (using the right hand rule -- or some other method) we get that the bottom circle is oriented in a counter-clockwise direction (recalling that the $x$-axis points out of the page and the $y$-axis points to the right and the bottom circle flows from $x$-axis to $y$-axis direction). Likewise, the top circle flows in the opposite direction (clockwise).
\end{minipage}\quad
\begin{minipage}{1.25in}
%\iffalse %%%%%%%%%%%%%%%%%%%%%%%% block comment %%%%%%%%%%%%%%%%%%%%%%%%%%
\pgfplotsset{
  /pgfplots/colormap={mypink}{%
    color(0cm) = (purple);
    color(1cm) = (pink!80!purple);
    color(2cm) = (pink!90);
    color(3cm) = (pink) }
}
\pgfplotsset{
  /pgfplots/colormap={myblue}{%
    color(0cm) = (blue!55);
    color(1cm) = (blue!60);
    color(2cm) = (blue!65);
    color(3cm) = (blue!70) }
}
\pgfplotsset{
  /pgfplots/colormap={mygreen}{%
    color(0cm) = (green!40);
    color(1cm) = (green!60);
    color(2cm) = (green!80);
    color(3cm) = (green) }
}
\begin{tikzpicture}
    \begin{axis}[%
        axis equal,
        width=7cm,
        height=7cm,
        axis lines = none,  % vs. center
%        xlabel = {$x$},
%        ylabel = {$y$},
%        zlabel = {$z$},
        ticks=none,
%        enlargelimits=0.3,
%        view/h=15,
         view={35}{15},
%        colormap = {whiteblack}{color(0cm)  = (white);color(1cm) = (black)},
        scale uniformly strategy=units only,
    ]
\addplot3[ultra thick, color=black, domain = -15:345,->]({cos(x)},{sin(x)},{0.975});

    \addplot3[%
        opacity = 0.75,
        surf,
        z buffer = sort,
        samples = 20,
        colormap name=mygreen,
        variable = \u,
        variable y = \v,
        domain = 0:360,
        y domain = 1:2,
    ]
    ({v*cos(u)}, {v*sin(u)}, {v^2});

\addplot3[ultra thick, color=black, domain = -15:345,<-]({2*cos(x)},{2*sin(x)},{4.025});

\addplot3[ultra thick, color=gray, domain = -90:270, <-]({1.675*cos(-95)+cos(-95)*cos(x)*0.2-1.675*sin(-95)*sin(x)*0.2}, {1.675*sin(-95)+sin(-95)*cos(x)*0.2+1.675*cos(-95)*sin(x)*0.2}, {(1.675)^2+2*1.675*cos(x)*0.2});

\addplot3[ultra thick, color=black, domain = 0:0.3,->]({1.675*cos(-95)+2*(1.675)^2*cos(-95)*x},{1.675*sin(-95)+2*(1.675)^2*sin(-95)*x},{(1.675)^2-1.675*x});

\node at (rel axis cs: 1.2,0,0.75) {$S_1$};

    \end{axis}
\end{tikzpicture}
%\fi %%%%%%%%%%%%%%%%%%%%%%%% end block comment %%%%%%%%%%%%%%%%%%%%%%%%%%
\end{minipage}

\vspace{0.05in}

Parameterizing $C_1$ (the bottom) we get: $\B r(t) =\langle \cos(t),\sin(t),1\rangle$, $0 \leq t \leq 2\pi$. Thus $\B r'(t) = \langle -\sin(t),\cos(t),0 \rangle$ and so $\int_{C_1} \B F \bdot d\B r = \int_0^{2\pi} \langle \sin(t)+\cos^2(t), \sin(t), \cos(t) \cdot 1+5 \rangle \bdot \langle -\sin(t),\cos(t),0\rangle\,dt = \int_0^{2\pi} -\sin^2(t)+\cos^2(t)(-\sin(t))+\sin(t)\cos(t)\,dt = -\pi$ where to evaluate this integral we use a simple $u$-substitution on the $\cos^2(t)(-\sin(t))$ term (i.e. $u=\cos(t)$ so $du=-\sin(t)\,dt$) and we use a double angle identity to take care of $-\sin^2(t)$ (i.e., $\sin^2(t)=(1-\cos(2t))/2$) and another substitution to take care of $\sin(t)\cos(t)$ (i.e., $u=\sin(t)$ so $du=\cos(t)\,dt$). The top we parameterize in the opposite direction: $-C_2$: $\B r(t) = \langle 2\cos(t),2\sin(t),4\rangle$, $0 \leq t \leq 2\pi$. Thus $\B r'(t) = \langle -2\sin(t), 2\cos(t),0\rangle$ and so $\int_{-C_2} \B F \bdot d\B r = \int_0^{2\pi} \langle 2\sin(t)+4\cos^2(t),2\sin(t),2\cos(t)\cdot 4+5 \rangle \bdot \langle -2\sin(t),2\cos(t),0\rangle\,dt = \int_0^{2\pi} -4\sin^2(t)+8\cos^2(t)(-\sin(t))+4\sin(t)\cos(t)\,dt=-4\pi$ where we evaluate much like the previous integral. Therefore, $\int_{\partial S_1} \B F \bdot d\B r = \int_{C_1}\B F \bdot d\B r+\int_{C_2} \B F\bdot d\B r = -\pi-(-4\pi)=$ \fbox{$3\pi$}.

\vspace{0.05in}

To evaluate the flux side, we need the curl of $\B F$ first: $\nabla \times \B F = \langle 0-0,-(z-0),0-1\rangle = \langle 0,-z,-1\rangle$. Next, we need to paramterize our surface. It is natural to do so in cylindrical coordinates where $z=x^2+y^2=r^2$ and so $1\leq z=r^2 \leq 4$ implies $1 \leq r \leq 2$. We have $\B r(r,\theta) = \langle r\cos(\theta),r\sin(\theta),r^2\rangle$ where $1\leq r \leq 2$ and $0 \leq \theta \leq 2\pi$. Now we need the derivative of our parameterization: $\B r_r = \langle \cos(\theta),\sin(\theta),2r\rangle$, $\B r_\theta = \langle -r\sin(\theta),r\cos(\theta),0\rangle$, and so $\B r_r \times \B r_\theta = \langle -2r^2\cos(\theta),-2r^2\sin(\theta),r\rangle$. But we need to orient downward, so the $\B k$-component of our derivative must be negative. Thus we have $\B n\,d\sigma = -\B r_r \times \B r_\theta = \langle 2r^2\cos(\theta),2r^2\sin(\theta),-r\rangle\,dA$ since $-r<0$. Finally, remember to plug $z=r^2$ (from our parameterization) into $\nabla \times \B F$. We get: $\iint_{S_1} (\nabla \times \B F) \bdot \B n \,d\sigma = \int_0^{2\pi} \int_1^2 \langle 0,-r^2,-1\rangle \bdot \langle 2r^2\cos(\theta),2r^2\sin(\theta),-r\rangle \,dr\,d\theta = \int_0^{2\pi}\int_1^2 -2r^4\sin(\theta)+r\,dr\,d\theta = \int_0^{2\pi}\,d\theta \int_1^2 r\,dr = 2\pi \dfrac{1}{2}(2^2-1^1) =$ \fbox{$3\pi$} just like we needed! {\it Note:} I threw away the $-2r^4\sin(\theta)$ term since $\sin(\theta)$ was being integrated over a full $2\pi$-period and thus contributed $0$. 

\end{document}

