is there a nicer way to $\int e^{2x} \sin x\, dx$?

Solution 1:

we have

$$ \int e^{2x}\sin x \mathrm d x = (A\cos x + B\sin x)e^{2x} $$

Equation is the same at both ends of the derivative $x$

$$ e^{2x}\sin x = 2e^{2x}(A\cos x +B \sin x) + (B\cos x -A\sin x)e^{2x} $$

Finishing $$ e^{2x}\sin x =(2B-A)\sin x\,e^{2x} +(2A+B)\cos x\,e^{2x} $$

Compare coefficient,we have $$ 2A+B = 0\\ 2B-A = 1 $$ Solutions have $$ A =-\frac{1}{5} \\ B=\frac{2}{5} $$

Solution 2:

$$ \begin{align*} \\ \int e^{2x}\sin x dx &= \Im \int e^{2x}(\cos x + i\sin x) dx \\ &= \Im \int e^{(2 + i)x}dx \\ &= \Im \frac{e^{(2 + i)x}}{2+i} + C \\ &= \Im \frac15 e^{2x}(\cos x + i\sin x)(2-i) + C \\ &= \frac15 e^{2x}(2\sin x - \cos x) +C \end{align*}$$