I'm trying to solve this indefinite integral using the integration by parts $$ \int e^{-x} \sin(x) \,dx$$
but I'm stuck on the second iteration, which takes me to:
$$\int e^{-x} \sin(x) \,dx = -e^{-x} \sin(x) -e^{-x} \cos(x)-\int e^{-x}\sin(x) \,dx$$
Given the integration by parts formula of $\int u\,dv = uv - \int v\,du$
Which I applied twice, once with $u=\sin(x)$ and $du=e^{-x}$, and once with $u=\cos(x)$ and $du=e^{-x}$.
At this point my only guess was to simplify, having as result:
$$1 = -e^{-x} \sin(x) -e^{-x} \cos(x)-1$$
$$ = -e^{-x} (\sin(x) + \cos(x) + 2) $$
Which however appears to be wrong, since the correct answer should be:
$$ -\frac{1}{2} e^{-x} (\cos(x) + \sin(x))$$
Thanks in advance for your help