Limitation of integration by parts to compute $\int e^{-x}(\cos wx + w\sin wx)dx$ I tried to solve the following question by integration by parts but it gets iterative and no solution is found. 
$$\int e^{-x}(\cos wx + w\sin wx)dx$$
where $w$ is constant.
Is there any method by which this question could be solved? I don't want the whole solution but an idea how to deal with such type of questions.
 A: Forget integration by parts here. There's a simpler way. I'll do one of the terms, the other is similar. 
$$\int e^{-x}\cos{wx} dx = Re(\int e^{-x}\cos{wx} dx) = Re(\int e^{-(1+jw)x} dx) = Re(-1/(1+jw) e^{-(1+jw)x}) = -1/(1-w^2)e^{-x}\cos{wx}$$
Double check my algebra please - I haven't done this in years.
A: Hint; Separate the intgral into 2 parts like this;
$$\int e^{-x}(\cos wx + w\sin wx)dx= \int e^{-x}(\cos wx) dx+\int e^{-x}(w\sin wx)dx$$
Then integrate by parts the first one 'till magic happens.
Hint#2; $e^{-x}\cos wx$ can be written as $-\cos wx \times -e^{-x}$
A: One can note that 
$$\int e^{-x}(\cos wx + w\sin wx)dx = \int e^{g(x)}[f'(x) + g'(x)f(x)] dx$$
with $f(x)= - \cos wx $  and $g(x)=-x.$ 
So according the the formula $$\int e^{g(x)}[f'(x) + g'(x)f(x)] dx = f(x) e^{g(x)}+C$$
the answer is
$$\int e^{-x}(\cos wx + w\sin wx)dx =f(x)e^{g(x)} = -(\cos wx) e^{-x}+C.$$
For the proof of the formula one can see:  
Proof for formula $\int e^{g(x)}[f'(x) + g'(x)f(x)] dx = f(x) e^{g(x)}+C$
