I know that integration by parts leads to an infinite loops of sin and cos so what do I do?
I can't do $u$ substitution because I can't get rid of all the variables.
$$\int e^{-x} \cos x \,\mathrm{d}x$$
I know that integration by parts leads to an infinite loops of sin and cos so what do I do?
I can't do $u$ substitution because I can't get rid of all the variables.
$$\int e^{-x} \cos x \,\mathrm{d}x$$
hint:$$\large{\int e^{-x} \cos x dx=\int e^{-x}\left(\frac{e^{ix}+e^{-ix}}{2} \right)}dx$$
Integrate by parts twice, splitting the integral the same way both times, and solve for the integral.
Let $u=e^{-x}$ and $dv=\cos xdx$, so that $du=-e^{-x}dx$ and $v=\sin x$. Then
$$\int e^{-x}\cos xdx=e^{-x}\sin x+\int e^{-x}\sin x dx\;.$$
Now let $u=e^{-x}$ again, so that $dv=\sin x dx$; $du=-e^{-x}dx$, $v=-\cos x dx$, and
$$\int e^{-x}\cos xdx=e^{-x}\sin x-e^{-x}\cos x-\int e^{-x}\cos x dx\;.$$
Solve this equation for $\int e^{-x}\cos x dx$; don’t forget the constant of integration.
This is a standard trick that comes up quite often.
That's the entire point - you want to go through a loop once and use the "feedback" to get the answer.
Integrate by parts as follows:
$$\begin{align}\int dx \, e^{-x} \, \cos{x} &= -e^{-x} \cos{x} - \int dx \, e^{-x} \, \sin{x} \\ &=-e^{-x} \cos{x} + e^{-x} \sin{x} - \int dx \, e^{-x} \, \cos{x} \end{align}$$
Now do you see that you could go on forever...or you can just combine the like terms in the equation. (That is the feedback aspect.) When you do this, you find that
$$\int dx \, e^{-x} \, \cos{x} = \frac12 \left ( \sin{x} - \cos{x} \right ) + C$$
where $C$ is a constant of integration.
If you can manage to guess or remember that $e^{-x}\cos x$ has an indefinite integral of the form $e^{-x}(A\cos x+B\sin x)$ where $A$ and $B$ are constants, then by differentiating and solving a system of linear equations you can figure out that $A=-\frac1 2,\;B=\frac1 2$. This is called the Method of Undetermined Coefficients.
Since $\cos x=\mathrm{Re} (e^{ix})$ then $$\int e^{-x}\cos x dx=\mathrm{Re}\int e^{(i-1)x}dx=\mathrm{Re}\frac{e^{(i-1)x}}{i-1}+C$$
the rest is a simple calculation I leave it for you.
\sin
,\log
- see entry 11 in our MathJax guide). – Zev Chonoles Jul 12 '13 at 20:29