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.
$\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 $
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.
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}$)