\documentclass[10pt,addpoints]{exam}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{tikz}
\usepackage{pgfplots}
\pagestyle{head}
\usepackage{tabularx,ragged2e}
\usepackage{tikz}
\usepgfplotslibrary{fillbetween}
\usepackage{hyperref}
\renewcommand*{\arraystretch}{2}
\begin{document}
\begin{coverpages}
\begin{center}\huge MATH 3315 - EXAM 2 - FALL 2017\\
\vspace*{0.1in}
SOLUTION
\end{center}
\begin{flushleft}\vspace{0.5in}
Friday 29 September 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[14] Consider the region bounded by the curves $y=x^2$ and $y=1-x^2$. 
\begin{parts}
\part[6] Draw this region. \\
\textit{Solution}: Draw \\
\begin{center}
\begin{tikzpicture}
\begin{axis}[xmin=-1.2,xmax=1,
    ymin=-0.2,ymax=2,grid=major,
    ]    
\addplot[name path=F,scale=1,domain=-0.70710678118:0.70710678118,smooth,variable=\x,black,samples=100] plot ({\x},{(\x)*(\x)});
\addplot[name path=G,scale=1,domain=-0.70710678118:0.70710678118,smooth,variable=\x,black,samples=100] plot (\x,{1-(\x)*(\x)});

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

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

\node at (4,3.5) {$y=1-x^2$};
\node at (7.5,3) {$y=x^2$};

%\draw[fill=black] (3.75,3.13) circle (0.1);
%\draw[fill=black] (0.6,0.5) circle (0.1);
\end{tikzpicture}
\end{center}
\vfill
\part[8] Find the area of this region in any way you wish. \\
\textit{Solution:} The intersection points occur whenever $x^2=1-x^2$, which has solution $x = \pm \dfrac{1}{\sqrt{2}} = \pm \dfrac{\sqrt{2}}{2}$. We will compute it using a $\mathrm{d}x$ integral. \href{http://www.wolframalpha.com/input/?i=area+between+x%5E2+and+1-x%5E2}{Compute}
$$\begin{array}{ll}
\mathrm{Area} &= \displaystyle\int_{-\frac{\sqrt{2}}{2}}^{\frac{\sqrt{2}}{2}} \mathrm{top}(x) - \mathrm{bottom}(x) \mathrm{d}x \\
&= \displaystyle\int_{-\frac{\sqrt{2}}{2}}^{\frac{\sqrt{2}}{2}} (1-x^2)-x^2 \mathrm{d}x \\
&= \displaystyle\int_{-\frac{\sqrt{2}}{2}}^{\frac{\sqrt{2}}{2}} 1 -2x^2 \mathrm{d}x \\
&= x - \dfrac{2}{3} x^3 \Bigg|_{-\frac{\sqrt{2}}{2}}^{\frac{\sqrt{2}}{2}} \\ 
&= \left[ \dfrac{\sqrt{2}}{2} - \dfrac{2}{3} \left( \dfrac{\sqrt{2}}{2} \right)^3 \right] - \left[ -\dfrac{\sqrt{2}}{2} - \dfrac{2}{3} \left( -\dfrac{\sqrt{2}}{2} \right)^3 \right] \\
&= \sqrt{2}-\dfrac{\sqrt{2}}{3} \\
&= \dfrac{2\sqrt{2}}{3}.
\end{array}$$
\vfill
\end{parts}

\question[15] Consider the region bounded by $y=\dfrac{1}{x}$, $y=0$, $x=1$, and $x=2$ rotated about the line $y=2$.
\begin{parts}
\part[7] Draw the region. \\
\textit{Solution}: Draw \\
\begin{center}
\begin{tikzpicture}
\begin{axis}[xmin=-0.1,xmax=2.2,
    ymin=-0.5,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=0.1:2.21,smooth,variable=\x,black,samples=100] plot ({\x},{1/(\x)});
\addplot[name path=J,scale=1,domain=0.1:2.21,smooth,variable=\x,black,samples=100] plot ({\x},0);
%\addplot[name path=lvert,scale=1,domain=1:1,smooth,variable=\y,
%\addplot[name path=G,scale=1,domain=-0.70710678118:0.70710678118,smooth,variable=\x,black,samples=100] plot (\x,{1/(\x));

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

\addplot[domain=-0.01:0.05,opacity=0.4] fill between[of=F and G];
\end{axis}
%\draw[thick] (3.3,-1) -- (3.3,5);
%\draw[thick] (6.25,-1) -- (6.25,5);
%\node at (4,3.5) {$y=1-x^2$};
%\node at (7.5,3) {$y=x^2$};

%\draw[fill=black] (3.75,3.13) circle (0.1);
%\draw[fill=black] (0.6,0.5) circle (0.1);
\end{tikzpicture}
\end{center}
\vfill \part[8] Find the volume of the region in any way you wish. \\
\textit{Solution}: We use the washer method: \\
\begin{center}
\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} \\
\end{center}
Now \href{http://www.wolframalpha.com/input/?i=volume+of+region+between+y%3D1%2Fx+and+y%3D0+between+1%3C%3Dx%3C%3D2+rotated+about+y%3D2}{compute the volume} 
$$\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[8]
\begin{parts}
\part[4] Convert the point $\left( 3, \dfrac{\pi}{3} \right)$ in polar coordinates into rectangular coordinates. \\
\textit{Solution}: We are given $r=3$ and $\theta=\dfrac{\pi}{3}$. We \href{http://www.wolframalpha.com/input/?i=3*cos(pi%2F3)}{compute}
$$x = r\cos(\theta) = 3 \cos \left( \dfrac{\pi}{3} \right) = 3 \left( \dfrac{1}{2} \right) = \dfrac{3}{2}$$ 
and we \href{http://www.wolframalpha.com/input/?i=3*sin(pi%2F3)}{compute}
$$y=r\sin(\theta) = 3 \sin \left( \dfrac{\pi}{3} \right) = 3 \left( \dfrac{\sqrt{3}}{2} \right) = \dfrac{3\sqrt{3}}{2}.$$
Therefore the rectangular coordinates are $(x,y) = \left( \dfrac{3}{2}, \dfrac{3\sqrt{3}}{2} \right)$. 
\part[4] Convert the point $(5,-5)$ in rectangular coordinates into polar coordinates. \\
\textit{Solution}: Compute
$$r = \sqrt{x^2+y^2} = \sqrt{5^2+(-5)^2} = \sqrt{50}.$$
Since $(5,-5)$ is in quadrant IV, we \href{http://www.wolframalpha.com/input/?i=polar+coordinates+of+(5,-5)}{compute}
$$\theta = \arctan \left( \dfrac{y}{x} \right) = \arctan \left( \dfrac{-5}{5} \right) = \arctan(-1) = -\dfrac{\pi}{4}.$$
\end{parts}

\question[20]  Consider the region bounded by the curves $y=1-x$, $y=x+1$, and the line $y=0$.
\begin{parts}
\part[6] Draw this region. \\
\textit{Solution}: Draw:
\begin{center}
\begin{tikzpicture}
\begin{axis}[xmin=-1,xmax=1,
    ymin=-0.5,ymax=2,grid=major,
    ]    

\addplot[name path=F,scale=1,domain=0:2,smooth,variable=\x,black,samples=100] plot ({\x},{1-(\x)});
\addplot[name path=G,scale=1,domain=-2:0,smooth,variable=\x,black,samples=100] plot (\x,{1+(\x)});
\addplot[name path=H,scale=1,domain=-2:0,smooth,variable=\x,black,samples=100] plot (\x,0);
\addplot[name path=J,scale=1,domain=0:2,smooth,variable=\x,black,samples=100] plot (\x,0);
\addplot[name path=K,scale=1,domain=-2:2,smooth,variable=\x,black,samples=100] plot ({\x},{1-(\x)});
\addplot[name path=L,scale=1,domain=-2:2,smooth,variable=\x,black,samples=100] plot (\x,{1+(\x)});
%\addplot[name path=H,scale=1,domain=0.1:2.21,smooth,variable=\x,black,samples=100] plot ({\x},{1/(\x)});
%\addplot[name path=J,scale=1,domain=0.1:2.21,smooth,variable=\x,black,samples=100] plot ({\x},0);

\addplot[domain=-0.01:0.05,opacity=0.4] fill between[of=G and H];
\addplot[domain=-0.01:0.05,opacity=0.4] fill between[of=F and J];
\end{axis}
\draw node at (4.5,5) {$y=x-1$};
\draw node at (1.5,4) {$y=1-x$};
\end{tikzpicture}
\end{center}
\vfill
\part[7] Set up \textbf{but do not evaluate} $\mathrm{d}x$ integral(s)  that compute the area of this region. \\
\textit{Solution}: Write
$$\mathrm{Area}=\displaystyle\int_{-1}^0 (x+1)-0 \mathrm{d}x + \displaystyle\int_0^1 (1-x)-0 \mathrm{d}x=\displaystyle\int_{-1}^0 x+1 \mathrm{d}x + \displaystyle\int_0^1 1-x \mathrm{d}x$$
\part[7] Set up \textbf{but do not evaluate} $\mathrm{d}y$ integral(s) that compute the area of this region. \\
\textit{Solution}: Rewrite $y=1-x$ as $x=1-y$ and rewrite $y=x+1$ as $x=y-1$. So compute
$$\mathrm{Area} = \displaystyle\int_0^1 (1-y) - (y-1) \mathrm{d}y = \displaystyle\int_0^1 2-2y \mathrm{d}y.$$
\end{parts}
\newpage
\question[13] Consider the region bounded by $y=\sin(x)$, $x=0$, $x=\pi$, and $y=0$ about the line $y=5$. \\
\textit{Solution}: Draw the region:
\begin{center}
\begin{tikzpicture}
\begin{axis}[xmin=0,xmax=3.2,
    ymin=-0.5,ymax=2,grid=major,
    ]    

\addplot[name path=F,scale=1,domain=0:pi,samples=200,black]{sin(deg(x))};
\addplot[name path=G,scale=1,domain=0:pi,smooth,variable=\x,black,samples=100] plot (\x,0);
\addplot[domain=-0.01:0.05,opacity=0.4] fill between[of=F and G];

\end{axis}
\end{tikzpicture}
\end{center}

\begin{parts}
\part[6] Draw the region and draw a washer. \\
\textit{Solution}: Now draw a washer
\begin{center}
\begin{tikzpicture}
\begin{axis}[xmin=0,xmax=3.2,
    ymin=-0.5,ymax=10,grid=major,
    ]    

\addplot[name path=F,scale=1,domain=0:pi,samples=200,black]{sin(deg(x))};
\addplot[name path=G,scale=1,domain=0:pi,smooth,variable=\x,black,samples=100] plot (\x,0);
\addplot[name path=H,scale=1,domain=0:pi,samples=200,black]{10-sin(deg(x))};
\addplot[domain=-0.01:0.05,opacity=0.4] fill between[of=F and G];
\end{axis}
\draw (3,2.97) circle (0.4 and 2.17);
\draw (3,2.97) circle (0.8 and 2.7);

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

\draw (10,0.7) -- (10,1);
\draw (10,1.8) -- (10,2.8);
\draw (9.8,2.8) -- (10.2,2.8);
\draw (9.8,0.7) -- (10.2,0.7);
\draw (10,1.4) node {$5-\sin(x)$};
\end{tikzpicture}
\end{center}
\vfill
\part[7] Use the washer method to find \textbf{but do not evaluate} an integral that computes the volume. \\
\textit{Solution}: Compute 
$$\mathrm{Volume} = \pi \displaystyle\int_0^{\pi} 5^2 - (5-\sin(x))^2 \mathrm{d}x.$$
\end{parts}
\newpage
\question[13] Consider the region bounded by $y=x^2$ and $x=1$ rotated about the $y$-axis.
\begin{parts}
\part[6] Draw the region and draw a shell. \\
\textit{Solution}: \begin{center}
\begin{tikzpicture}
\begin{axis}[xmin=-1.2,xmax=1.2,
    ymin=-0.2,ymax=1.2,grid=major,
    ]    

\addplot[name path=F,scale=1,domain=0:2,samples=200,black]{(\x)*(\x)};
\addplot[name path=J,scale=1,domain=0:1,samples=200,black]{(\x)*(\x)};
\addplot[name path=G,scale=1,domain=0:1,samples=200,black]{0};
\addplot[domain=0:1,opacity=0.4] fill between[of=J and G];

\addplot[name path=K,scale=1,domain=0:1,samples=200,black,dashed] plot ({(-1)*(\x)},{(\x)*(\x)});

%\addplot[name path=J,scale=1,domain=0:1,samples=200,black]{sqrt(\x)};
\end{axis}


\draw (5.755,0.8) -- (5.755,3.5);
\draw (1.095,0.8) -- (1.095,3.5);
\draw (1.095,0.8) -- (5.755,0.8);

\draw (3.425,3.5) circle (2.33 and 0.1);
%\draw (1.875,1.7) -- (4.975,1.7);
\draw (5.8,0.6) node {$x$}; 
\end{tikzpicture}
\end{center}
\part[7] Use the shell method find \textbf{but do not evalute} an integral that computes the volume. \\
\textit{Solution}: The radius of this shell at $x$ is is $x$ and the height is $x^2$. Therefore the volume is given by
$$\mathrm{Volume} = 2\pi \displaystyle\int_0^1 x(x^2) \mathrm{d}=2\pi\displaystyle\int_0^1 x^3 \mathrm{d}x.$$
\end{parts}


\question[17] The plot of the parametric equations
$$\left\{ \begin{array}{ll}
x(t) &= \sin(t) \\
y(t) &= \sin(2t)
\end{array} \right.$$
for $0 \leq t \leq \pi$ is shown: \\
\begin{center}
\begin{tikzpicture}
\begin{axis}[
    trig format plots=rad, axis lines=middle
]
\addplot [domain=0:3.1416, samples=500, black] ({sin(x)}, {sin(2*x)});
\end{axis}
\end{tikzpicture}
\end{center}
\begin{parts}
\part[5] Find $\dfrac{\mathrm{d}y}{\mathrm{d}x}$. \\
\textit{Solution}: We know that 
$$\dfrac{\mathrm{d}y}{\mathrm{d}x} = \dfrac{y'(t)}{x'(t)} = \dfrac{2\cos(2t)\sin(2t)}{\cos(t)}.$$
\part[6] The $t$-value $t=\dfrac{\pi}{4}$ describes the point $(x,y)=\left( \dfrac{\sqrt{2}}{2}, 1 \right)$. Find an equation for the tangent line at this point. \\
\textit{Solution}: First find the slope of this tangent line:
$$\dfrac{\mathrm{d}y}{\mathrm{d}x} \Bigg|_{t=\frac{\pi}{4}}=\dfrac{2\cos\left(\frac{\pi}{2}\right)\sin\left(\frac{\pi}{2}\right)}{\cos\left(\frac{\pi}{4}\right)}=0.$$
Thus the tangent line to the curve at this point is $y-1=0\left( x - \dfrac{\sqrt{2}}{2} \right)$, i.e., $y=1$.
\part[6] Find an equation for the tangent line at the point defined by the $t$-value $t=\dfrac{\pi}{6}$. \\
\textit{Solution}: First find the slope:
$$\dfrac{\mathrm{d}y}{\mathrm{d}x} \Bigg|_{t=\frac{\pi}{6}} = \dfrac{2\cos\left( \frac{\pi}{3} \right) \sin \left( \frac{\pi}{3} \right)}{\cos\left(\frac{\pi}{6}\right)}=1.$$
Now find the point corresponding to the $t$-value $t=\dfrac{\pi}{6}$: 
$$x\left(\dfrac{\pi}{6} \right) = \sin \left( \dfrac{\pi}{6} \right) = \dfrac{1}{2},$$ 
and 
$$y\left( \dfrac{\pi}{6} \right) = \sin \left( \dfrac{\pi}{3} \right) = \dfrac{\sqrt{3}}{2}.$$
Therefore the tangent line we seek is the line going through $\left( \dfrac{1}{2}, \dfrac{\sqrt{3}}{2} \right)$ with slope $1$, i.e.
$$y-\dfrac{\sqrt{3}}{2} = 1 \left( x - \dfrac{1}{2} \right).$$
\end{parts}




\end{questions}
\end{document}