Using integration by parts, show that $\displaystyle \int e^{2x} \sin x dx=\dfrac{1}{5}e^{2x}(2\sin x-\cos x)+c$
I have the mark scheme in front of me, but there's something I don't understand.

I don't understand how the markscheme goes from the 2nd line to the 3rd line. In my working, I'm on $-\cos x e^{2x}+(2 \sin xe^{2x}-\int4e^{2x}\sin x dx)$. The last integral is the same as the start, but with a constant - doesn't that put me in an infinite loop?