\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.4in}
\setlength{\textwidth}{7.5in}


\usepackage{tikz,pgfplots}
\usepgfplotslibrary{fillbetween}


\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 Test \#3} \hfill
\parbox{2in}{\bf \hfill June $24^\mathrm{th}$\!,\  2019}

\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. (13 points)} Working hard.

\begin{enumerate}[(a)]

\item Let $\B F(x,y,z) = \la xy^5,zx,1 \ra$ and $C$ be the curve parameterized by $\B r(t) = \left\la 3\cos(t), 7t, 3\sin(t) \right\ra$ where $-\pi \leq t \leq 4\pi$.

Set up but {\bf do not} evaluate the line integral: $\displaystyle \int_C \B F \bdot d\B r$.

Notice that according to our parameterization, $x(t)=3\cos(t)$, $y(t)=7t$, $z(t)=3\sin(t)$, and $\B r'(t) = \la -3\sin(t), 7, 3\cos(t) \ra$. Thus\dots

\vspace{-0.2in}

$$ \int_C \B F \bdot d\B r = \int_{-\pi}^{4\pi} \la 3\cos(t)\cdot(7t)^5, 3\sin(t)\cdot 3\cos(t),1 \ra \bdot \la -3\sin(t),7, 3\cos(t) \ra\,dt =$$
$$\mbox{\fbox{$\displaystyle \int_{-\pi}^{4\pi} -9\cos(t)\sin(t)\cdot(7t)^5+63\sin(t)\cos(t)+3\cos(t)\,dt$}}$$


\item Let $C$ be the line $y=2x-1$ where $1 \leq x \leq 2$. Compute $\displaystyle \int_{C} (y+1)\,dx+x\,dy$.

We use the Monge parametrization: $\B r(x) = \la x,2x-1 \ra$ where $1 \leq x \leq 2$ so that $\B r'(x) = \la 1,2 \ra$. This means $dx=dx$ and $dy=2\,dx$. Therefore,

\vspace{-0.25in}

$$\hspace*{0.75in} \int_C (y+1)\,dx+x\,dy = \int_1^2 ((2x-1)+1)(1)+x(2)\,dx = \int_1^2 4x\,dx = 2x^2\Big|_1^2 = 8-2= \mbox{\fbox{$6$}}$$


\end{enumerate}


\noindent {\bf\large 2. (12 points)} Let $R$ be the region bounded by $y=5-x^2$ and $y=x-1$ (pictured below).\\ 
\force \hfill [{\it Warning:} One of the integrals below will have to be split into 2 pieces.]

\begin{minipage}{5in}
\begin{enumerate}[(a)]
%\item Sketch the region $R$.
\item Set up the integral $\displaystyle\iint\limits_R 2xy\,dA$ in the order of integration: ``$dy\,dx$''.
\item Set up the integral $\displaystyle\iint\limits_R 2xy\,dA$ in the order of integration: ``$dx\,dy$''.
\end{enumerate}

{\bf Do not} evaluate these integrals.
\end{minipage}
\hfill
\begin{minipage}{1.5in}
% plot of wedge of circle as in Fall 2016's test #3 problem 3
%
%\begin{tikzpicture}
%\begin{axis}[
%  axis x line=middle, axis y line=middle,
%  width=5cm, height=2.5/3*5cm,     % size of the image = rigged to keep scaling=constrained
%  ymin=-0.5, ymax=2, ytick={0}, ylabel=$y$,
%  xmin=-0.5, xmax=2.5, xtick={0}, xlabel=$x$,
%]
%
%% fix glitchy fill 
%\addplot[name path=C,black!15, domain=0:1, smooth] ({2*x}, {0});
%\addplot[name path=D,black!15, domain=0:1, smooth] ({sqrt(2)*(1-x)}, {sqrt(2)*(1-x)});
%\addplot[black!15] fill between[of=C and D];
%\addplot[black, domain=0:1, smooth] ({2*x},{0});
%
%\addplot[name path=A,black, thick, domain=0:45, smooth] ({2*cos(x)}, {2*sin(x)});
%\addplot[name path=B,black, thick, domain=0:sqrt(2), smooth] ({x}, {x});
%
%\addplot[black!15] fill between[of=A and B];
%
%\node at (axis cs:1,0.4) {$R$};
%
%\end{axis}
%\end{tikzpicture}
%
\begin{tikzpicture}
\begin{axis}[
  %axis x line=middle, axis y line=middle,
  axis x line = none,
  axis y line = none,
  ticks = none,
  width=5.5cm, height=4.9cm,     % size of the image = rigged to keep scaling=constrained
  ymin=-4.5, ymax=6.5, % ytick={0}, ylabel=$y$,
  xmin=-4, xmax=4.25, % xtick={0}, xlabel=$x$,
]

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

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

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

\node at (axis cs:0,2.5) {$R$};

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

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

\node[mark size=3pt,label=0:{\ $(-3,-4)$}] at (axis cs:-3,-4) {\pgfuseplotmark{*}};
\node[mark size=3pt,label=0:{$(2,1)$}] at (axis cs:2,1) {\pgfuseplotmark{*}};
\node[mark size=3pt,label=0:{\  $(0,5)$}] at (axis cs:0,5) {\pgfuseplotmark{*}};

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

\vspace{0.05in}

To integrate in the order $dy\,dx$, we need to identify the bottom and the top of our region. Obviously, the bottom is given by the line $y=x-1$ and the top is given by the parabola $y=5-x^2$. Thus $x-1 \leq y \leq 5-x^2$. Next, we need our $x$-bounds. These come from the intersection of the top and bottom: $x-1=y=5-x^2$ so that $x^2+x-6=0$ and so $(x+3)(x-2)=0$. Therefore, $-3 \leq x \leq 2$. We get \fbox{(a) \quad $\displaystyle \iint\limits_{R} 2xy\,dA = \int_{-3}^2 \int_{x-1}^{5-x^2} 2xy\,dy\,dx$}.

\vspace{0.05in}

To integrate in the order $dx\,dy$, we need to identify the left and right sides of our region. This is trickier. The left hand side of the region is given by the left half of the parabola $y=5-x^2$. But the right side is given sometimes by the right branch of the parabola and sometimes by the line $y=x-1$. So we need to split the region into two pieces. 

First, the lower part of the region goes from parabola to line. We need $x$-bounds, so solving the parabola's equation ($y=5-x^2$) for $x$ yields: $x=\pm\sqrt{5-y\small\strut}$. We need the left side, so our desired bound is $x=-\sqrt{5-y\small\strut}$. The line ($y=x-1$) solved for $x$ yields: $x=y+1$. Thus $-\sqrt{5-y\small\strut} \leq x \leq y+1$ (in the lower part of $R$). Now we need $y$-bounds. Both of these bounds come from the line and parabola intersecting. We already know this happens when $x=-3$ and $2$. Thus (plugging into the line's equation) $y=-3-1=-4$ and $y=2-1=1$ (or we could have used the parabola's equation: $y=5-(-3)^2=-4$ and $y=5-2^2=1$). Thus $-4 \leq y \leq 1$. 

Next, the upper part of the region goes from and to the parabola. Thus $-\sqrt{5-y\small\strut} \leq x \leq \sqrt{5-y\small\strut}$. We know that lower $y$-bound for this part is the same as the upper $y$-bound for the other part (i.e., $y=1$). To get our upper $y$-bound, we need to see where the left and right halves of the parabola meet: $-\sqrt{5-y\small\strut}=x=\sqrt{5-y\small\strut}$ so that $2\sqrt{5-y\small\strut}=0$ so $y=5$ (alternatively, we could just note that the vertex of the parabola occurs when $y=5$). In any case, $1 \leq y \leq 5$. Therefore\dots

$$\mbox{\fbox{(b) \quad $\displaystyle  \iint\limits_{R} 2xy\,dA = \int_{-4}^1 \int_{-\sqrt{5-y\small\strut}}^{y+1} 2xy\,dx\,dy+\int_1^5 \int_{-\sqrt{5-y\small\strut}}^{\sqrt{5-y\small\strut}} 2xy\,dx\,dy$}}$$



\noindent {\bf\large 3. (12 points)} Compute $\displaystyle\int_0^2 \int_{y/2}^1 \cos(x^2)\,dx\,dy$. \qquad Include a {\bf sketch} of {\bf the region} of integration.\\
\force \hfill [{\it Hint:} You cannot integrate $\displaystyle\int\cos(x^2)\,dx$ in terms of elementary functions.]

\begin{minipage}{1.5in}
\begin{tikzpicture}
\begin{axis}[
  %axis x line=middle, axis y line=middle,
  axis x line = none,
  axis y line = none,
  ticks = none,
  width=5cm, height=7.5cm,     % size of the image = rigged to keep scaling=constrained
  ymin=-0.7, ymax=2.8, % ytick={0}, ylabel=$y$,
  xmin=-0.5, xmax=1.75, % xtick={0}, xlabel=$x$,
]

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

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

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

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


\node at (axis cs:0.65,0.5) {$R$};

\node at (axis cs:1.4,-0.5) {$x=1$};
\node at (axis cs:0.2,-0.5) {$y=2x$};
\node at (axis cs:1.5,0.2) {$y=0$};

%\node[mark size=3pt,label=0:{\ $(-3,-4)$}] at (axis cs:-3,-4) {\pgfuseplotmark{*}};
%\node[mark size=3pt,label=0:{$(2,1)$}] at (axis cs:2,1) {\pgfuseplotmark{*}};
%\node[mark size=3pt,label=0:{\  $(0,5)$}] at (axis cs:0,5) {\pgfuseplotmark{*}};

\end{axis}
\end{tikzpicture}
\end{minipage}
\hfill
\begin{minipage}{5.75in}
\indent
Since we cannot come up with an antiderivative for $\cos(x^2)$, we need to try reversing the order of integration and first integrate with respect to $y$.

\vspace{0.05in}

\indent
The iterated integral computes the double integral $\iint_R \cos(x^2)\,dA$ where $R$ is the region described by $y/2 \leq x \leq 1$ and $0 \leq y \leq 2$ (it's an $x$-simple region). Thus the left hand side of the region $R$ is given by $x=y/2$ which is the line $y=2x$. The right hand side is given by the vertical line $x=1$. Notice that these lines intersect when $y/2=x=1$ so $y=2$. Thus $R$ is the entire region between these two lines and above the $x$-axis (i.e., $y=0$). Armed with this information, we can sketch our region of integration.

\vspace{0.05in}

\indent
Describing this as a $y$-simple region, we integrate from the bottom $y=0$ to the top $y=2x$. Then $x$'s lower bound comes from where these lines cross: $0=y=2x$ (i.e., $x=0$). The upper bound is just $x=1$. Therefore,

\vspace{0.05in}

$\displaystyle \int_0^2 \int_{y/2}^1 \cos(x^2)\,dx\,dy = \iint\limits_R \cos(x^2)\,dA = \int_0^1\int_0^{2x} \cos(x^2)\,dy\,dx=\int_0^1 \cos(x^2)\cdot y\Big|_0^{2x} =$
\end{minipage}

\vspace{-0.1in}

\force \hfill $\displaystyle \int_0^1 2x\cos(x^2)\,dx = \sin(x^2)\Big|_0^1 = \sin(1^2)-\sin(0^2) = \mbox{\fbox{$\sin(1)$}}$

{\it Note:} $\int 2x\cos(x^2)\,dx = \sin(x^2)+C$ follows from the simple $u$-substitution: $u=x^2$, $du=2x\,dx$.

\vspace{0.05in}

\noindent {\bf\large 4. (13 points)} Set up but {\bf do not} compute $\displaystyle\iint\limits_{R} \dfrac{-3x+y}{x+y}\,dA$ where $R$ is the region bounded by

\vspace{-0.15in}

\force\hfill $y=3x+1$, $y=3x+2$, $y=-x+1$, and $y=-x+3$.


\force\hfill {\it Hint:} Use a ``natural'' change of coordinates which simplifies the region $R$ and\dots don't forget the Jacobian!

\vspace{0.05in}

Probably the most natural choice of change of variables is $\left\{ \begin{array}{l} u=-3x+y \\ v=x+y \end{array}\right.$. Thus the integrand changes to $\dfrac{-3x+y}{x+y}=\dfrac{u}{v}$. Also, the bounds for $R$ are $-3x+y=1$, $-3x+y=2$, $x+y=1$, and $x+y=3$, so they transform to $u=1$, $u=2$, $v=1$, and $v=3$. Finally, we need our Jacobian (determinant). 

\vspace{-0.1in}

\force \hfill
$\displaystyle \dfrac{\partial(u,v)}{\partial(x,y)} = \det \begin{bmatrix} u_x & u_y \\ v_x & v_y \end{bmatrix} = \det \begin{bmatrix} -3 & 1 \\ 1 & 1 \end{bmatrix} =  -3(1)-1(1) = -4$

This is the Jacobian of the inverse transform (we have new variables in terms of old), so our Jacobian is $J=\dfrac{1}{-4}$. 

Alternatively, we could solve for $x$ and $y$ in terms of $u$ and $v$: Subtracting we get, $u-v=-3x+y-(x+y)=-4x$ so $x=-u/4+v/4$. Also, $u+3v=(-3x+y)+3(x+y) = 4y$ so $y=u/4+3v/4$. Thus\dots

\vspace{-0.05in}

$$\dfrac{\partial(x,y)}{\partial(u,v)} = \det \begin{bmatrix} x_u & x_v \\ y_u & y_v \end{bmatrix} = \det \begin{bmatrix} -1/4 & 1/4 \\ 1/4 & 3/4 \end{bmatrix} = \dfrac{-1}{4}\cdot\dfrac{3}{4}-\dfrac{1}{4}\cdot\dfrac{1}{4} = -\dfrac{3}{16}-\dfrac{1}{16} = -\dfrac{4}{16} = -\dfrac{1}{4}$$

\vspace{-0.05in}

Of course, the first Jacobian calculation is easier. Finally, don't forget to take the absolute value $|J|=1/4$. We get\dots

\vspace{-0.1in}

$$\iint\limits_{R} \dfrac{-3x+y}{x+y}\,dA = \mbox{\fbox{$\displaystyle \int_1^2 \int_1^3 \dfrac{u}{v} \cdot \dfrac{1}{4} \,dv\,du$}}$$

\vspace{-0.05in}

{\it Note:} We weren't asked to compute this integral, but it's not hard. Since our integrand factors and we have constant bounds, our integral can be pulled apart: $\displaystyle =\dfrac{1}{4}\int_1^2 u\,du \cdot \int_1^3 \dfrac{1}{v}\,dv = \dfrac{1}{4}(u^2/2)\Big|_1^2 \cdot \ln|v|\Big|_1^3 = \dfrac{1}{8}(4-1)(\ln(3)-\ln(1)) = \dfrac{3\ln(3)}{8}$. 


\vspace{0.05in}

\noindent {\bf\large 5. (13 points)} Let $R$ be the region bounded by $x^2+y^2=1$ and $x^2+y^2=4$ such that $x \geq 0$. Note: The area of $R$ is $\dfrac{3}{2}\pi$.

\begin{minipage}{1.5in}
\begin{tikzpicture}
\begin{axis}[
  axis x line = none,
  axis y line = none,
  width=5cm, height=5cm,     % size of the image = rigged to keep scaling=constrained
  ymin=-2.1, ymax=2.1,% ytick={0}, ylabel=$y$,
  xmin=-2.1, xmax=2.1,% xtick={0}, xlabel=$x$,
]

\addplot[name path=A,black, domain=-90:90, smooth] ({cos(x)},{sin(x)});
\addplot[name path=B,black, domain=-90:90, smooth] ({2*cos(x)},{2*sin(x)});

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

\node at (axis cs:1.4,0) {$R$};

\addplot[black, domain=0:360, smooth] ({cos(x)},{sin(x)});
\addplot[black, domain=0:360, smooth] ({2*cos(x)},{2*sin(x)});

\addplot[black, ultra thick, domain=-90:90, smooth] ({cos(x)},{sin(x)});
\addplot[black, ultra thick, domain=-90:90, smooth] ({2*cos(x)},{2*sin(x)});
\addplot[black, ultra thick, domain=1:2] ({0},{x});
\addplot[black, ultra thick, domain=-2:-1] ({0},{x});

\end{axis}
\end{tikzpicture}
\end{minipage}
\hfill
\begin{minipage}{5.75in}

\begin{enumerate}[(a)]
\item Sketch $R$ and fill in the (polar) bounds for $R$:

\force \hfill \underline{\quad 1 \quad} $\leq r \leq$ \underline{\quad 2 \quad} \quad and \quad \underline{\quad $-\pi/2$ \quad} $\leq \theta \leq$ \underline{\quad $\pi/2$ \quad}.

Notice that $1 \leq x^2+y^2=r^2 \leq 4$ so that $1 \leq r \leq 2$. Also, $x \geq 0$ forces us into the first and fourth quadrants where $0 \leq \theta \leq \pi/2$ and $3\pi/2 \leq \theta \leq 2\pi$ (or $-\pi/2 \leq \theta \leq 0$).

\item Find the centroid of $R$. 

We know $m = \iint_R 1\,dA$ is just the area of $R$, so $m=3\pi/2$ (as given).
\end{enumerate}
\end{minipage}

By symmetry, we have $\bar{y}=0$. Finally, $\displaystyle M_y = M_{x=0} = \iint_R x\,dA = \int_{-\pi/2}^{\pi/2}\int_1^2 r\cos(\theta)\,r\,dr\,d\theta$ (don't forget the Jacobian).


This integral has constant bounds and an integrand that factors, so we can pull it apart. 

Thus $\displaystyle M_y = \int_{-\pi/2}^{\pi/2} \cos(\theta)\,d\theta \int_1^2 r^2\,dr = 2 \dfrac{r^3}{3}\Big|_1^2 = \dfrac{2}{3}(8-1) = \dfrac{14}{3}$. This means that $\bar{x} = \dfrac{M_y}{m} = \dfrac{14/3}{3\pi/2} = \dfrac{28}{9\pi}$. 

\vspace{-0.1in}

$$\mbox{\fbox{$(\bar{x},\bar{y}) = \left(\dfrac{28}{9\pi}, 0 \right)$}.}$$

\vspace{-0.1in}

\noindent
{\it Note:} $9\pi \approx 27$ so $28/9\pi \approx 1$. The centroid is close to $(x,y)=(1,0)$. Looking at the plot, this seems plausible.

\vspace{0.05in}

\noindent {\bf\large 6. (12 points)} Consider the integral: $\displaystyle I = \int_{-2}^2 \int_0^{\sqrt{4-x^2}} \int_{-\sqrt{4-x^2-y^2}}^0 \ z \cdot (x^2+y^2+z^2) \,dz\,dy\,dx$.   

\begin{minipage}{4.75in}
The bounds for the corresponding region of integration are: 

\vspace{0.05in}

\force \hfill
$-\sqrt{4-x^2-y^2} \leq z \leq 0$, $0 \leq y \leq \sqrt{4-x^2}$, and $-2 \leq x \leq 2$. 

\vspace{0.05in}

The innermost bounds $-\sqrt{4-x^2-y^2} \leq z \leq 0$ tell us that we are dealing with part of the lower-half of the ball $x^2+y^2+z^2 \leq 4$.

\vspace{0.05in}

 The next bounds $0 \leq y \leq \sqrt{4-x^2}$ and $-2 \leq x \leq 2$ describe the upper-half of the disk $x^2+y^2 \leq 4$. 
\end{minipage}
\hfill
\begin{minipage}{2.25in}
\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 = {$y$},
        ylabel = {$x$},
        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 = 16,
        colormap name=mygreen,
        variable = \u,
        variable y = \v,
        domain = -90:90,
        y domain = 0:2,
    ]
    ({v*cos(u)}, {v*sin(u)}, {-sqrt(4-v^2)});

    \addplot3[%
%        opacity = 0.5,
        surf,
        z buffer = sort,
        samples = 16,
        colormap name=myblue,
        variable = \u,
        variable y = \v,
        domain = -90:90,
        y domain = 0:2,
    ]
    ({v*cos(u)}, {v*sin(u)}, {0});
    \end{axis}
\end{tikzpicture}
\end{minipage}

\vspace{-0.25in}

\begin{enumerate}[(a)]
   \item Rewrite $I$ in the following order of integration: $\iiint \quad \,dx\,dz\,dy$.
   
   Do {\bf not} evaluate the integral.

Solve $x^2+y^2+z^2=4$ for $x$ and get $x = \pm\sqrt{4-y^2-z^2}$. We go from back to front: $-\sqrt{4-y^2-z^2} \leq x \leq \sqrt{4-y^2-z^2}$ (hemisphere to hemisphere). Next, with $x$ squished out of the picture, we have a part of the interior of the circle $y^2+z^2=4$. Solved for $z$, we get $z = \pm\sqrt{4-y^2}$. Of course, we just have the lower-half of this disk, so $-\sqrt{4-y^2} \leq z \leq 0$. Finally, $y$ ranges from $0$ to the radius ($=2$). 

\vspace{-0.3in}

$$\hspace*{0.75in} I=\mbox{\fbox{$\displaystyle\int_0^2 \int_{-\sqrt{4-y^2}}^0 \int_{-\sqrt{4-y^2-z^2}}^{\sqrt{4-y^2-z^2}} z \cdot (x^2+y^2+z^2) \,dx\,dz\,dy$}}$$

\vspace{-0.1in}
   
   \item Rewrite $I$ in terms of cylindrical coordinates.
   
   Do {\bf not} evaluate the integral.
   
Looking back at the original integral, we just translate $-\sqrt{4-x^2-y^2} \leq z \leq 0$ to $-\sqrt{4-r^2} \leq z \leq 0$. The $y$- and $x$-bounds describe the upper-half of the disk $x^2+y^2 \leq 4$. Therefore, $0 \leq r \leq 2$ and $0 \leq \theta \leq \pi$. We also need to translate the integrand and {\it don't forget the Jacobian!}

\vspace{-0.3in}

$$\hspace*{1in} I=\mbox{\fbox{$\displaystyle\int_0^\pi \int_0^2 \int_{-\sqrt{4-r^2}}^0 z \cdot (r^2+z^2) \,r\,dz\,dr\,d\theta$}}$$

\vspace{-0.1in}

   \item Rewrite $I$ in terms of spherical coordinates.

   Do {\bf not} evaluate the integral.

Notice that $\rho^2 = x^2+y^2+z^2=4$ so our sphere is $\rho=2$ in spherical coordinates. Next, think of a ray emanating from the origin out to the sphere. This leads us to the bounds $0 \leq rho \leq 2$. Our region only concerns the lower-half of the sphere so $\pi/2 \leq \varphi \leq \pi$ (the lower-half of 3-space). Finally, $0 \leq \theta \leq \pi$ for the same reasons as in part (b). We also need to translate the integrand and {\it don't forget the Jacobian!}

\vspace{-0.3in}

$$\hspace*{2.5in} I=\mbox{\fbox{$\displaystyle\int_0^\pi \int_{\pi/2}^{\pi} \int_0^2 \rho\cos(\varphi) \cdot \rho^2 \cdot \rho^2\sin(\varphi)\,dz\,dr\,d\theta$}}$$

\vspace{-0.1in}

\end{enumerate}


\noindent {\bf\large 7. (10 points)} Compute $\displaystyle\iiint_E x^2+y^2 \,dV$ where $E$ is the region bounded by $z=-1$, $z=4$, and $x^2+y^2=4$.

\vspace{0.05in}

We have $-1 \leq z \leq 4$ and $x^2+y^2 \leq 4$. This is just a solid cylindrical region. We should use cylindrical coordinates. Thus $-1 \leq z \leq 4$ and $r^2=x^2+y^2 \leq 4$ so that $0 \leq r \leq 2$. There's no reason to cut down $\theta$, so $0 \leq \theta \leq 2\pi$. Remember to translate the integrand and don't forget the Jacobian! Finally, computing this integral is easy since we end up with an integrand that factors and all of our bounds are constant.

\vspace{-0.1in}

$$\iiint\limits_{E} x^2+y^2\,dV = \int_0^{2\pi}\int_0^2\int_{-1}^4 r^2\cdot r\,dz\,dr\,d\theta =  \int_0^{2\pi}\,d\theta \int_0^2 r^3\,dr \int_{-1}^4 \,dz = 2\pi \cdot \dfrac{r^4}{4}\Bigg|_0^2 \cdot 5 = 2\pi \cdot \dfrac{16}{4} \cdot 5 = \mbox{\fbox{$40\pi$}}$$

\newpage

\noindent {\bf\large 8. (15 points)} Let $E$ be the region below $z=6$ and above $z=2\sqrt{x^2+y^2}$. Set up integrals which compute the volume of $E$ using the following orders of integration: \quad [Do {\bf not} evaluate these integrals.]

\vspace{-0.15in}

\begin{minipage}{4.5in}
\begin{enumerate}[(a)]
\item $\int_?^? \  \int_?^? \  \int_?^? \  ??? \,dz\,dy\,dx$
%\item $\int_?^? \  \int_?^? \  \int_?^? \  ??? \,dx\,dz\,dy$ 
\item Set up this integral in cylindrical coordinates.
\item Set up this integral in spherical coordinates.
\end{enumerate}
\vfill
\force
\end{minipage} \hfill
\begin{minipage}{2.75in}
%\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[%
        opacity = 0.5,
        surf,
        z buffer = sort,
        samples = 16,
        colormap name=mygreen,
        variable = \u,
        variable y = \v,
        domain = 0:360,
        y domain = 0:3,
    ]
    ({v*cos(u)}, {v*sin(u)}, {2*v});

    \addplot3[%
        opacity = 0.25,
        surf,
        z buffer = sort,
        samples = 16,
        colormap name=myblue,
        variable = \u,
        variable y = \v,
        domain = 0:360,
        y domain = 0:3,
    ]
    ({v*cos(u)}, {v*sin(u)}, {6});
    \end{axis}
\end{tikzpicture}
%\fi %%%%%%%%%%%%%%%%%%%%%%%% end block comment %%%%%%%%%%%%%%%%%%%%%%%%%%
\end{minipage}

The region is bounded below by $z=2\sqrt{x^2+y^2}=2r$ and above by $z=6$. Intersecting these surfaces yields $2\sqrt{x^2+y^2}=z=6$ so that $\sqrt{x^2+y^2}=3$ and so $x^2+y^2=9$ (alternatively, $2r=z=6$ so $r=3$). Thus if we integrate out $z$, we are left with the disk $x^2+y^2 \leq 9$ in the $xy$-plane. Thus solving for $y$, we get $-\sqrt{9-x^2} \leq y \leq \sqrt{9-x^2}$ (and finally $-3 \leq x  \leq 3$). In cylindrical coordinates, we have $2r \leq z \leq 6$, $0 \leq r \leq 3$, and $0 \leq \theta \leq 2\pi$.  Remember that the  volume of $E$ is computed by $\iiint_E 1\,dV$. Don't forget the Jacobian for cylindrical coordinates!

$$\text{(a)}\quad \mbox{volume} = \mbox{\fbox{$\displaystyle \int_{-3}^3 \int_{-\sqrt{9-x^2}}^{\sqrt{9-x^2}} \int_{2\sqrt{x^2+y^2}}^6 1\,dz\,dy\,dx$}}$$

$$\text{(b)}\quad \mbox{volume} = \mbox{\fbox{$\displaystyle \int_0^{2\pi} \int_0^3 \int_{2r}^6 1\cdot r\,dz\,dy\,dx$}}$$

Spherical coordinates are a bit trickier. Imagine a ray emanating from the origin. At the origin we are already in our solid region. Thus the lower-bound for $\rho$ is $0$. As our ray emanates outward, it leaves the solid region when we hit the top of the conical region at $z=6$. This equation must yield our upper-bound for $\rho$. Notice that $6=z=\rho\cos(\varphi)$ so $\rho = 6/\cos(\varphi)=6\sec(\varphi)$. Therefore, $0 \leq \rho \leq 6\sec(\varphi)$. 

Next, image sweeping out from the positive $z$-axis. We start off in the region, so the lower-bound for $\varphi$ should be $0$. Next, we leave this conical region when we hit the cone. Thus $z=2\sqrt{x^2+y^2}$ must yield the upper-bound for $\varphi$. Notice that $z=2\sqrt{x^2+y^2}=2r$ and $\rho\cos(\varphi) = z = 2r = 2\rho\sin(\varphi)$. Thus $\tan(\varphi) = \sin(\varphi)/\cos(\varphi) = 1/2$. Therefore, $0 \leq \varphi \leq \mathrm{arctan}(1/2)$.  

Alternately, we could see that the upper bound for $\varphi$ comes from a right triangle determined by cutting through the cone. This triangle would be $z=6$ units tall and $3$ units wide (the radius of the disk when $z$ is squished out). Therefore, $\tan(\varphi) = 3/6 = 1/2$ and again $\varphi=\mathrm{arctan}(1/2)$. We also note that this triangle would have hypotenuse $\sqrt{6^2+3^2}=3\sqrt{5}$. Thus we could also describe $\varphi$ by $\mathrm{arcsin}(1/\sqrt{5})$ or $\mathrm{arccos}(2/\sqrt{5})$ etc.

Finally, $\theta$ is the same as in cylindrical coordinates, and don't forget the Jacobian!

$$\text{(c)}\quad \mbox{volume} = \mbox{\fbox{$\displaystyle \int_0^{2\pi} \int_0^{\mathrm{arctan}(1/2)} \int_0^{6\sec(\varphi)} 1\cdot \rho^2\sin(\varphi)\,dz\,dy\,dx$}}$$

We were not asked to compute this volume, but the calculation is pretty straight-forward. Cylindrical coordinates probably yield the easiest iterated integral. We go with that.

$$\text{volume} = \displaystyle \int_0^{2\pi} \int_0^3 \int_{2r}^6 1\cdot r\,dz\,dy\,dx = \int_0^{2\pi}\,d\theta \int_0^3 \int_{2r}^6 r\,dz\,dr = 2\pi \int_0^3 rz\Bigg|_{2r}^6 \,dr 
 = 2\pi \int_0^3 6r-2r^2\,dr =$$
 $2\pi \left( 3r^2-\dfrac{2r^3}{3}\right)\Bigg|_0^3 = 2\pi (27-18) = 18\pi$.

\end{document}


