0

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$$

alexwlchan
  • 2,060

5 Answers5

2

hint:$$\large{\int e^{-x} \cos x dx=\int e^{-x}\left(\frac{e^{ix}+e^{-ix}}{2} \right)}dx$$

M.H
  • 11,498
  • 3
  • 30
  • 66
  • 1
    Note, though, that someone taking first-year calculus in a U.S. school is has probably never seen the exponential forms of sine and cosine and may well never have worked with complex numbers. – Brian M. Scott Jul 12 '13 at 20:34
  • @Brian M. Scott: i don't have enough information about education system of u.s school maybe its better integrate by part – M.H Jul 12 '13 at 20:40
  • @BrianM.Scott What better reason to investigate ... I don't know the US, but when I first engaged with this (penultimate year of high school UK some years ago) it excited me. The approach is worth knowing, if it opens such insight. – Mark Bennet Jul 12 '13 at 20:42
  • I wasn’t criticizing the answer; I assumed that you probably didn’t know. My comment was to let you know and to reassure a typical U.S. student who might be reading this that it was all right to find this approach unfamiliar. – Brian M. Scott Jul 12 '13 at 20:44
  • Yeah I definitely have no idea why that equality is true. – Paul the Pirate Jul 12 '13 at 20:49
  • @Mark: I didn’t suggest otherwise. My comment was meant primarily as reassurance (if needed) that the OP wasn’t actually missing anything if the answer seemed a bit opaque. – Brian M. Scott Jul 12 '13 at 20:49
  • @BrianM.Scott And I just wanted to make sure OP knew there was an insight worth investigating. Cross purposes! I hope helpful. – Mark Bennet Jul 12 '13 at 21:07
  • @PaulthePirate There is an identity $\cos x = \frac {e^{ix}+e^{-ix}}2$ which can be proved in various ways, which encapsulates mathematical insight, and which is just worth knowing. – Mark Bennet Jul 12 '13 at 21:11
2

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.

Brian M. Scott
  • 616,228
2

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.

Ron Gordon
  • 138,521
2

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.

1

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.