\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}


%%% For sphere surface plot
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{tikz-3dplot}
\usetikzlibrary{3d}

% small fix for canvas is xy plane at z % https://tex.stackexchange.com/a/48776/121799
\makeatletter
\tikzoption{canvas is xy plane at z}[]{%
    \def\tikz@plane@origin{\pgfpointxyz{0}{0}{#1}}%
    \def\tikz@plane@x{\pgfpointxyz{1}{0}{#1}}%
    \def\tikz@plane@y{\pgfpointxyz{0}{1}{#1}}%
    \tikz@canvas@is@plane}

% view={<azimuth>,<elevation>} key
\tikzset{
    view/.code args={#1,#2}{%
        % Set elevation and azimuth angles
        \pgfmathsetmacro\view@az{#1}
        \pgfmathsetmacro\view@el{#2}
        % Calculate projections of rotation matrix
        \pgfmathsetmacro\xvec@x{cos(\view@az)}
        \pgfmathsetmacro\xvec@y{-sin(\view@az)*sin(\view@el)}
        \pgfmathsetmacro\yvec@x{sin(\view@az)}
        \pgfmathsetmacro\yvec@y{cos(\view@az)*sin(\view@el)}
        \pgfmathsetmacro\zvec@x{0}
        \pgfmathsetmacro\zvec@y{cos(\view@el)}
        % Set base vectors
        \pgfsetxvec{\pgfpoint{\xvec@x cm}{\xvec@y cm}}
        \pgfsetyvec{\pgfpoint{\yvec@x cm}{\yvec@y cm}}
        \pgfsetzvec{\pgfpoint{\zvec@x cm}{\zvec@y cm}}
    },
}
\makeatother

\tikzset{
    dot/.style={
        circle,
        fill,
        minimum size=#1,
        inner sep=0pt,
        outer sep=0pt
    },
    dot/.default = 4pt,
    hemisphere/.style={
        ball color=gray!20!white,
        fill=none,
        opacity=0.3,
    },
    equator/.style={
        thick,
        gray!90,
    },
    axis/.style={
        thick,
        -stealth,
        black!60,
        every node/.style={
            text=black,
            at={([turn]1mm,0mm)}
        },
    },
}

\pgfmathsetmacro{\radius}{5}
\pgfmathsetmacro\el{10}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\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}

\noindent
\parbox{2in}{\bf Math 2130}
\hfill {\Large \bf Final Exam} \hfill
\parbox{2in}{\bf \hfill June $28^\mathrm{th}$\!,\  2019}

\vspace{0.1in}

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

\vspace{0.1in}

\noindent
{\bf\large 1. (7 points)} Let $\B F(x,y,z) = \la x^2+yz, y+e^z, \sin(xy^2) \ra$. Compute $\nabla \times \B F$ and $\nabla \bdot \B F$.\\ \force \hfill If $\B F$ conservative? {\Large \quad Yes \quad / \quad \fbox{No}}

\vspace{-0.05in}

First, the curl of $\B F$ is $\nabla \times \B F =$

\vspace{-0.15in}

$$ \hspace*{-0.1in} \begin{vmatrix} \B i & \B j & \B k \vspace{0.025in} \\ \vspace{0.025in} \frac{\partial}{\partial x} & \frac{\partial}{\partial y} &  \frac{\partial}{\partial z} \\ x^2+yz & y+e^z & \sin(xy^2) \end{vmatrix}
= \left\langle \frac{\partial}{\partial y}\left[ \sin(xy^2) \right] - \frac{\partial}{\partial z}\left[ y+e^z \right], -\left(\frac{\partial}{\partial x}\left[ \sin(xy^2) \right] - \frac{\partial}{\partial z}\left[ x^2+yz \right]\right), \frac{\partial}{\partial x}\left[ y+e^z \right] - \frac{\partial}{\partial y}\left[ x^2+yz \right] \right\rangle =
$$

\fbox{$\nabla \times \B F =\left\langle 2xy\cos(xy^2)-e^z, -y^2\cos(xy^2)+y, -z \right\rangle$} \quad ($\nabla \times \B F \not= \B 0$ so $\B F$ is not conservative.)

\vspace{-0.05in}

$$\text{The Divergence of $\B F$ is } \nabla \bdot \B F = \left\langle \frac{\partial}{\partial x}, \frac{\partial}{\partial y}, \frac{\partial}{\partial z} \right\rangle \bdot \left\langle  x^2+yz, y+e^z, \sin(xy^2) \right\rangle = \frac{\partial}{\partial x}\left[ x^2+yz \right] + \frac{\partial}{\partial y}\left[ y+e^z \right] + \frac{\partial}{\partial z}\left[ \sin(xy^2) \right]=$$

\vspace{-0.05in}

\fbox{$\nabla \bdot \B F = 2x+1$}

\vspace{0.1in}

\noindent
{\bf\large 2. (11 points)} Let $\B F(x,y,z) = \left\la 2xyz+1, x^2z+z, x^2y+y+2z \right\ra$.  This is a conservative vector field (I've checked for you).

\begin{enumerate}[(a)]
\item Use the fundamental theorem of line integrals to compute $\int_C \B F \bdot d\B r$ where $C$ is the line segment from $(1,-1,0)$ to $(1,2,2)$.

\vspace{0.05in}

First, we construct a potential function: $f(x,y,z) = \int (2xyz+1)\,dx = x^2yz+x+C_1(y,z)$ and $f(x,y,z) = \int (x^2z+z)\,dy = x^2yz+yz+C_2(x,z)$ and $f(x,y,z) = \int (x^2y+y+2z)\,dz = x^2yz+yz+z^2+C_3(x,y)$. Thus \underline{$f(x,y,z) = x^2yz+x+yz+z^2$} (plus any constant). 

By the fundamental theorem of line integrals, 

\vspace{-0.15in}

$$\int_C \B F \bdot d\B r = \int_C \nabla f \bdot d\B r = f(1,2,2)-f(1,-1,0) = (4+1+4+4)-(0+1+0+0)=13-1=\mbox{\fbox{$12$}}$$

\vspace{-0.05in}

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

\vspace{0.05in}

The standard parameterization of a line segment from $A$ to $B$ is $\B r(t) = A + (B-A)t$ for $0 \leq t \leq 1$. Thus we have $\B r(t) = \la 1,-1,0 \ra + \la 0,3,2 \ra t = \la 1,3t-1,2t \ra$ for $0 \leq t \leq 1$. The derivative of this parameterization is $\B r'(t) = \la 0,3,2\ra$. 

\vspace{-0.15in}

$$\int_C \B F \bdot d\B r = \int_0^1 \B F(\B r(t)) \bdot d\B r = \int_0^1 \la 2(1)(3t-1)(2t)+1, 1^2(2t)+2t, 1^2(3t-1)+(3t-1)+2(2t)\ra \bdot \la 0,3,2 \ra \,dt$$

\vspace{-0.25in}

$$=  \int_0^1 \la 12t^2-4t+1, 4t, 10t-2 \ra \bdot \la 0,3,2 \ra \,dt = \int_0^1 0+12t+2(10t-2) \,dt = \int_0^1 32t-4\,dt = 16t^2-4t\Bigg|_0^1 = 16-4= \mbox{\fbox{$12$}}$$

\vspace{0.05in}

\end{enumerate}

\noindent
{\bf\large 3. (10 points)} Let $C$ be the boundary of a triangle with vertices $(0,-1)$, $(2,-1)$, and $(2,3)$ oriented counter-clockwise. 
Compute $\displaystyle \int_C \left(\cos(x^6+e^{3x})+y\right)\,dx+\left(x^2+\ln(y^8+3)\right)\,dy$.

\vspace{0.05in}

\begin{minipage}{1.25in}
\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=4cm, height=5.33cm,     % size of the image = rigged to keep scaling=constrained
  ymin=-1.5, ymax=3.5, %ytick={0}, ylabel={},
  xmin=-0.5, xmax=2.5, %xtick={0}, xlabel={},
]

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

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

\addplot[name path=C,black, thick, domain=-1:3, smooth] ({2}, {x});

\addplot[black, thick, domain=-2:-0.75, smooth, -{>[scale=2]}]  ({-x}, {-2*x-1});
\addplot[black, thick, domain=0:1, smooth,  -{>[scale=2]}] ({x}, {-1});
\addplot[black, thick, domain=-1:1, smooth,  -{>[scale=2]}] ({2}, {x});

\node at (axis cs:1.35,0.2) {$R$};

\node at (axis cs: 0.8,1.7) {$C$};

\end{axis}
\end{tikzpicture}
\end{minipage}
\hfill
\begin{minipage}{6in}
Notice that $C=\partial R$ (it's the properly oriented boundary of $R$). Thus we can apply Green's theorem (instead of working through 3 nasty line integrals along line segments). 

\vspace{0.05in}

This triangular region $R$ is bounded below by the line $y=-1$, above by $y=2x-1$, and on the right by $x=2$. Thus we can describe it as a $y$-simple region as follows: $-1 \leq y \leq 2x-1$ and $0 \leq x \leq 2$. Then noting that $M(x,y)=\cos(x^6+e^{3x})+y$ and $N(x,y)=x^2+\ln(y^8+3)$,  we have 

\vspace{0.05in}

$\displaystyle \int_C M\,dx+N\,dy = \iint_R (N_x-M_y)\,dA = \int_0^2 \int_{-1}^{2x-1} (2x-1)\,dy\,dx = \int_0^2 (2x-1)y\Big|_{-1}^{2x-1}\,dx$

$\displaystyle = \int_0^2 (2x-1)(2x-1)-(2x-1)(-1)\,dx = \int_0^2 4x^2-2x\,dx = \dfrac{4}{3}x^3-x^2\Big|_0^2 = \dfrac{32}{3}-4 =$ \fbox{$\dfrac{20}{3}$}
\end{minipage}

\vspace{0.05in}

\newpage

\force
\vspace{0.35in}

\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_1$};
\node at (axis cs: 0.35,1.2) {$C_2$};
\node at (axis cs: -0.5,-0.35) {$C_3$};


\end{axis}
\end{tikzpicture}


\vspace{-1.75in}

\noindent
{\bf\large 4. (9 points)} $C_1$ is an upper-half of a circle of radius 3 (oriented clockwise), $C_2$ is a circle of radius 1 (oriented counter 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 = 2\pi$ and $\displaystyle \int_{C_3} \B F \bdot d\B r = \pi$. {\it Note:} The area of $R$ is $7\pi/2$.

\vspace{0.05in}

\noindent 
First, we could have figured out the area ourselves: a half disk of radius 3 has area $\dfrac{\pi 3^2}{2}$\\ and we remove the area of a disk of radius $1$ which is $\pi 1^2$. Thus area is $\dfrac{9\pi}{2}-\pi = \dfrac{7\pi}{2}$.

\vspace{0.05in}

\noindent
Notice that $\partial R = C_3-C_1-C_2$ since we go around the outer boundary of $R$ in a counter-\\clockwise direction: $C_3-C_1$ and we go around an inner boundary in a clockwise direction: $-C_2$.\\ Green's (with holes) tells us that\dots  \qquad (Don't forget $N_x-M_y=4$.)

\vspace{-0.25in}

$$4\cdot \mathrm{Area}(R) = \iint_R 4\,dA = \iint_R (N_x - M_y)\,dA = \int_{\partial R} Mdx+Ndy = \int_{C_3} Mdx+Ndy - \int_{C_1} Mdx+Ndy  - \int_{C_2} Mdx+Ndy$$

\vspace{-0.05in}

\noindent
So $4 \cdot \frac{7\pi}{2} = \pi - \int_{C_1} Mdx+Ndy - 2\pi$. Therefore,


\noindent
Compute $\displaystyle \int_{C_1} M(x,y)\,dx + N(x,y)\,dy \quad = \quad \underline{\quad \pi-2\pi-14\pi = \mbox{\fbox{$-15\pi$}} \quad}$.

\vspace{0.1in}

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

\vspace{-0.1in}

\noindent
\hspace*{-0.2in}
\begin{minipage}{2in}
\begin{tikzpicture}[scale=0.5,
        view={45,\el}, % {<azimuth>}{<elevation>}
    ]
        \coordinate (O) at (0,0,0);

        % shaded southern hemisphere: (on bottom)
        \fill[
            hemisphere,
            delta angle=180,
            x radius=\radius cm
        ] (\radius cm,0)
            \ifnum\el=0
                -- ++(-2*\radius,0,0)
            \else
                arc [y radius={\radius*sin(\el)*1cm},start angle=0]
            \fi
            arc [y radius=\radius cm,start angle=-180];

        % another hemisphere (on top)
        \fill[
            hemisphere,
            delta angle=180,
            x radius=\radius cm,
        ] (\radius cm,0)
            arc [y radius={\radius*sin(\el)*1cm},start angle=0,delta angle=-180]
            arc [y radius=\radius cm,start angle=-180];

        % equator
        \draw[equator,canvas is xy plane at z=0] (O) circle (\radius);

        % two semicircles
  %      \foreach \ang in {-45,45}{
%            \begin{scope}[rotate around z=\ang]
%                \draw[canvas is xz plane at y=0,thick,color=gray!90] (0,0) ++(0:\radius) arc (0:-180:\radius);
%                \node[dot] at (\radius,0,0) {};
%                \node[dot] at (-\radius,0,0) {};
%            \end{scope}
%        }

        % axes
%        \begin{scope}[scale=1.1*\radius]
%            \draw[axis] (-1, 0, 0) -- (1,0,0  ) node {$X$};
%            \draw[axis] ( 0,-1, 0) -- (0,1,0  ) node {$Y$};
%            \draw[axis] ( 0, 0,-1) -- (0,0,0.5) node {$Z$};
%        \end{scope}

\draw[axis] (0,0,0) -- (0,0,2.5) node[midway,left] {$S_2$};

\draw[axis] (-3.214, 0., -3.830) -- (-1.607, 0., -1.915) node[midway,left] {$S_1$};

    \end{tikzpicture}
\end{minipage}
\hfill
\begin{minipage}{5.25in}
We are going to ``swap surfaces''. Notice that $\partial E = S_2-S_1$ (we need to orient outward) is the boundary of the solid lower ball $E$: $x^2+y^2+z^2 \leq 1$, $z \leq 0$. Thus we can apply the divergence theorem: 

\vspace{-0.15in}

$$\iiint_E \nabla \bdot \B F \,dV = \iint_{\partial E} \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$$

$$\hspace*{-0.15in}  \iint_{S_2} \B F \bdot \B n \,d\sigma =  \iint_{S_1} \B F \bdot \B n \,d\sigma + \iiint_E \nabla \bdot \B F \,dV =  10\pi + \iiint_E \nabla \bdot \B F \,dV$$

since we were given $ \iint_{S_1} \B F \bdot \B n \,d\sigma = 10\pi$. Thus we just need to compute the triple integral $\iiint_E \nabla \bdot \B F \,dV = \iiint_E 5x^2+5y^2+5z^2\,dV$ 
to find our answer.
\end{minipage}

\vspace{0.05in}

Obviously we should compute this integral using spherical coordinates. Then $E$: $\rho^2 = x^2+y^2+z^2 \leq 1$ gives $0 \leq \rho \leq 1$ and $z \leq 0$ (lower-half of 3-space) says $\pi/2 \leq \varphi \leq \pi$ and there's no need to cut down $\theta$ so $0 \leq \theta \leq 2\pi$. Finally, $5x^2+5y^2+5z^2=5\rho^2$ and don't forget the Jacobian!

\vspace{-0.2in}

$$\iiint_E 5x^2+5y^2+5z^2\,dV = \int_0^{2\pi} \int_{\pi/2}^\pi \int_0^1 5\rho^2 \cdot \rho^2\sin(\varphi)\,d\rho\,d\varphi\,d\theta = \int_0^{2\pi}\,d\theta \int_{\pi/2}^\pi \sin(\varphi)\,d\varphi \int_0^1 5\rho^4 \,d\rho = 2\pi \cdot 1 \cdot 1 = 2\pi$$

\vspace{-0.1in}

Therefore, $\displaystyle  \iint_{S_2} \B F \bdot \B n \,d\sigma =  \iint_{S_1} \B F \bdot \B n \,d\sigma + \iiint_E \nabla \bdot \B F \,dV =  10\pi + 2\pi =$ \fbox{$12\pi$}.

\vspace{0.1in}

\noindent
{\bf\large 6. (12 points)} Find the centroid of the part of the cone $z=3\sqrt{x^2+y^2}$ where $z \leq 6$.\\ \force \hfill Note: This is a {\bf surface}. You should be computing {\bf surface integrals}.

\vspace{-0.1in}

\[ 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}

\noindent
\begin{minipage}{6in}
Clearly, by symmetry $\bar{x}=\bar{y}=0$ (the centroid lies on the $z$-axis). We need to compute $\bar{z}=M_{xy}/m$. Our first, step is to parameterize the cone. Our best choice is to use cylindrical coordinates. Then $z=3\sqrt{x^2+y^2}=3r$, so $\B r(r,\theta) = \la r\cos(\theta),r\sin(\theta),3r \ra$. There's no need to cut down $\theta$: $0 \leq \theta \leq 2\pi$.   And we have $3r=z\leq 6$ so $0 \leq r \leq 2$. 

\vspace{0.05in}

Next, we need to compute our surface area element. Note that $\B r_r = \la \cos(\theta), \sin(\theta), 3 \ra$, $\B r_\theta = \la -r\sin(\theta), r\cos(\theta),0 \ra$, and so $\B r_r \times \B r_\theta = \la -3r\cos(\theta), -3r\sin(\theta), r \ra = r \la -3\cos(\theta), -3\sin(\theta), 1\ra$. Thus $|\B r_r \times \B r_\theta| = r\sqrt{9\cos^2(\theta)+9\sin^2(\theta)+1}=r\sqrt{10}$. 

\vspace{0.05in}

$\displaystyle m = \iint_{S_1} 1\,d\sigma = \int_0^{2\pi} \int_0^2 r\sqrt{10}\,dr\,d\theta = \sqrt{10} \int_0^{2\pi}d\theta \int_0^2 r\,dr = \sqrt{10} \cdot 2\pi \cdot \dfrac{2^2}{2} = 4\pi\sqrt{10}$

$\displaystyle M_{xy} = \iint_{S_1} z\,d\sigma = \int_0^{2\pi} \int_0^2 3r\cdot r\sqrt{10}\,dr\,d\theta = \sqrt{10} \int_0^{2\pi}d\theta \int_0^2 3r^2\,dr = \sqrt{10} \cdot 2\pi \cdot 2^3 = 16\pi\sqrt{10}$

Therefore, $\bar{z} = M_{xy}/m = 16\pi\sqrt{10}/4\pi\sqrt{10} = 4$, so \fbox{$(\bar{x},\bar{y},\bar{z}) = (0,0,4)$}.
\end{minipage}
\hfill
\begin{minipage}{1.25in}
\begin{tikzpicture}[scale=0.65] %[font=\tiny]
 \fill[green,opacity=0.75] (0,0) --  (2,5.94) -- (-2,5.94) -- (0,0) -- cycle;
 \fill (0,0) circle (2pt);
 \draw[shorten >= 2pt] (0,0) -- (2.02,6);
% \draw[shorten >= 2pt] (0,0) --node[xshift=3mm]{$\sqrt{2}R$} (-2.02,2);
 \draw[shorten >= 2pt] (0,0) -- (-2.02,6);
 \filldraw[draw=black,outer color=green!25,inner color=green!25] (0,6) circle[x radius=2,y radius=0.3];

\fill (0,4) circle (2pt);
%\draw (0,2) -- node[yshift=1mm]{$R$} (2,2) (0,2) -- +(0,2.5);

\draw[dash pattern=on 2pt off 2pt] (0,0) -- (0,6) ;
\draw[dash pattern=on 2pt off 2pt] (0,0) -- (-1.5,0) ;
\draw[dash pattern=on 2pt off 2pt] (0,0) -- (30:1.25) ;

\draw[->] (0,0) -- (210:1.25) ;
\draw[->] (0,0) -- (1.5,0) ;
\draw[->] (0,6) -- (0,7);
 \end{tikzpicture}
\end{minipage}

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

{\it Note:} While we don't need to know this to complete this problem, it is interesting to note that $S_1$ is a part of the paraboloid $z=9-x^2-y^2$ parameterized with cylindrical like coordinates.

\begin{enumerate}[(a)]
\item Find both orientations for $S_1$.
   
$\B r_u = \la \cos(v), \sin(v), -2u \ra$, $\B r_v = \la -u\sin(v), u\cos(v), 0 \ra$, and so $\B r_u \times \B r_v = \la 2u^2\cos(v),2u^2\sin(v),u \ra = u \la 2u\cos(v),2u\sin(v),1\ra$.
Thus $|\B r_u \times \B r_v| = u\sqrt{4u^2\cos^2(v)+4u^2\sin^2(v)+1} = u\sqrt{4u^2+1}$.

Therefore, $\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{4u^2+1}}\la 2u\cos(v),2u\sin(v),1\ra$}.

   
\item Set up but {\bf do not evaluate} the surface integral $\displaystyle \iint_{S_1} z\ln(x^2+y^2+1)\,d\sigma$. \quad [Don't worry about simplifying.] 

We already know that $d\sigma = |\B r_u \times \B r_v|\,dA = u\sqrt{4u^2+1}\,dA$ and notice that $x^2+y^2=(u\cos(v))^2+(u\sin(v))^2=u^2$. Thus
$\displaystyle \iint_{S_1} z\ln(x^2+y^2+1)\,d\sigma=$ \fbox{$\displaystyle \int_\pi^{2\pi}\int_1^2 (9-u^2)\ln(u^2+1)\cdot u\sqrt{4u^2+1}\,du\,dv$}.

\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 xz,y,x+y \ra$. \quad [Don't worry about computing the dot product or any significant simplification.] 

We know that $\B n\,d\sigma = \pm \dfrac{\B r_u \times \B r_v}{|\B r_u \times \B r_v|}  |\B r_u \times \B r_v|  = \pm  \B r_u \times \B r_v$. Pointing upward or downward depends on the $\B k$-component of our orientation. Notice that this component is $\pm 1/\sqrt{4u^2+1}$ so we need to choose the minus sign to make the $\B k$-component negative and thus orient downward. Therefore,

\force \hfill \fbox{$\displaystyle \iint_{S_1} \B F \bdot \B n\,d\sigma = \int_\pi^{2\pi}\int_1^2 \la u\cos(v)\cdot(9-u^2),u\sin(v),u\cos(v)+u\sin(v)\ra \bdot \la -2u^2\cos(v),-2u^2\sin(v),-u \ra \,du\,dv$} \hfill \force

\end{enumerate}


\noindent
{\bf\large 8. (11 points)} Let $S_1$ be the surface of the solid cylinder defined by $x^2+y^2 \leq 4$ and $-2 \leq z \leq 3$. Orient $S_1$ outward and let $\B F(x,y,z) = \left\la 4xy^2 +\cos(y^{15}+z), \ln(x^2+z^4+1)+2y, 4x^2z+e^{x^3y} \right\ra$.  Compute the flux integral $\iint_{S_1} \B F \bdot \B n\,d\sigma$.

\vspace{0.05in}

Our surface is the surface of a solid (i.e., it's a closed surface) and oriented outward. This means we can apply the divergence theorem. Let $E$ be this solid region: $x^2+y^2 \leq 4$ and $-2 \leq z \leq 3$ so that $\partial E = S_1$. Also, notice that $\nabla \bdot \B F = 4y^2+2+4x^2$. Considering our solid region and the intended integrand, cylindrical coordinates are an obvious choice. In cylindrical coordinates $E$ is described by $r^2 \leq 4$ (so $0 \leq r \leq 2$, $-2 \leq z \leq 3$, and $0 \leq \theta \leq 2\pi$. (Don't forget the Jacobian!)

$\displaystyle \iint_{S_1} \B F \bdot \B n\,d\sigma = \iiint_E \nabla \bdot \B F\,dV = \iiint_E 4(x^2+y^2)+2\,dV = \int_0^{2\pi}\int_0^2\int_{-2}^3 (4r^2+2)\,r\,dz\,dr\,d\theta
$\\ \force \hfill $=\displaystyle \int_0^{2\pi}d\theta \int_0^2 (4r^3+2r)\,dr \int_{-2}^3\,dz = 2\pi \cdot (2^4+2^2) \cdot 5 =$ \fbox{$200\pi$}

\vspace{0.05in}

\noindent
{\bf\large 9. (15 points)} Let $S_1$ be the upper hemisphere: $x^2+y^2+z^2=4$ and $z \geq 0$. Orient $S_1$ downward.\\ \force \hfill  Verify Stokes' Theorem for the surface $S_1$, its boundary, and the vector field $\B F(x,y,z) = \la z,x,x \ra$. 

\noindent
\hspace*{-0.2in}
\begin{minipage}{2in}
\tdplotsetmaincoords{60}{110}

\pgfmathsetmacro{\radius}{1}
\pgfmathsetmacro{\thetavec}{0}
\pgfmathsetmacro{\phivec}{0}

%start tikz picture, and use the tdplot_main_coords style to implement the display 
%coordinate transformation provided by 3dplot
\begin{tikzpicture}[scale=2,tdplot_main_coords]
%draw the main coordinate system axes
\draw[dash pattern=on 2pt off 2pt,<->] (-1.35,0,0) -- (1.35,0,0) node[anchor=north]{$x$};
\draw[dash pattern=on 2pt off 2pt,<->] (0,-1.35,0) -- (0,1.35,0) node[anchor=north west]{$y$};
\draw[dash pattern=on 2pt off 2pt,->] (0,0,0) -- (0,0,1.35) node[anchor=south]{$z$};

\tdplotsetthetaplanecoords{\phivec}

% Maple calculation
% r := (rho,phi,theta) -> [rho*cos(theta)*sin(phi),rho*sin(theta)*sin(phi),rho*cos(phi)];
% evalf(r(1,50*Pi/180,-35*Pi/120),4);
% evalf(r(0.5,50*Pi/180,-35*Pi/120),4);
\filldraw (0.4662, -0.6079, 0.6427) circle (0.5pt);
\draw[thick,->] (0.4662, -0.6079, 0.6427) -- (0.2331, -0.3040, 0.3214);

\draw[thick] (\radius,0,0) arc [start angle=0,end angle=360,x radius=\radius,y radius=\radius];
\draw[thick,-<] (\radius,0,0) arc [start angle=0,end angle=45,x radius=\radius,y radius=\radius];

%\draw[dashed] (\radius,0,0) arc (0:360:\radius);
\shade[ball color=blue!10!white,opacity=0.75] (1cm,0) arc (0:-180:1cm and 5mm) arc (180:0:1cm and 1cm);
% (-z x y)
\draw (0, 1, 0) node [circle, fill=blue, inner sep=.02cm] () {};
\draw (0, 0, 1) node [circle, fill=green, inner sep=.02cm] () {};
\draw (-1, 0, 0) node [circle, fill=red, inner sep=.02cm] () {};

\draw (0.5, 0.8, 0.65) node[left] {$S_1$};
\draw (0.85, 0.85, 0) node[right] {$\partial S_1$};

\end{tikzpicture}
\end{minipage}
\hfill
\begin{minipage}{5.25in}
We've drawn the upper-hemisphere to the left noting the downward orientation. The boundary of $S_1$ is the equator $x^2+y^2+0^2=4$ with $z=0$. The equator's induced orientation flows from the positive $y$-axis to the $x$-axis. This means that our circular boundary is \underline{\bf oriented clockwise}. [If it's hard to see why the arrow is drawn in that direction, consider the opposite orientation and think of someone walking on top of the sphere. If they keep the sphere to their left as they walk along the edge, they'll go in the counter-clockwise direction. Thus ours should be opposite that.]

\vspace{0.05in}

We need to show: $\displaystyle \begin{array}{ccc} \iint_{S_1} (\nabla \times \B F) \bdot \B n\,d\sigma & = & \int_{\partial S_1} \B F \bdot d\B r \vspace{0.05in} \\ \mbox{\fbox{\small I}} & & \mbox{\fbox{\small II}} \end{array}$

\end{minipage}

\newpage

\begin{enumerate}[I.]
\item First, $\nabla \times \B F = \begin{vmatrix} \B i & \B j & \B k \vspace{0.025in} \\ \vspace{0.025in} \frac{\partial}{\partial x} & \frac{\partial}{\partial y} &  \frac{\partial}{\partial z} \\ z & x & x \end{vmatrix} = \la 0,0,1 \ra$. Next, we need to parameterize $S_1$ (use spherical coordinates).
$S_1$ is part of the sphere $\rho^2=x^2+y^2+z^2=4$ so $\rho=2$ thus we parameterize with $\B r(\varphi,\theta) = \la 2\cos(\theta)\sin(\varphi), 2\sin(\theta)\sin(\varphi), 2\cos(\varphi) \ra$ where $0 \leq \varphi \leq \pi/2$ (only the upper-hemisphere) and $0 \leq \theta \leq 2\pi$. Next, we need the ``derivative'' or our parameterization. 

$\B r_\varphi = \la 2\cos(\theta)\cos(\varphi), 2\sin(\theta)\cos(\varphi), -2\sin(\varphi)$, $\B r_\theta = \la -2\sin(\theta)\sin(\varphi), 2\cos(\theta)\sin(\varphi), 0 \ra$ and so\\ 
$\B r_\varphi \times \B r_\theta = \la 4\cos(\theta)\sin^2(\varphi), 4\sin(\theta)\sin^2(\varphi), 4\sin(\varphi)\cos(\varphi) \ra$. Recall that $\B n\,d\sigma = \pm \B r_\varphi \times \B r_\theta\,dA$. We wish to orient downward so once again we look at the $\B k$-component: $4\sin(\varphi)\cos(\varphi)$. Now both $\sin(\varphi)$ and $\cos(\varphi)$ are non-negative when $0 \leq \varphi \leq \pi/2$, so we need to flip that sign to make the $\B k$-component negative (i.e., point downward). Thus we should use $-\B r_\varphi \times \B r_\theta = \la -4\cos(\theta)\sin^2(\varphi), -4\sin(\theta)\sin^2(\varphi), -4\sin(\varphi)\cos(\varphi) \ra$ in our calculation. Now we're ready to write down our integral.

$\displaystyle \iint_{S_1} (\nabla \times \B F) \bdot \B n\,d\sigma = \int_0^{2\pi}\int_0^{\pi/2} \la 0,0,1 \ra \bdot \la -4\cos(\theta)\sin^2(\varphi), -4\sin(\theta)\sin^2(\varphi), -4\sin(\varphi)\cos(\varphi) \ra \,d\varphi\,d\theta$\\ \force \hfill
$\displaystyle =\int_0^{2\pi}\int_0^{\pi/2} -4\sin(\varphi)\cos(\varphi)\,d\varphi\,d\theta = \int_0^{2\pi}\,d\theta \int_0^{\pi/2} -4\sin(\varphi)\cos(\varphi)\,d\varphi = 2\pi \left[\text{\Large\strut\hspace*{-0.05in}}-2\sin^2(\varphi)\right|_0^{\pi/2} =$ \fbox{$-4\pi$}. 

\item To compute the line integral side, we need to begin by parameterizing $\partial S_1$. Now $S_1$ is the circle $x^2+y^2=4$, $z=0$ oriented clockwise. Consider $\B r(t) = \la 2\cos(t),2\sin(t),0 \ra$ with $0 \leq t \leq 2\pi$. Then $\B r(t)$ parameterizes $-\partial S_1$ since this standard parameterization goes around the circle in a counter-clockwise direction (this is fine -- we'll fix the sign at the end). Next, we need the derivative of our parameterization: $\B r'(t) = \la -2\sin(t),2\cos(t),0\ra$. Now we can plug everything in.

$\displaystyle \int_{-\partial S_1} \B F \bdot d\B r = \int_{-\partial S_1} \la z,x,x\ra \bdot d\B r = \int_0^{2\pi} \B F(\B r(t)) \bdot \B r'(t)\,dt = \int_0^{2\pi} \la 0,2\cos(t),2\cos(t) \ra \bdot \la -2\sin(t),2\cos(t),0 \ra \,dt$\\ \force \hfill
$\displaystyle = \int_0^{2\pi} 4\cos^2(t)\,dt = \int_0^{2\pi} 2(1+\cos(2t))\,dt = \int_0^{2\pi} 2+2\cos(2t)\,dt=4\pi$. 

Therefore, $\displaystyle \int_{\partial S_1} \B F \bdot d\B r =$ \fbox{$-4\pi$} as we figured out before.
\end{enumerate}
\end{document}

