\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{tikz}
\usepackage{hyperref}
\begin{document}
\begin{coverpages}
\begin{center}\huge MATH 3315 - EXAM 3 - FALL 2017\\
\vspace*{0.1in}
SOLUTION
\end{center}
\begin{flushleft}\vspace{0.5in}
Friday 27 October 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}
$$\cos^2(x) = \dfrac{1+\cos(2x)}{2}\label{doubleanglecosine}$$
$$\sin^2(x) = \dfrac{1-\cos(2x)}{2}\label{doubleanglesine}$$
$$\displaystyle\int \log(x) \mathrm{d}x = x\log(x)-x + C$$
To integrate $\sin^m(x)\cos^n(x)$...\\
\begin{tabular}{|ll|}
\hline
$m$ odd & $\longrightarrow$ save a sine and convert rest to cosines \\
$n$ odd & $\longrightarrow$ save a cosine and convert rest to sines
both $m$ and $n$ even \\
$m$ even and $n$ even & $\longrightarrow$ convert all to cosines \\
\hline
\end{tabular}\\
\\
The trigonometric substitutions are...\\
\begin{tabular}{|ll|}
\hline
$\sqrt{a^2-x^2}$ & $\longrightarrow x=a\sin(\theta)$ \\
$\sqrt{a^2+x^2}$ & $\longrightarrow x=a\tan(\theta)$ \\
$\sqrt{x^2-a^2}$ & $\longrightarrow x=a\sec(\theta)$ \\
\hline
\end{tabular} \\
\vspace*{10pt}
\end{coverpages}
\renewcommand*{\arraystretch}{2}
\begin{questions} 
\question[50] Find the antiderivative.
\begin{parts}
\part[10] $\displaystyle\int xe^{-18x} \mathrm{d}x$ \\
\textit{Solution:} Let $u=x$ and $\mathrm{d}v=e^{-18x}$, then $\mathrm{d}u=\mathrm{d}x$ and $v=-\dfrac{1}{18}e^{-18x}$. By integration by parts, \href{http://www.wolframalpha.com/input/?i=antiderivative+of+xe%5E(-18x)+dx}{compute}
$$\begin{array}{ll}
\displaystyle\int xe^{-18x} \mathrm{d}x &= -xe^{-18x} + \dfrac{1}{18} \displaystyle\int e^{-18x}\mathrm{d}x \\
&= -xe^{-18x} - \dfrac{1}{18^2} e^{-18x} + C \\
&= -xe^{-18x} - \dfrac{1}{324} e^{-18x} + C.
\end{array}$$
\part[10] $\displaystyle\int \dfrac{x}{x^3-4x} \mathrm{d}x$ \\
\textit{Solution:} Factor the denominator:
$$x^3-4x=x(x^2-4)=x(x-2)(x+2).$$
Therefore we will use partial fractions to decompose: write
$$\dfrac{x}{x^3-4x} = \dfrac{A}{x} + \dfrac{B}{x-2} + \dfrac{C}{x+2}.$$
Multiply by the common denominator $x(x-2)(x+2)$ to both sides to get
$$x = A(x^2-4) + B(x^2+2x) + C(x^2-2x)=(A+B+C)x^2+(2B-2C)x+(-4A).$$
Equating coefficients leads to the following system of equations:
$$\left\{ \begin{array}{rrrl}
A&+B&+C&=0 \quad (i) \\
&2B&-2C&=1 \quad (ii)\\
-4A & & &=0 \quad (iii)
\end{array} \right.$$
From $(iii)$, we deduce $A=0$. Plugging this into $(i)$ and solving for $B$ yields $B=-C$. Plugging this into $(ii)$ yields $-2C-2C=1$, and hence $-4C=1$, so $C = -\dfrac{1}{4}$. Hence $B=-C=\dfrac{1}{4}$. Thus we have shown
$$\dfrac{x}{x^3-4x} = \dfrac{1}{4} \dfrac{1}{x-2} - \dfrac{1}{4} \dfrac{1}{x+2}.$$
Therefore we may \href{http://www.wolframalpha.com/input/?i=antiderivative+of+x%2F(x%5E3-4x)}{compute}
$$\begin{array}{ll}
\displaystyle\int \dfrac{x}{x^3-4x} \mathrm{d}x &= \dfrac{1}{4} \displaystyle\int \dfrac{1}{x-2} \mathrm{d}x - \dfrac{1}{4} \displaystyle\int \dfrac{1}{x+2} \mathrm{d}x \\
&= \dfrac{1}{4} \log(x-2) - \dfrac{1}{4} \log(x+2) + C.
\end{array}$$
\part[10] $\displaystyle\int \sin^2(x) \mathrm{d}x$ \\
\textit{Solution:} Apply the reduction formula $\sin^2(x) = \dfrac{1-\cos(2x)}{2}$ and \href{http://www.wolframalpha.com/input/?i=antiderivative+of+sin%5E2(x)+dx}{compute}
$$\begin{array}{ll}
\displaystyle\int \sin^2(x) \mathrm{d}x &= \displaystyle\int \dfrac{1}{2} \mathrm{d}x - \dfrac{1}{2} \displaystyle\int \cos(2x) \mathrm{d}x \\
&= \dfrac{x}{2} - \dfrac{1}{4} \sin(2x) + C.
\end{array}$$
\part[10] $\displaystyle\int e^x \sin(x) \mathrm{d}x$ \\
\textit{Solution:} We will apply integration by parts twice. Let $u=e^x$ and $\mathrm{d}v=\sin(x)$. Then $\mathrm{d}u=e^x \mathrm{d}x$ and $v=-\cos(x)$. Therefore integration by parts yields
$$(*) \hspace{35pt} \displaystyle\int e^x \sin(x) \mathrm{d}x = -e^x \cos(x) + \displaystyle\int e^x \cos(x) \mathrm{d}x $$
We will now apply integration by parts to the integral we got. This time let $u_2=e^x$ and $\mathrm{d}v_2=\cos(x)$. Then $\mathrm{d}u_2 = e^x \mathrm{d}x$ and $v_2=\sin(x)$. Hence we compute
$$(**) \hspace{35pt} \displaystyle\int e^x \cos(x) \mathrm{d}x = e^x \sin(x) - \displaystyle\int e^x \sin(x) \mathrm{d}x.$$
Combining $(*)$ and $(**)$ yields the equation
$$\displaystyle\int e^x \sin(x) \mathrm{d}x = -e^x \cos(x) + e^x\sin(x) - \displaystyle\int e^x \sin(x) \mathrm{d}x.$$
Adding $\displaystyle\int e^x \sin(x) \mathrm{d}x$ to both sides and then dividing by $2$ \href{http://www.wolframalpha.com/input/?i=antiderivative+of+e%5Ex+sin(x)+dx}{finally yields}
$$\displaystyle\int e^x \sin(x) \mathrm{d}x = \dfrac{e^x(\sin(x)-\cos(x))}{2}.$$
\part[10] $\displaystyle\int x \sqrt{9-x^2} \mathrm{d}x$ \\
\textit{Solution:} This integral could be solved two ways: via a trig substitution or via $u$-substitution. We will solve it both ways: \\
\underline{\textbf{via $u$-substitution}} \\
Let $u=9-x^2$ so $-\dfrac{1}{2}\mathrm{d}u = x\mathrm{d}x$. Then we \href{http://www.wolframalpha.com/input/?i=antiderivative+of+x*sqrt(9-x%5E2)+dx}{compute}
$$\begin{array}{ll}
\displaystyle\int x \sqrt{9-x^2} \mathrm{d}x &= -\dfrac{1}{2} \displaystyle\int u^{\frac{1}{2}} \mathrm{d}u \\
&= -\dfrac{1}{2} \dfrac{u^{\frac{3}{2}}}{\frac{3}{2}} + C \\
&= -\dfrac{1}{3} (9-x^2)^{\frac{3}{2}} + C.
\end{array}$$
\underline{\textbf{via trig substitution}} \\
Let $x=3\sin(\theta)$ then $\mathrm{d}x = 3\cos(\theta) \mathrm{d}\theta$. Substitute these values into the integral to compute
$$\begin{array}{ll}
\displaystyle\int x \sqrt{9-x^2} \mathrm{d}x &= \displaystyle\int (3\sin(\theta))\sqrt{9-9\sin^2(\theta)}(3\cos(\theta)) \mathrm{d}\theta \\
&= 27 \displaystyle\int \sin(\theta)\cos(\theta) \sqrt{1-\sin^2(\theta)} \mathrm{d}\theta \\
&= 27 \displaystyle\int \sin(\theta) \cos^2(\theta) \mathrm{d}\theta \\
&\stackrel{u=\cos(\theta)}{=} - 27 \displaystyle\int u^2 \mathrm{d}u \\
&= -9u^3 + C \\
&= -9 \cos^3(\theta) + C.
\end{array}$$
Now we find the value of $\cos(\theta)$. Draw a triangle matching $\dfrac{x}{3}=\sin(\theta)$:
\begin{center}
\begin{tikzpicture}
\draw (0,0) -- (4,0) -- (4,4) -- cycle;
\draw (4.5,1.7) node {$x$};
\draw (1.8,2.6) node {$3$};
\draw (2,-0.5) node {$?$};
\draw (0.6,0.2) node {$\theta$};
\draw (3.8,0) -- (3.8,0.2) -- (4,0.2);
\end{tikzpicture}
\end{center}
Find $?$ using the Pythagorean theorem: $?^2+x^2=3^2$, so $? = \sqrt{9-x^2}$. Therefore $\cos(\theta)=\dfrac{\sqrt{9-x^2}}{3}$. Finally we may \href{http://www.wolframalpha.com/input/?i=antiderivative+of+x*sqrt(9-x%5E2)+dx}{compute}
$$\displaystyle\int x \sqrt{9-x^2} \mathrm{d}x = -9 \cos^3(\theta)+C = -9 \left(\dfrac{\sqrt{9-x^2}}{3} \right)^3 + C=-\dfrac{1}{3} (9-x^2)^{\frac{3}{2}}+C.$$


\end{parts}

\question[30] Compute the following improper integrals or show that they do not converge.
\begin{parts}
\part[10] $\displaystyle\int_2^{\infty} \dfrac{1}{\sqrt{x}} \mathrm{d}x$  \\
\textit{Solution:} We \href{http://www.wolframalpha.com/input/?i=integral+from+x%3D2+to+x%3Dinfinity+of+1%2Fsqrt(x)+dx}{compute}
$$\begin{array}{ll}
\displaystyle\int_2^{\infty} \dfrac{1}{\sqrt{x}} \mathrm{d}x &= \displaystyle\lim_{b \rightarrow \infty} \displaystyle\int_2^b x^{-\frac{1}{2}} \mathrm{d}x \\
&= \displaystyle\lim_{b \rightarrow \infty} \dfrac{x^{\frac{1}{2}}}{\frac{1}{2}} \Bigg|_2^b \\
&= 2\displaystyle\lim_{b \rightarrow \infty} \sqrt{b} - \sqrt{2}\\
&= \infty,
\end{array}$$
so the integral diverges.
\part[10] $\displaystyle\int_0^{\infty} e^{-2x+3} \mathrm{d}x$ \\
\textit{Solution:} We will use the $u$-substitution $u=-2x+3$ (so $-\dfrac{1}{2}\mathrm{d}u=\mathrm{d}x$) to \href{http://www.wolframalpha.com/input/?i=integral+from+x%3D0+to+x%3Dinfinity+e%5E(-2x%2B3)+dx}{compute}
$$\begin{array}{ll}
\displaystyle\int_0^{\infty} e^{-2x+3} \mathrm{d}x &= \displaystyle\lim_{b \rightarrow \infty} \displaystyle\int_0^b e^{-2x+3} \mathrm{d}x \\
&= -\dfrac{1}{2} \displaystyle\lim_{b \rightarrow \infty} \displaystyle\int_3^{-b} e^{u} \mathrm{d}u \\
&= -\dfrac{1}{2} \displaystyle\lim_{b \rightarrow \infty} e^{u} \Bigg|_3^{-b} \\
&= -\dfrac{1}{2} \displaystyle\lim_{b \rightarrow \infty} \left( e^{-b} - e^3 \right) \\
&= -\dfrac{1}{2} \displaystyle\lim_{b \rightarrow \infty} \left( \dfrac{1}{e^b} - e^3 \right) \\
&= \dfrac{e^3}{2}.
\end{array}$$
\part[10] $\displaystyle\int_0^{\pi} \log(x^3) \mathrm{d}x$ \\
\textit{Solution:} First compute
$$\begin{array}{ll}
\displaystyle\int_0^{\pi} \log(x^3) \mathrm{d}x &= 3\displaystyle\lim_{a \rightarrow 0^+} \displaystyle\int_a^{\pi} \log(x) \mathrm{d}x \\
&= 3\displaystyle\lim_{a \rightarrow 0^+} x \log(x)-x \Bigg|_a^{\pi} \\
&= 3 \displaystyle\lim_{a \rightarrow 0^+} \left[ (a \log(a) - a) - (\pi \log(\pi)-\pi) \right]
\end{array}$$
To evaluate the limit, it is sufficient to find the limit of $a\log(a)$. Since $\displaystyle\lim_{a \rightarrow 0^+} a \log(a) = 0 \cdot (-\infty)$ is an indeterminant form, we will use L'Hopital's rule to compute
$$\displaystyle\lim_{a \rightarrow 0^+} a\log(a) = \displaystyle\lim_{a \rightarrow 0^+} \dfrac{\log(a)}{\frac{1}{a}} \stackrel{\mathrm{L.H.}}{=} \displaystyle\lim_{a \rightarrow 0^+} \dfrac{\frac{1}{a}}{-\frac{1}{a^2}} = \displaystyle\lim_{a \rightarrow 0^+} -a = 0.$$
Thus we may \href{http://www.wolframalpha.com/input/?i=integral+from+x%3D0+to+x%3Dpi+of+log(x%5E3)+dx}{compute}
$$\displaystyle\int_0^{\pi} \log(x^3)\mathrm{d}x = 3 \displaystyle\lim_{a \rightarrow 0^+} \left[ (a \log(a) - a) - (\pi \log(\pi)-\pi) \right] = 3(\pi \log(\pi)-\pi).$$



\end{parts}

\question[20] Compute the limit or show that it does not exist.
\begin{parts}
\part[10] $\displaystyle\lim_{x \rightarrow 1} \dfrac{x\sin(x^2-1)}{x^2-1}$ \\
\textit{Solution:} Plugging in $x=1$ yields a $\dfrac{0}{0}$ indeterminant form. Therefore we will use L'Hopital's rule to \href{http://www.wolframalpha.com/input/?i=limit+as+x-%3E1+of+(x*sin(x%5E2-1))%2F(x%5E2-1)}{compute}
$$\begin{array}{ll}
\displaystyle\lim_{x \rightarrow 1} \dfrac{x\sin(x^2-1)}{x^2-1} &= \displaystyle\lim_{x \rightarrow 1} \dfrac{\sin(x^2-1) + 2x^2 \cos(x^2-1)}{2x} \\
&= \dfrac{0+2(1^2)(1)}{2} \\
&= 1
\end{array}$$
\part[10] $\displaystyle\lim_{x \rightarrow \infty} \dfrac{e^{x^2+1}}{1+e^{3x^2+2x+5}}$ \\
\textit{Solution:} Plugging in $x=\infty$ yields an indeterminant form $\dfrac{\infty}{\infty}$. Therefore we use L'Hopital's rule to \href{http://www.wolframalpha.com/input/?i=limit+as+x-%3Einfinity+of+e%5E(x%5E2%2B1)%2F(1%2Be%5E(3x%5E2%2B2x%2B5))}{compute}
$$\begin{array}{ll}
\displaystyle\lim_{x \rightarrow \infty} \dfrac{e^{x^2+1}}{1+e^{3x^2+2x+5}} &\stackrel{\mathrm{L.H.}}{=} \displaystyle\lim_{x \rightarrow \infty} \dfrac{(2x+1)e^{x^2+1}}{(6x+2)e^{3x^2+2x+5}} \\
&= \displaystyle\lim_{x \rightarrow \infty} \dfrac{2x+1}{6x+2} \dfrac{1}{e^{2x^2+2x+4}} \\
&= 0,
\end{array}$$
since $\dfrac{2x+1}{6x+2}$ approaches $\dfrac{2}{6}$ as $x \rightarrow \infty$ and the exponential drags the limit down to zero.
\end{parts}

\question[1000] (\textbf{BONUS}) (don't try this one until you are done with everything else!) Compute
$$\displaystyle\int_0^{\frac{\pi}{2}} x\log(\sin(x)) \mathrm{d}x$$ \\
\textit{Solution:} The value of this integral is related to \href{https://en.wikipedia.org/wiki/Ap%C3%A9ry%27s_constant}{Apery's constant} and finding its value would make you a famous person!
\end{questions}
\end{document}