\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.5in}
\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.2in}

\noindent {\large\bf Name:} \underline{\hskip 3.0 truein}
\hfill {\bf Be sure to show your work!}

\vspace{0.05in}

\noindent
\begin{equation*}
\begin{array}{ccc}
 x & = & \rho \cos(\theta) \sin(\varphi) \\
 y & = & \rho \sin(\theta) \sin(\varphi) \\
 z & = & \rho \cos(\varphi) 
\end{array} 
\hspace*{2.5in}
\begin{array}{c}
J=\rho^2\sin(\varphi) \\
{}\\
\cos^2(\theta) = \frac{1}{2}\left(1+\cos(2\theta)\right)
\end{array}
\end{equation*}

\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$.

\vspace{1in}

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

\vfill
\vfill

\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=5cm, height=4.9cm,     % size of the image = rigged to keep scaling=constrained
  ymin=-4.5, ymax=5.5, % ytick={0}, ylabel=$y$,
  xmin=-3.5, xmax=2.5, % 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$};

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


\vfill
\vfill

\newpage

\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.]

\vfill

\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\\ \force\hfill $y=3x+1$, $y=3x+2$, $y=-x+1$, and $y=-x+3$.

\vspace{0.05in}

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

\vfill

\newpage

\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$.
$$\mbox{Centroid formulas:} \qquad m = \iint\limits_R 1\,dA \qquad M_y = \iint\limits_R x\,dA \qquad M_x = \iint\limits_R y\,dA \qquad (\bar{x},\bar{y}) = \left(\dfrac{M_y}{m},\dfrac{M_x}{m}\right) $$

\vspace{0.15in}

\begin{enumerate}[(a)]
\item Sketch $R$ and fill in the (polar) bounds for $R$: \qquad \underline{\hspace*{0.35in}} $\leq r \leq$ \underline{\hspace*{0.35in}} \quad and \quad \underline{\hspace*{0.35in}} $\leq \theta \leq$ \underline{\hspace*{0.35in}}.

\item Find the centroid of $R$. 

\vfill

\end{enumerate}

\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{enumerate}[(a)]
   \item Rewrite $I$ in the following order of integration: $\iiint \quad \,dx\,dz\,dy$.
   
   Do {\bf not} evaluate the integral.

\vspace{1in}
   
   \item Rewrite $I$ in terms of cylindrical coordinates.
   
   Do {\bf not} evaluate the integral.
   
\vspace{1in}

   \item Rewrite $I$ in terms of spherical coordinates.
   
   Do {\bf not} evaluate the integral.

\vspace{1in}

\end{enumerate}

\newpage

\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$.

\vfill


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


\vfill

\vfill


\end{document}


