How to evaluate the integral $\int e^{2x} \sin^2x\ dx$ How can I evaluate the following integral?
$$\int e^{2x} \sin^2x\ dx$$
 A: Note that 
$$\int (e^x \sin x)^2\, dx = \int e^{2x}\left[\frac{e^{ix}-e^{-ix}}{2i}\right]^2 \, dx= -\frac1{4}\int [e^{2(1+i)x}-2e^{2x}+e^{2(1-i)x}] \,dx \\= -\frac1{8(1+i)}e^{2(1+i)x}+\frac{2e^{2x}}{8}-\frac1{8(1-i)}e^{2(1-i)x}+C=\\=-\frac1{8}e^{2x}\left[-2+\frac{e^{2ix}}{1+i}+\frac{e^{-2ix}}{1-i}\right]+C\\-\frac1{8}e^{2x}[-2+\cos (2x)+\sin(2x)]+C$$
A: Here are the steps
\[
\int e^{2x}\sin^{2} x\ dx=\frac{1}{2}\int e^{2x}(1-\cos(2x))\ dx
\]
Let $u=2x$
\[
\frac{d}{dx}u=2\Rightarrow du=2\ dx \Rightarrow \frac{1}{2}du=dx
\]
Then
\[
\frac{1}{2}\int e^{2x}(1-\cos(2x))\ dx= \frac{1}{4}\int e^{u}(1-\cos u)\ du = \frac{1}{4}\int e^{u}-e^{u}\cos u\ du
\]
\[
= \frac{1}{4}\int e^{u}\ du- \frac{1}{4}\int e^{u}\cos u\ du= \frac{1}{4}e^{u}- \frac{1}{8}e^{u}(\sin u+\cos u) +C
\]
\[
=\frac{2}{8}e^{u}- \frac{1}{8}e^{u}(\sin u+\cos u) +C=-\frac{1}{8}e^{2x}(\sin(2x)+\cos(2x)-2)+C
\]
Thus
\[
\int e^{2x}\sin^{2} x\ dx =-\frac{1}{8}e^{2x}(\sin(2x)+\cos(2x)-2)+C
\]
A: Using operator D and its properties, we have
$$
\int e^{2x}\sin^2xdx = \dfrac{1}{2D}[e^{2x} - e^{2x}\cos(2x)] = \dfrac{1}{4}e^{2x} - \dfrac{e^{2x}}{2}\dfrac{1}{D+2}\cos(2x) 
$$
$$
= \dfrac{1}{4}e^{2x} - \dfrac{e^{2x}}{2}\dfrac{D - 2}{D^2 - 4}\cos(2x) = \dfrac{1}{4}e^{2x} + \dfrac{e^{2x}}{16}[-2\sin(2x) - 2\cos(2x)] 
$$
$$
=  \dfrac{1}{4}e^{2x} - \dfrac{e^{2x}}{8}[\sin(2x) + \cos(2x)] + C
$$
