\documentclass[10pt,letter]{exam}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{tabularx,ragged2e}
\usepackage{tikz}
\usepgfplotslibrary{fillbetween}
\begin{document}
\newcommand{\boundellipse}[3]% center, xdim, ydim
{(#1) ellipse (#2 and #3)
}

\begin{coverpages}
\begin{center}\huge MATH 3315 - EXAM 2 SPRING 2017\\
SOLUTION
\end{center}

\begin{flushleft}\vspace{0.5in}
Friday 3 March 2017 \\
Instructor: Tom Cuchta
\end{flushleft}

\textbf{Instructions:}
\begin{itemize}
	\item  Show all work, clearly and in order, if you want to get full
	credit. If you claim something is true \textbf{you must show work backing up your claim}. I reserve the right to take off points if I cannot see how you arrived at your answer (even if your final answer is correct).
	\item Justify your answers algebraically whenever possible to ensure full credit. 	
	\item  Circle or otherwise indicate your final answers.
	\item  Please keep your written answers brief; be clear and to the point.
	\item  Good luck!
\end{itemize}
\vspace*{10pt}


\end{coverpages}

\begin{questions}

\question[22] Consider the region bounded by $y=\sqrt{x+1}$ and $y=x+1$.
\begin{parts}
\part[6] Draw this region. \\
\textit{Solution:} Draw:  \\
\begin{tikzpicture}
\begin{axis}[xmin=-1.2,xmax=1,
    ymin=-0.2,ymax=2,grid=major,
    ]    
\addplot[name path=F,scale=1,domain=-1:0,smooth,variable=\x,black,samples=100] plot ({\x},{1+\x});
\addplot[name path=G,scale=1,domain=-1:0,smooth,variable=\x,black,samples=100] plot (\x,{sqrt(1+\x)});

\addplot[scale=1,domain=0:1,smooth,variable=\x,black,samples=100] plot (\x,{sqrt(1+\x)});
\addplot[scale=1,domain=0:1,smooth,variable=\x,black,samples=100] plot ({\x},{1+\x});

\addplot[domain=-1:0,opacity=0.4] fill between[of=F and G];
\end{axis}

\draw[fill=black] (3.75,3.13) circle (0.1);
\draw[fill=black] (0.6,0.5) circle (0.1);
\end{tikzpicture}

\part[8] Set up \textbf{but do not evaluate} an integral to compute the area of the described region as a $\mathrm{d}x$ integral. \\
\textit{Solution:} Integrate the top function minus the bottom function over the interval $-1 \leq x \leq 0$:
$$\displaystyle\int_{-1}^0 \sqrt{x+1}-(x+1) \mathrm{d}x$$
\part[8] Set up \textbf{but do not evaluate} an integral to compute the area of the described region as a $\mathrm{d}y$ integral. \\
\textit{Solution:} Rewrite the right function $y=x+1$ as $x=y-1$ and rewrite $y=\sqrt{x+1}$ as $x=y^2-1$. Now integrate the right function minus the left function over the interval $0 \leq y \leq 1$: 
$$\displaystyle\int_0^1 (y^2-1) - (y-1) \mathrm{d}y.$$
\end{parts}
\question[14] Find the the area of the region bounded by the equations $y=\sin(x)$, $y=\cos(x)$, $x=\dfrac{\pi}{4}$, and $x=\pi$ in any way you wish.
\begin{parts}
\part[6] Draw this region. \\
\textit{Solution:} \\
\begin{tikzpicture}
\begin{axis}[xmin=-0.2,xmax=2*pi,
    ymin=-1,ymax=1,grid=major,
    ]    
\addplot[scale=1,domain=0:pi/4,smooth,variable=\x,black,samples=100] plot ({\x},{sin(deg(\x))});
\addplot[scale=1,domain=0:pi/4,smooth,variable=\x,black,samples=100] plot (\x,{cos(deg(\x))});

\addplot[name path=F,scale=1,domain=pi/4:pi,smooth,variable=\x,black,samples=100] plot ({\x},{sin(deg(\x))});
\addplot[name path=G,scale=1,domain=pi/4:pi,smooth,variable=\x,black,samples=100] plot (\x,{cos(deg(\x))});

\addplot[scale=1,domain=pi:3*pi/2,smooth,variable=\x,black,samples=100] plot ({\x},{sin(deg(\x))});
\addplot[scale=1,domain=pi:3*pi/2,smooth,variable=\x,black,samples=100] plot (\x,{cos(deg(\x))});

\addplot[domain=-1:0,opacity=0.4] fill between[of=F and G];
\end{axis}

\draw[color=white,fill=white] (3.4,-0.3) circle (0.2);
\draw node at (3.55,-0.3) {$\pi$};

\draw[fill=black] (1.05,4.85) circle (0.1);
\draw node at (1.9,5) {$\left(\frac{\pi}{4},\frac{\sqrt{2}}{2}\right)$};
\end{tikzpicture}
\part[8] Find the area of the region in any way you wish. \\
\textit{Solution:} Compute
$$\begin{array}{ll}
\mathrm{Area} &= \displaystyle\int_{\frac{\pi}{4}}^{\pi} \sin(x)-\cos(x) \mathrm{d}x \\
&= -\cos(x)-\sin(x) \Bigg|_{\frac{\pi}{4}}^{\pi} \\
&=\left[ -\cos(\pi)-\sin(\pi) \right] - \left[ -\cos \left( \dfrac{\pi}{4} \right) - \sin \left( \dfrac{\pi}{4} \right) \right] \\
&=\left[ 1-0 \right] - \left[ - \dfrac{\sqrt{2}}{2} - \dfrac{\sqrt{2}}{2} \right] \\
&=1+\sqrt{2}.
\end{array}$$

\end{parts}


\question[14] Consider the solid formed by the region bounded by the curves $y=\dfrac{1}{x}$, $x=1$, $x=2$, and $y=0$ rotated about the line $y=2$. 
\begin{parts}
\part[6] Draw the region and draw a washer. \\
\textit{Solution:} Here is the picture of the region: \\
\begin{tikzpicture} 
\begin{axis}[xmin=-0.2,xmax=3,
    ymin=-1,ymax=2,grid=major,
    ]    

\addplot[name path=F,scale=1,domain=1:2,smooth,variable=\x,black,samples=100] plot ({\x},{1/(\x)});
\addplot[name path=G,scale=1,domain=1:2,smooth,variable=\x,black,samples=100] plot (\x,0);

\addplot[scale=1,domain=0.5:1,smooth,variable=\x,black,samples=100] plot ({\x},{1/(\x)});
\addplot[scale=1,domain=0.5:1,smooth,variable=\x,black,samples=100] plot ({\x},{0});

\addplot[scale=1,domain=2:3,smooth,variable=\x,black,samples=100] plot ({\x},{1/(\x)});
\addplot[scale=1,domain=2:3,smooth,variable=\x,black,samples=100] plot ({\x},{0});

\addplot[domain=-1:0,opacity=0.4] fill between[of=F and G];
\end{axis}

\draw[color=white,fill=white] (3.4,-0.3) circle (0.2);

\end{tikzpicture} \\
Here is the picture of the washer: \\
\begin{tikzpicture} 
\begin{axis}[xmin=0.5,xmax=2.5,
    ymin=0,ymax=4,grid=major,
    ]    

\addplot[name path=F,scale=1,domain=1:2,smooth,variable=\x,black,samples=100] plot ({\x},{1/(\x)});
\addplot[name path=G,scale=1,domain=1:2,smooth,variable=\x,black,samples=100] plot (\x,0);

\addplot[name path=H,scale=1,domain=1:2,smooth,variable=\x,black,samples=100,dashed] plot ({\x},{4-1/(\x)});
\addplot[name path=I,scale=1,domain=1:2,smooth,variable=\x,black,samples=100,dotted] plot (\x,4);

\addplot[domain=-1:0,opacity=0.4] fill between[of=F and G];
%\addplot[domain=-1:0,opacity=0.4] fill between[of=I and H];

\end{axis}

\draw[dashed] (0,2.84) -- (6.9,2.84);
\draw (3,2.84) circle (0.4 and 1.8);
\draw (3,2.84) circle (0.8 and 2.845);
\draw (3,-0.25) node {$x$};

\draw (8,0) -- (8,1);
\draw (8,1.8) -- (8,2.8);
\draw (7.8,2.8) -- (8.2,2.8);
\draw (7.8,0) -- (8.2,0);
\draw (8,1.4) node {$2$};

\draw (9,0) -- (9, 0.3);
\draw (9,0.66) -- (9, 1.04);
\draw (8.8,0) -- (9.2,0);
\draw (8.8,1.04) -- (9.2,1.04);
\draw (9,0.4) node {$2-\frac{1}{x}$};
\end{tikzpicture} \\
\part[8] Find the volume of the region using the washer method. \\
\textit{Solution:} The volume is 
$$\begin{array}{ll}
\mathrm{Volume} &= \pi \displaystyle\int_1^2 2^2 - \left( 2 - \dfrac{1}{x} \right)^2 \mathrm{d}x \\
&= \pi \displaystyle\int_1^2 4 - \left( 4 - \dfrac{4}{x} + \dfrac{1}{x^2} \right) \mathrm{d}x \\
&= \pi \displaystyle\int_1^2 \dfrac{4}{x} - \dfrac{1}{x^2} \mathrm{d}x \\
&= \pi \left[ 4\ln(x) + \dfrac{1}{x} \right|_1^2 \\
&=\pi \left[ \left( 4\ln(2)+\dfrac{1}{2} \right)- \left( 4\ln(1) + \dfrac{1}{1} \right) \right] \\
&=4\pi \ln(2) + \dfrac{\pi}{2} - \pi \\
&= 4 \pi \ln(2) - \dfrac{\pi}{2}.
\end{array}$$
\end{parts}
\question[12] Consider the solid formed by the region bounded by $y=4x-x^2$, $x=0$, and $y=4$ rotated about the line $x=5$.
\begin{parts}
\part[6] Draw the region and draw a shell. \\
\textit{Solution:} First draw the region: ***********\\
\begin{tikzpicture} 
\begin{axis}[xmin=-0.2,xmax=5,
    ymin=-1,ymax=5,grid=major,
    ]    

\addplot[name path=F,scale=1,domain=0:2,smooth,variable=\x,black,samples=100] plot ({\x},{4*(\x)-(\x)*(\x)});
\addplot[name path=G,scale=1,domain=0:4,smooth,variable=\x,black,samples=100] plot (0,{\x});

\addplot[scale=1,domain=0:4,smooth,variable=\x,black,samples=100] plot ({\x},{4*(\x)-(\x)*(\x)});
\addplot[scale=1,domain=0:4,smooth,variable=\x,black,samples=100] plot (0,{\x});
\addplot[scale=1,domain=-1:5,smooth,variable=\x,black,samples=100] plot ((\x),4);

\addplot[domain=-1:0,opacity=0.4] fill between[of=F and G];
\end{axis}

\draw[color=white,fill=white] (3.4,-0.3) circle (0.2);

\end{tikzpicture} \\
Now draw the shell:  \\
\begin{tikzpicture} 
\begin{axis}[xmin=0,xmax=10,
    ymin=-1,ymax=5,grid=major,
    ]    

\addplot[name path=J,scale=1,domain=0:2,smooth,variable=\x,black,samples=100] plot ({\x},{4*(\x)-(\x)*(\x)});
\addplot[name path=K,scale=1,domain=0:4,smooth,variable=\x,black,samples=100] plot (0,{\x});
\addplot[domain=-1:0,opacity=0.4] fill between[of=J and K];
\addplot[scale=1,domain=0:2,smooth,variable=\x,black,samples=10] plot ((\x),4);

\addplot[scale=1,domain=-1:5,smooth,variable=\x,black,samples=10,dashed] plot (5,{\x});

\addplot[name path=L,scale=1,domain=8:10,smooth,variable=\x,black,samples=100,dashed] plot ({(\x)},{4*(10-\x)-(10-\x)*(10-\x)});
\addplot[name path=M,scale=1,domain=0:4,smooth,variable=\x,black,samples=500] plot (10,{\x});
%\addplot[domain=8:10,opacity=0.4] fill between[of=M and L];
\addplot[scale=1,domain=8:10,smooth,variable=\x,black,samples=10] plot ((\x),4);

\end{axis}

\draw (0.5,3.2) -- (0.5,4.75);

\draw (6.35,3.2) -- (6.35,4.75);

\draw (3.425,4.75) circle (2.94 and 0.1);
\draw (0.5,3.2) -- (6.35,3.2);
\draw (0.5,-0.3) node {$x$};

\end{tikzpicture} \\
We observe that the radius of the shell is $5-x$ and the height of the shell is $4-(4x-x^2)$.
\part[6] Set up \textbf{but do not evaluate} an integral using the shell method to find the volume of the solid \\
\textit{Solution:} 
$$\mathrm{Volume}=2\pi \displaystyle\int_0^2 (5-x)(4-(4x-x^2)) \mathrm{d}x.$$
\end{parts}
\question[10] Set up \textbf{but do not evaluate} an integral that will compute the arc length of the function $f(x)=x\sin(x)$ on the interval $[0,10]$. \\
\textit{Solution:} First compute 
$$f'(x)=\sin(x) + x\cos(x).$$
Then 
$$\mathrm{ArcLength} = \displaystyle\int_0^{10} \sqrt{1+(\sin(x)+x\cos(x))^2} \mathrm{d}x.$$

\question[10] The plot of the parametric equations
$$\left\{ \begin{array}{ll}
x(t) &= \cos(2t) \\
y(t) &= t\sin(t)
\end{array} \right.$$
for $0 \leq t \leq \pi$ is shown: \\
\begin{center}
\begin{tikzpicture}
\begin{axis}[
    trig format plots=rad,
]
\addplot [domain=0:3.1416, samples=500, black,very thin] ({cos(2*x)}, {x*sin(x)});
\end{axis}
\end{tikzpicture}
\end{center}
Find an equation of the tangent line to this curve at $t=\dfrac{\pi}{4}$. \\
\textit{Solution:} First note that the point in question has coordinates given by
$$\left( x \left( \dfrac{\pi}{4} \right), y \left( \dfrac{\pi}{4} \right) \right)=\left( \cos\left(\dfrac{\pi}{2} \right), \dfrac{\pi}{4} \sin \left( \dfrac{\pi}{4} \right) \right)=\left( 0, \dfrac{\pi\sqrt{2}}{8} \right).$$
Now compute the derivatives
$$x'(t)=-2\sin(2t)$$
and
$$y'(t)=\sin(t) + t\cos(t).$$
Therefore,
$$\mathrm{slope}=\dfrac{\mathrm{d}y}{\mathrm{d}x} = \dfrac{y'(t)}{x'(t)} = \dfrac{\sin(t)+t\cos(t)}{-2\sin(2t)}.$$
Now we see that the slope of the tangent line is 
$$\dfrac{\mathrm{d}y}{\mathrm{d}x} \Bigg|_{t=\frac{\pi}{4}} = \dfrac{\sin(\frac{\pi}{4})+\frac{\pi}{4}\cos(\frac{\pi}{4})}{-2\sin(\frac{\pi}{2})}=\dfrac{\frac{\sqrt{2}}{2}+\frac{\pi}{4}\frac{\sqrt{2}}{2}}{-2(1)}=-\dfrac{\sqrt{2}}{4}-\dfrac{\pi\sqrt{2}}{16}$$
Therefore the equation of the tangent line is
$$y-\dfrac{\pi\sqrt{2}}{8} = \left( -\dfrac{\sqrt{2}}{4}-\dfrac{\pi\sqrt{2}}{16} \right) (x-0).$$

\question[6]
\begin{parts}
\part[3] Convert the point $\left( 5, \dfrac{\pi}{6} \right)$ in polar coordinates into rectangular coordinates. \\
\textit{Solution:} We use the formulas
$$\left\{ \begin{array}{ll}
x=r\cos(\theta) \\
y=r\sin(\theta)
\end{array} \right.$$
to convert to rectangular coordinates. The given point has $r=5$ and $\theta=\dfrac{\pi}{6}$, so we compute
$$x=5\cos \left( \dfrac{\pi}{6} \right) = \dfrac{5\sqrt{3}}{2},$$
and
$$y=5\sin \left( \dfrac{\pi}{6} \right) = \dfrac{5}{2}.$$
Therefore the rectangular coordinates of the polar point $\left(5,\dfrac{\pi}{6} \right)$ are $\left(\dfrac{5\sqrt{3}}{2}, \dfrac{5}{2} \right)$. 
\part[3] Convert the point $(-1,1)$ in rectangular coordinates into polar coordinates. \\
\textit{Solution:} We use the formulas 
$$\left\{ \begin{array}{ll}
r=\sqrt{x^2+y^2} \\
\theta = \left\{ \begin{array}{ll}
\arctan \left( \dfrac{y}{x} \right) & (x,y) \mathrm{\hspace{2pt} is \hspace{2pt} quadrants \hspace{2pt} I \hspace{2pt} or \hspace{2pt} II} \\
\pi+\arctan \left( \dfrac{y}{x} \right) & (x,y) \mathrm{\hspace{2pt} is \hspace{2pt} quadrants \hspace{2pt} III \hspace{2pt} or \hspace{2pt} IV} 
\end{array} \right.
\end{array} \right.$$
to find the polar coordinates. Since the given (rectangular) point lies in quadrant II and we have $x=-1$ and $y=1$, we may compute the polar coordinates by
$$r=\sqrt{(-1)^2+1^2}=\sqrt{1+1}=\sqrt{2},$$
and
$$\theta = \pi + \arctan \left( \dfrac{1}{-1} \right) = \pi - \dfrac{\pi}{4} = \dfrac{3\pi}{4}.$$
Therefore the polar coordinates of the rectangular point $(-1,1)$ are $\left( \sqrt{2}, \dfrac{\pi}{4} \right)$. 
\end{parts}

 
\question[12] Match each equation with its graph. \\
\begin{tabular}{ll}
{\huge a.)}\begin{tikzpicture}
\begin{axis}[
    trig format plots=rad,
    axis equal
]
\addplot [domain=0:2*3.1415, samples=100, black] ({30*cos(x)}, {15*sin(x)});
\end{axis}
\end{tikzpicture} & {\huge b.)}\begin{tikzpicture}
\begin{axis}[
    trig format plots=rad,
    axis equal
]
\addplot [domain=0:2*3.1416, samples=100, black] ({2*cos(x)-3}, {2*sin(x)-3});
\end{axis}
\end{tikzpicture} \\
{\huge c.)}\begin{tikzpicture}
\begin{axis}[
    trig format plots=rad,
    axis equal
]
\addplot [domain=-1.5:1.5, samples=100, black] ({cosh(x)}, {sinh(x)});
\addplot [domain=-1.5:1.5, samples=100, black] ({-cosh(x)}, {sinh(x)});
\end{axis}
\end{tikzpicture} & {\huge d.)}\begin{tikzpicture}
\begin{axis}[
    trig format plots=rad,
    axis equal
]
\addplot [domain=0:2*3.1416, samples=500, black] ({15*cos(x)}, {30*sin(x)});
\end{axis}
\end{tikzpicture} \\
{\huge e.)}\begin{tikzpicture}
\begin{axis}[
    trig format plots=rad,
    axis equal
]
\addplot [domain=-3:5, samples=500, black] ({(x-1)*(x-1)+2}, {x});
\end{axis}
\end{tikzpicture} & {\huge f.)}\begin{tikzpicture}
\begin{axis}[
    trig format plots=rad,
    axis equal
]
\addplot [domain=-1.5:1.5, samples=500, black] ({sinh(x)}, {cosh(x)});
\addplot [domain=-1.5:1.5, samples=500, black] ({sinh(x)}, {-cosh(x)});
\end{axis}
\end{tikzpicture}
\end{tabular} \\
\begin{tabular}{ll}
1. $x^2-y^2=1$ \textbf{c.)} & \quad 2. $\dfrac{x^2}{30^2}+\dfrac{y^2}{15^2}=1$ \textbf{a.)} \\
3. $x=(y-1)^2+2$ \textbf{e.)} & \quad 4. $y^2-x^2=1$ \textbf{f.)} \\
5. $(x+3)^2+(y+3)^2 = 4$ \textbf{b.)} & \quad 6. $\dfrac{x^2}{15^2}+\dfrac{y^2}{30^2}=1$ \textbf{d.)}
\end{tabular} \\

\end{questions}

\end{document}
