\documentclass{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{enumerate}

\usepackage{hyperref}

\usepackage{ifthen}
\usepackage{ulem} % for strikethrough \sout{...} command
\usepackage{color}

\usepackage{wasysym}

\usepackage{tikz}
\usetikzlibrary{arrows}

\setlength{\unitlength}{0.1in}

\setlength{\oddsidemargin}{-0.25in}
\setlength{\evensidemargin}{-0.25in}
\setlength{\topmargin}{-0.5in}
\setlength{\headheight}{0.0in}
\setlength{\headsep}{0.0in}
\setlength{\topskip}{0.0in}
\setlength{\textheight}{9.6in}
\setlength{\textwidth}{7in}

\newcommand{\bdot}{\, {\scriptstyle{\bullet}} \,}
\newcommand{\B}[1]{{\bf {#1}}}
\newcommand{\la}{\langle}
\newcommand{\ra}{\rangle}

\newcommand{\myspace}{\parbox[c][0.25in]{0.25in}{\hfill}}
\newcommand{\varspace}[2]{\mbox{\parbox[c][#1]{#2}{\hfill}}}
\newcommand{\force}{{\noindent $\mbox{\;}$}}

\newcommand{\diagquotient}[2]{\displaystyle{{#1 \atop \;}\hspace*{-0.1in} \mbox{\put(0,0){\line(2,1){2}}} \hspace*{0.1in} {\; \atop #2}}}


\newcommand{\F}{\mathbb{F}}
\newcommand{\E}{\mathbb{E}}
\newcommand{\K}{\mathbb{K}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\C}{\mathbb{C}}

\newcommand{\LEMMA}{\vspace{0.05in} \noindent \fbox{\large\bf Lemma:}  }
\newcommand{\COR}{\vspace{0.05in} \noindent \fbox{\large\bf Corollary:}  }
\newcommand{\DEF}{\vspace{0.05in} \noindent \fbox{\large\bf Definition:}  }
\newcommand{\THM}{\vspace{0.05in} \noindent \fbox{\large\bf Theorem:}  }
\newcommand{\PROP}{\vspace{0.05in} \noindent \fbox{\large\bf Proposition:}  }
\newcommand{\EX}{\vspace{0.05in} \noindent \fbox{\large\bf Example:}  }
\newcommand{\bproof}{\vspace{0.05in} \noindent {\bf Proof:} }
\newcommand{\eproof}{$\blacksquare$ \vspace{0.05in}}

\newcommand{\Syl}{\mathcal{S}\text{yl}}


\begin{document}

\setlength\itemsep{0pt}

%\pagestyle{empty}

\noindent
{\bf Math 1120}
\hfill {\Large \bf Three Paths to a Solution} \hfill 
{\bf Calculus 2}

\vspace{0.1in}

Some integration by parts problems can be handled via alternate techniques that are much easier to implement in certain cases. Here we consider the example of $\int e^{-x}\cos(2x)\,dx$. First, we solve this using integration by parts. Specifically, we integrate by parts twice and then solve for the integral.

\EX $\displaystyle \int e^{-x}\cos(2x)\,dx$. \qquad [Standard Solution]

The standard solution is to integrate by parts twice and then solve for the integral. Let $I = \displaystyle \int e^{-x}\cos(2x)\,dx$.  To apply integration by parts we can let $u=e^{-x}$ and $dv=\cos(2x)\,dx$. Then $du=-e^{-x}\,dx$ and $v=\dfrac{1}{2}\sin(2x)$ [integrate $dv=\cos(2x)\,dx$ using a simple $u$-substitution]. Therefore, 
$$I = \displaystyle \int e^{-x}\cos(2x)\,dx = \dfrac{1}{2}e^{-x}\sin(2x)-\int \dfrac{1}{2}\sin(2x)(-e^{-x})\,dx = \dfrac{1}{2}e^{-x}\sin(2x)+\int \dfrac{1}{2}e^{-x}\sin(2x)\,dx$$
Again, apply integration by parts: $u=e^{-x}$ and $dv=\dfrac{1}{2}\sin(2x)\,dx$ so that $du=-e^{-x}\,dx$ and $v=-\dfrac{1}{4}\cos(2x)$ [using another easy $u$-substitution]. Thus
$$I =  \dfrac{1}{2}e^{-x}\sin(2x)-\dfrac{1}{4}e^{-x}\cos(2x)-\int -\dfrac{1}{4}\cos(2x)(-e^{-x})\,dx =  \dfrac{1}{2}e^{-x}\sin(2x)-\dfrac{1}{4}e^{-x}\cos(2x)- \dfrac{1}{4} \int e^{-x}\cos(2x)\,dx$$ 
We have $I=\dfrac{1}{2}e^{-x}\sin(2x)-\dfrac{1}{4}e^{-x}\cos(2x)-\dfrac{1}{4}I$ so that $\dfrac{5}{4}I=\dfrac{1}{2}e^{-x}\sin(2x)-\dfrac{1}{4}e^{-x}\cos(2x)$ and so $$I=\mbox{ \fbox{$\dfrac{2}{5}e^{-x}\sin(2x)-\dfrac{1}{5}e^{-x}\cos(2x)+C$}}$$

\vspace{0.05in}

Another approach is to use {\it undetermined coefficients}. When asked to integrate something that is the solution of a ``homogeneous linear differential equation with constant coefficients'', it turns out that the integral must be made of the same stuff that make up the integrand's derivatives. This allows us to guess a form for the integral and then solve to figure out exactly what coefficients give us our antiderivative. Since solutions of these differential equations have the form $x^ke^{ax}\cos(bx)$ or $x^ke^{ax}\sin(bx)$, this technique will work for any such integral. We give two new examples and then rework the above example using this technique.

\EX $\displaystyle \int x^3e^{2x}\,dx$.

Notice that derivatives of $x^3e^{2x}$ involve terms built from $x^3e^{2x}$, $x^2e^{2x}$, $xe^{2x}$, and $e^{2x}$. So we {\it guess} that the integral must look like: $$\int x^3e^{2x}\,dx = (Ax^3+Bx^2+Cx+D)e^{2x}+\text{[An Arbitrary Constant]}$$ 
Differentiate both sides of this equation (the right hand side with the product rule) and get:
$$x^3e^{2x} = (3Ax^2+2Bx+C)e^{2x}+(Ax^3+Bx^2+Cx+D)2e^{2x} = (2Ax^3+(3A+2B)x^2+(2B+2C)x+(C+2D))e^{2x}$$
Since the left hand side is $(1x^3+0x^2+0x+0)e^{2x}$, to make these sides match we must have $2A=1$, $3A+2B=0$, $2B+2C=0$, and $C+2D=0$. Therefore, $A=\dfrac{1}{2}$, $B=-\dfrac{3}{2}A=-\dfrac{3}{4}$, $C=-B=\dfrac{3}{4}$, and $D=-\dfrac{1}{2}C=-\dfrac{3}{8}$. Therefore,
$$\int x^3e^{2x}\,dx = \mbox{\fbox{$\displaystyle \left(\dfrac{1}{2}x^3-\dfrac{3}{4}x^2+\dfrac{3}{4}x-\dfrac{3}{8}\right)e^{2x}+C$}}$$

\EX $\displaystyle \int xe^x\sin(x)\,dx$. 

The derivatives of the integrand tell us that our guess should be:
$$\int xe^x\sin(x)\,dx = Axe^x\sin(x)+Bxe^x\cos(x)+Ce^x\sin(x)+De^x\cos(x)+\text{[An Arbitrary Constant]}$$
Differentiate both sides, do some algebra, and get:
$$xe^x\sin(x) = (A-B)xe^x\sin(x)+(A+C-D)e^x\sin(x)+(A+B)xe^x\cos(x)+(B+C+D)e^x\cos(x)$$
To match up terms we need $A-B=1$, $A+C-D=0$, $A+B=0$, and $B+C+D=0$. Thus $A=B+1$ and $A=-B$ so $-2B=1$ and thus $B=-1/2$ and $A=1/2$. Adding the second and fourth equations together gives: $A+C-D+B+C+D=0+0$ so that $(A+B)+2C=0$ and so $2C=0$ and thus $C=0$. Now $0=B+C+D=-1/2+0+D$ so $D=1/2$. Therefore,
$$\int xe^x\sin(x)\,dx = \mbox{\fbox{$\displaystyle \dfrac{1}{2}xe^x\sin(x)-\dfrac{1}{2}xe^x\cos(x)+\dfrac{1}{2}\cos(x)+C$}}$$

\EX $\displaystyle \int e^{-x}\cos(2x)\,dx$. \qquad [Undetermined Coefficients Solution]

Considering derivatives of our integrand we arrive at the following guess:
$$\int e^{-x}\cos(2x)\,dx = Ae^{-x}\cos(2x) + Be^{-x}\sin(2x) + \text{[An Arbitrary Constant]}$$
Differentiate both sides and get: 
$$e^{-x}\cos(2x) = -Ae^{-x}\cos(2x)-2Ae^{-x}\sin(2x)-Be^{-x}\sin(2x)+2Be^{-x}\cos(2x)$$ $$= (-A+2B)e^{-x}\cos(2x)+(-2A-B)e^{-x}\sin(2x)$$
Therefore, to make both sides match we need $-A+2B=1$ and $-2A-B=0$. Adding the first equation to 2 times the second equation yields: $-A+2B-4A-2B=1+2(0)$ so that $-5A=1$ and thus $A=-1/5$. Thus $B=-2A=2/5$. Therefore, as before we get:
$$ \int e^{-x}\cos(2x)\,dx=\mbox{ \fbox{$-\dfrac{1}{5}e^{-x}\cos(2x)+\dfrac{2}{5}e^{-x}\sin(2x)+C$}}$$

One final approach is to use {\it complexification}. Euler observed that one {\it should} define $e^{ix}=\cos(x)+i\sin(x)$ where $i^2=-1$ (i.e., $i=\sqrt{-1}$). We will explain this in more detail later. Thus $e^{(a+bi)x} = e^{ax+bxi} = e^{ax}e^{bxi} = e^{ax}\cos(bx)+ie^{ax}\sin(bx)$. It turns out that integration involving complex coefficients works essentially the same way as it does for real coefficients. Let us redo our main example using these observations.

\EX $\displaystyle \int e^{-x}\cos(2x)\,dx$. \qquad [Complexified Solution]

Notice that $e^{-x}\cos(2x)$ is the real part of $e^{-x}\cos(2x)+ie^{-x}\sin(2x) = e^{(-1+2i)x}$. Since $\displaystyle \int e^{kx}\,dx = \dfrac{1}{k}e^{kx}+C$, we can integrate and get:
$$\int e^{(-1+2i)x}\,dx = \dfrac{1}{-1+2i}e^{(-1+2i)x}+C = \dfrac{-1-2i}{-1-2i}\cdot \dfrac{1}{-1+2i}e^{(-1+2i)x}+C = \dfrac{-1-2i}{5}e^{(-1+2i)x}+C$$
since $(-1-2i)(-1+2i)=1+2i-2i-2i(2i)=1-4i^2=1+4=5$. Now we expand our result to see what its real and imaginary parts are:
$$ \dfrac{-1-2i}{5}e^{(-1+2i)x} = \left(-\dfrac{1}{5}-\dfrac{2}{5}i\right)\left(e^{-x}\cos(2x)+ie^{-x}\sin(2x)\right)$$  $$=-\dfrac{1}{5}e^{-x}\cos(2x)-i\dfrac{2}{5}e^{-x}\cos(2x)-i\dfrac{1}{5}e^{-x}\sin(2x)-i^2\dfrac{2}{5}e^{-x}\sin(2x)$$
$$=\left(-\dfrac{1}{5}e^{-x}\cos(2x)+\dfrac{2}{5}e^{-x}\sin(2x)\right)+i\left(-\dfrac{2}{5}e^{-x}\cos(2x)-\dfrac{1}{5}e^{-x}\sin(2x)\right)$$
Since our original integral was the real part of our complexified function, its integral is the real part of this result. Therefore, once again we get:
$$\int e^{-x}\cos(2x)\,dx = \mbox{\fbox{$-\dfrac{1}{5}e^{-x}\cos(2x)+\dfrac{2}{5}e^{-x}\sin(2x) + C$}}$$

Since $e^{-x}\sin(2x)$ was the imaginary part, we also get (for free) that:
$$\int e^{-x}\sin(2x)\,dx =-\dfrac{2}{5}e^{-x}\cos(2x)-\dfrac{1}{5}e^{-x}\sin(2x)+C$$

\end{document}