Find the indefinite integral \[ \int e^{2x}\sin x\,dx. \]
Solution
1. Integration by parts gives\[ \int e^{2x}\sin x\,dx = -e^{2x}\cos x + 2\int e^{2x}\cos x\,dx. \]
Take \[ u=e^{2x}, \qquad dv=\sin x\,dx. \] Then \[ du=2e^{2x}\,dx, \qquad v=-\cos x. \] The integration-by-parts formula \[ \int u\,dv=uv-\int v\,du \] gives the displayed identity, with the arbitrary additive constant understood.
2. A second integration by parts gives\[ \int e^{2x}\cos x\,dx = e^{2x}\sin x - 2\int e^{2x}\sin x\,dx. \]
Now take \[ u=e^{2x}, \qquad dv=\cos x\,dx. \] Then \[ du=2e^{2x}\,dx, \qquad v=\sin x, \] and integration by parts gives the claim.
3. Therefore\[ \boxed{ \int e^{2x}\sin x\,dx = \frac{e^{2x}(2\sin x-\cos x)}5+C. } \]
Substitute step 2 into step 1: \[ \begin{aligned} \int e^{2x}\sin x\,dx &= -e^{2x}\cos x + 2\left( e^{2x}\sin x - 2\int e^{2x}\sin x\,dx \right). \end{aligned} \] Moving the last integral to the left gives \[ 5\int e^{2x}\sin x\,dx = e^{2x}(2\sin x-\cos x)+C, \] where the arbitrary constants from the preceding indefinite integrations have been absorbed into one constant. Dividing by \(5\) gives the stated formula.
4. The expression in step 3 is an antiderivative of\(e^{2x}\sin x\).
Differentiating its nonconstant part gives \[ \begin{aligned} \frac{d}{dx} \left[ \frac{e^{2x}(2\sin x-\cos x)}5 \right] &= \frac{e^{2x}}5 \left[ 2(2\sin x-\cos x) + 2\cos x+\sin x \right]\\ &= e^{2x}\sin x. \end{aligned} \] Thus the formula indeed gives all antiderivatives after adding the arbitrary constant \(C\).
5. Q.E.D.
Step 3 gives the requested indefinite integral, and step 4 verifies it.