\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}
\usetikzlibrary{arrows.meta}

\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}{{\noindent{}$\mbox{\,\!}$}}

\begin{document}

\pagestyle{empty}

\noindent
\parbox{2in}{\bf Math 2130}
\hfill {\Large \bf Test \#3} \hfill
\parbox{2in}{\bf \hfill April $14^\mathrm{th}$\!,\  2021}

\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. (12 points)} The following are plots of several vector fields. Please note that all of the vectors have been scaled down so they do not overlap each other. Write A, B, and C next to the appropriate vector field's formula. Put an X next to the formula whose vector field is {\bf not} shown. Also, for each vector field \underline{is $\B F$ conservative}? Circle ``Yes'' or ``No''.

\force
\hfill
\begin{tikzpicture}[scale=0.5]
\begin{axis}[
    axis lines=middle,
    view={0}{90},
    domain=-4:4,
    y domain=-4:4,
    xmax=5, ymax=5,
    samples=6,
    color=gray
]
\addplot3 [black, quiver={u={-y}, v={x}, scale arrows=0.25, every arrow/.append style={-latex}}] (x,y,0);
\end{axis}
\end{tikzpicture}
\hfill
\hfill
\begin{tikzpicture}[scale=0.5]
\begin{axis}[
    axis lines=middle,
    view={0}{90},
    domain=-4:4,
    y domain=-4:4,
    xmax=5, ymax=5,
    samples=6,
    color=gray
]
\addplot3 [black, quiver={u={-x}, v={-y}, scale arrows=0.25, every arrow/.append style={-latex}}] (x,y,0);
\end{axis}
\end{tikzpicture}
\hfill \hfill
\begin{tikzpicture}[scale=0.5]
\begin{axis}[
    axis lines=middle,
    view={0}{90},
    domain=-4:4,
    y domain=-4:4,
    xmax=5, ymax=5,
    samples=6,
    color=gray
]
\addplot3 [black, quiver={u={y}, v={1}, scale arrows=0.25, every arrow/.append style={-latex}}] (x,y,0);
\end{axis}
\end{tikzpicture}
\hfill
\force

\vspace{0.05in}

\force
\hspace{1.05in}
{\LARGE\bf A}
\hfill
{\LARGE\bf B\ }
\hfill
{\LARGE\bf C}
\hspace{1.05in}
\force

\vspace{0.1in}

\force %\hspace{-0.25in}
\quad
\fbox{\myspace} $\B F(x,y) = \la y, 1 \ra$ \hfill
\fbox{\myspace} $\displaystyle \B F(x,y) = \left\la x, y \right\ra$ \hfill
\fbox{\myspace} $\B F(x,y) = \la -x, -y \ra$ \hfill
\fbox{\myspace} $\B F(x,y) = \la -y, x \ra$ 
\quad
\force

\vspace{0.05in}

\force \qquad
\qquad
Yes / No \hfill
Yes / No \hfill
Yes / No \hfill
Yes / No
\qquad \force

\vspace{0.15in}

\noindent {\bf\large 2. (10 points)} Use a double Riemann sum to approximate $\iint\limits_R y\cos(x^2+1)\,dA$ where $R=[-8,8] \times [0,4]$. 

Use midpoint rule and a $2 \times 2$ grid of rectangles ($2$ across and $2$ up) to partition $R$. \hfill (Don't worry about simplifying.)

\vfill


\noindent {\bf\large 3. (7 points)} Let $\B F(x,y,z) = \la 10, xyz, e^x \ra$ and $C$ be the curve parameterized by $\B r(t) = \left\la t^2,t^4,t^6 \right\ra$ where $-7 \leq t \leq 9$.

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

\vspace{0.75in}

\newpage

Centroid: \quad $\displaystyle m = \iint_R 1\,dA$, \quad $\displaystyle M_y = \iint_R x\,dA$, \quad $\displaystyle M_x = \iint_R y\,dA$, \quad $(\bar{x},\bar{y}) = (M_y/m,M_x/m)$

\vspace{0.05in}

\noindent {\bf\large 4. (13 points)} Let $R$ be the annular region between $x^2+y^2=1$ and $x^2+y^2=4$ where $y \geq 0$ (pictured below).\\ 
\force \hfill [{\it Warning:} One of the integrals below will have to be split into {\it several} pieces.]

\begin{minipage}{4in}
\begin{enumerate}[(a)]
%\item Sketch the region $R$.
\item Set up the integral $\displaystyle\iint\limits_R y\,dA$ in polar coordinates.
\item Set up the integral $\displaystyle\iint\limits_R y\,dA$ rectangular coordinates.
\item Find the centroid of $R$.
\end{enumerate}
\end{minipage}
\hfill
\begin{minipage}{2.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=8cm, height=5.5cm,     % size of the image = rigged to keep scaling=constrained
  ymin=-0.5, ymax=2.5, % ytick={0}, ylabel=$y$,
  xmin=-2.5, xmax=2.5, % xtick={0}, xlabel=$x$,
]

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

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

\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,1.5) {$R$};

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

\vfill

\noindent {\bf\large 5. (11 points)} Consider $\displaystyle \int_0^2 \int_{3x}^6 \sin(y^2)\,dy\,dx$. 

\begin{enumerate}[(a)]
\item Sketch the corresponding region of integration.
\item Compute the iterated integral. \qquad {\it Hint:} You cannot integrate $\int \sin(y^2)\,dy$ in terms of elementary functions.
\end{enumerate}


\vfill

\newpage


\vspace{0.1in}


\noindent {\bf\large 6. (11 points)} {\bf Set up} the integral $\displaystyle\iint\limits_{R} e^{(x-y)^2}\,dA$ where $R$ is the region bounded by the lines $y=x-3$, $y=x-4$, $y=-2x$, and $x=0$. {\it Note:} Use the change of coordinates: $u=2x+y$ and $v=x-y$. {\bf DO NOT} evaluate this integral.

\vfill


\noindent {\bf\large 7. (10 points)} Let $E$ be the region bounded by $z=x^2+y^2+1$ and $z=5$. Compute the integral $\displaystyle\iiint_E \dfrac{1}{\sqrt{x^2+y^2}}\,dV$.

\vfill

\newpage

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

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

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

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

\vspace{0.75in}

\end{enumerate}

\noindent {\bf\large 9. (14 points)} Let $E$ be the region above the cone $z=2\sqrt{x^2+y^2}$, below $z=18$, and where $y \geq 0$. 

%\iffalse %%%%%%%%%%%%%%%%%%%%%%%% block comment %%%%%%%%%%%%%%%%%%%%%%%%%%

\vspace{-0.15in}

\begin{minipage}{4.5in}
\begin{enumerate}[(a)]
\item Set up $\displaystyle\iiint_E x+z \,dV$ in rectangular coordinates.
\item Set up $\displaystyle\iiint_E x+z \,dV$ in cylindrical coordinates.
\item Set up $\displaystyle\iiint_E x+z \,dV$ in spherical coordinates.
\end{enumerate}
\vfill
\force
\end{minipage} \hfill
\begin{minipage}{2.75in}
\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=mypink,
        variable = \u,
        variable y = \v,
        domain = -90:90,
        y domain = 0:3,
    ]
    ({0}, {v*sin(u)}, {2*v});
    
    \addplot3[%
        opacity = 0.5,
        surf,
        z buffer = sort,
        samples = 16,
        colormap name=mygreen,
        variable = \u,
        variable y = \v,
        domain = -90:90,
        y domain = 0:3,
    ]
    ({v*cos(u)}, {v*sin(u)}, {2*v});

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


\vfill

\vfill

%\fi %%%%%%%%%%%%%%%%%%%%%%%% end block comment %%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}


