1. ## integral problem

I need help finding the integral for:

Cos(x)*E^x

I've tried integrating by parts, and I keep going in circles, but maybe there's a trick I'm missing.

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

$\displaystyle u = \cos{x}$

$\displaystyle du = -\sin{x} \, dx$

$\displaystyle dv = e^x \, dx$

$\displaystyle v = e^x$

$\displaystyle \int e^x \cos{x} \, dx = e^x \cos{x} + \int e^x \sin{x} \, dx$

use parts again ...

$\displaystyle u = \sin{x}$

$\displaystyle du = \cos{x} \, dx$

$\displaystyle dv = e^x \, dx$

$\displaystyle v = e^x$

$\displaystyle \int e^x \cos{x} \, dx = e^x \cos{x} + e^x \sin{x} - \int e^x \cos{x} \, dx$

$\displaystyle 2\int e^x \cos{x} \, dx = e^x \cos{x} + e^x \sin{x}$

$\displaystyle \int e^x \cos{x} \, dx = \frac{e^x \cos{x} + e^x \sin{x}}{2} + C$

3. Originally Posted by andyourluckynumberis3.14
I need help finding the integral for:

Cos(x)*E^x

I've tried integrating by parts, and I keep going in circles, but maybe there's a trick I'm missing.
An alternative approach if you're familiar with complex variable theory:

Note that $\displaystyle \cos (x) \, e^x = \text{Re} \left[e^{ix} \cdot e^x\right] = \text{Re}\left[e^{(1 + i)x}\right]$.

Then the integral becomes $\displaystyle \int \text{Re} \left[e^{(1 + i)x}\right] \, dx = \text{Re} \int e^{(1 + i)x} \, dx$

(reversing the order of the operators requires justification of course).

Now do the simple integral and take the real part of the result.

4. And yet another approach would be to let: $\displaystyle I = \int e^x cos(x)$, and integrate twice using parts. When you do that, you end up generating I on the RHS.

$\displaystyle I = e^xcos(x) - \int e^x (-sin(x)) dx$

$\displaystyle I = e^x cos(x) + e^xsin(x) -\int e^xcos(x)dx + C^*$

Which of course gives:

$\displaystyle I = e^x cos(x) + e^xsin(x) - I +C^*$

And hence can solve algebraically for I to get:

$\displaystyle I = \frac{ e^x cos(x) + e^xsin(x)}{2} + C$

(where $\displaystyle C = \frac{C^*}{2}$)

5. Originally Posted by Mush
And yet another approach would be to let: $\displaystyle I = \int e^x cos(x)$, and integrate twice using parts. When you do that, you end up generating I on the RHS.

$\displaystyle I = e^xcos(x) - \int e^x (-sin(x)) dx$

$\displaystyle I = e^x cos(x) + e^xsin(x) -\int e^xcos(x)dx + C^*$

Which of course gives:

$\displaystyle I = e^x cos(x) + e^xsin(x) - I +C^*$

And hence can solve algebraically for I to get:

$\displaystyle I = \frac{ e^x cos(x) + e^xsin(x)}{2} + C$

(where $\displaystyle C = \frac{C^*}{2}$)
Echoes of post #2 ....?

6. Originally Posted by mr fantastic
Echoes of post #2 ....?
Ah very sorry, didn't see that! I just read the first few lines of that post with all the u v stuff and for some reason assumed he was using some variation of integration by substitution, didn't realise is was equivalent to my method.

Apologies.