How to integrate when integration by parts never ends? So I have the following integration: $\int{e^{-x}\sin{x}}$
I let u be the $e^{-x}$ and $dv = \sin{x} dx$
After doing the integration by parts I get:$(e^{-x})(-\cos{x})-\int{-e^{-x}*(-\cos{x})}$
From what it looks like, if I continue integration by parts, will it just continue going on forever?

$$
\begin{align}
&\int e^{-x}\sin(x)\,\mathrm{d}x\tag{1}\\
&=-\int\sin(x)\,\mathrm{d}e^{-x}\tag{2}\\
&=-e^{-x}\sin(x)+\int e^{-x}\cos(x)\,\mathrm{d}x\tag{3}\\
&=-e^{-x}\sin(x)-\int\cos(x)\,\mathrm{d}e^{-x}\tag{4}\\
&=-e^{-x}\sin(x)-e^{-x}\cos(x)-\int e^{-x}\sin(x)\,\mathrm{d}x\tag{5}\\
&=-\frac12e^{-x}(\sin(x)+\cos(x))\tag{6}
\end{align}
$$
Explanation:
$(2)$: $-\mathrm{d}e^{-x}=e^{-x}\,\mathrm{d}x$
$(3)$: integrate by parts
$(4)$: $-\mathrm{d}e^{-x}=e^{-x}\,\mathrm{d}x$
$(5)$: integrate by parts
$(6)$: average $(1)$ and $(5)$
