Evaluate: $\; \displaystyle \int e^{-3 x}\cos 6 x \, dx$ Integration by parts Evaluate: $\; \displaystyle \int e^{-3 x}\cos 6 x \, dx$
Formula to integrate by parts is:
$$ u \cdot v - \int u' \cdot v$$
I'm stuck, here's where I get:
$ u = e^{-3x}, \;\;\;\; du = -3 e^{-3x}$
$ dv = \cos6x, \;\;\;\; v = \frac{\sin6x}{6} $
->
$ e^{-3x} \cdot \frac{\sin6x}{6} - \int -3̶ e^{-3x} \cdot \frac{\sin6x}{6̶} $
2)
$ u = -1 e^{-3x}, \;\;\;\; du = -3 e^{-3x}$
$ dv = \frac{\sin6x}{6}, \;\;\;\; v = - \frac{\cos6x}{6}$
->
$ e^{-3x} \cdot \frac{\sin6x}{6} - (-e^{-3x} \cdot - \frac{\cos6x}{6} - \int -3e^{-3x} \cdot - \frac{\cos6x}{6})$
And on and on it goes, I just can't get rid of e^{-3x}, nor by integrating it nor by differentiating. Perhaps, by integration there's a chance, if I remove power of $e$ somehow.
Anyway, what can I do here?
 A: Clever complex analysis solves this easily, see if you follow:
$\cos x=\Re(e^{ix})$
We'll use this fact and change the integrand to $e^{3x}e^{ix}$.
We'll get,
$$\int e^{(3+i)x}dx=\frac{e^{(3+i)x}}{3+i}=(\frac{3}{10}-\frac{i}{10})e^{3x}e^{ix}=(\frac{3}{10}-\frac{i}{10})e^{3x}(\cos x+ i \sin x)=\frac{3}{10}e^{3x}(\cos x +i \sin x)-\frac{i}{10}e^{3x}(\cos x + i \sin x)+C$$
Taking real parts yields:
$$\frac{3}{10}e^{3x} \cos x+\frac{1}{10} e^{3x} \sin x +C$$
Wolfram Alpha verifies my answer:http://www.wolframalpha.com/input/?i=integrate+e%5E%283x%29+cos%28x%29
Hope this helps. I know it isn't the way you wanted but it is still pretty neat.
A: HINT: Let $$I = \int e^{-3x}\cos6x\ \mathrm{d}x$$ Notice that integral is in your last step. Replace it with an $I$ and then solve for $I$.
A: $\int e^{-3 x}\cos 6 xdx = e^{-3x} \cdot \frac{\sin6x}{6} - (-e^{-3x} \cdot - \frac{\cos6x}{6} - \int -3e^{-3x} \cdot - \frac{\cos6x}{6}dx) = e^{-3x} \frac{\sin6x}{6} - e^{-3x} \frac{\cos6x}{6} + \int e^{-3x} \frac{\cos6x}{2}dx$
then subtract $\int e^{-3x} \frac{cos6x}{2}dx$ from both sides to get: 
$\frac{1}{2}\int e^{-3x}cos6xdx= e^{-3x} \frac{sin6x}{6} - e^{-3x} \frac{cos6x}{6}$
Then multiply through my 2 to get:
$\int e^{-3x}cos6xdx= e^{-3x} \frac{sin6x}{3} - e^{-3x} \frac{cos6x}{3}$
Or
$\int e^{-3x}cos6xdx= \frac{1}{3}e^{-3x}(sin6x- cos6x)$
