Finding $\int e^{2x} \sin{4x} \, dx$ Finding $$\int e^{2x} \sin 4x \, dx$$
I think I should be doing integration by parts...
If I let $u=e^{2x} \Rightarrow du = 2e^{2x}$,
$dv = \sin{4x} \Rightarrow v = -\frac{1}{4} \cos{4x}$
$\int{ e^{2x} \sin{4x}} dx = e^{2x}(-\frac{1}{4}\cos 4x) - \color{red}{\int (-\frac{1}{4} \cos 4x) 2e^{2x} \, dx}$
Highlighted in red, I seem to integrating an exponential times trig expression again ... doesn't seem like te right way to go
So I let $u=\sin{4x} \Rightarrow du = 4\cos 4x \, dx$
$dv = e^{2x} dx \Rightarrow v = \frac{1}{2} e^{2x}$
$\sin{4x}(\frac{1}{2} e^{2x}) - \int (\frac{1}{2} e^{2x})(4\cos4x) \, dx$
Again, its an exponential times a trig function?
Am I using the wrong substitution?

To find $\int e^{2x}\sin4x\,dx,$ we can let $u=e^{2x}$ and $dv=\sin4x\,dx,$ which implies $du=2e^{2x}\,dx$ and $v=-\frac{1}{4}\cos4x.$ Therefore, $$\begin{align}\int e^{2x}\sin4x\,dx &= uv-\int v\,du\\ &= e^{2x}\left(-\frac{1}{4}\cos4x\right)-\int-\frac{1}{4}\cos4x\left(2e^{2x}\right)\,dx\\ &= -\frac{1}{4}e^{2x}\cos4x+\frac{1}{2}\int e^{2x}\cos4x\,dx.\end{align}$$ Apply another integration for $\int e^{2x}\cos4x\,dx,$ this time letting $u=e^{2x}$ and $dv=\cos4x\,dx,$ so that $du=2e^{2x}\,dx$ and $v=\frac{1}{4}\sin4x.$ Hence, $$\begin{align}\int e^{2x}\cos4x\,dx &= uv-\int v\,du\\ &= e^{2x}\left(\frac{1}{4}\sin4x\right)-\int\frac{1}{4}\sin4x\left(2e^{2x}\right)\,dx\\ &= \frac{1}{4}e^{2x}\sin4x-\frac{1}{2}\int e^{2x}\sin4x\,dx.\end{align}$$
Combining both formulas, we get $$\begin{align}\int e^{2x}\sin4x\,dx &= -\frac{1}{4}e^{2x}\cos4x+\frac{1}{2}\left(\frac{1}{4}e^{2x}\sin4x-\frac{1}{2}\int e^{2x}\sin4x\,dx\right)\\ &= -\frac{1}{4}e^{2x}\cos4x+\frac{1}{8}e^{2x}\sin4x-\frac{1}{4}\int e^{2x}\sin4x\,dx.\end{align}$$ So, $$\frac{5}{4}\int e^{2x}\sin4x\,dx=-\frac{1}{4}e^{2x}\cos4x+\frac{1}{8}e^{2x}\sin4x.$$ Therefore, multiplying by $\frac{4}{5}$ and adding in the constant of integration, we see that $$\int e^{2x}\sin4x\,dx=-\frac{1}{5}e^{2x}\cos4x+\frac{1}{10}e^{2x}\sin4x+C,$$ which we can rewrite as $$\int e^{2x}\sin4x\,dx=\frac{1}{10}e^{2x}\left(-2\cos4x+\sin4x\right)+C.$$
