Note that the term on the right is the integral we are trying to evaluate, hence the above may be written as follows
2 sin(x)e^{x} dx = sin(x)e^{x} - cos(x)e^{x}

Hence the integral is given by

sin(x)e^{x} dx = (1/2)e^{x} (sin(x) - cos(x)) + C

Example 2: Evaluate the integral

cos(2x)e^{x} dx

Solution to Example 2:

Substitution: Let u = cos(2x) and dv/dx = e^{x} and apply the integration by parts.

cos(2x)e^{x} dx = cos(2x)e^{x} --2sin(2x)e^{x} dx
= cos(2x)e^{x} +2sin(2x)e^{x} dx
Apply integration by parts to the term on the right

= cos(2x)e^{x} + 2{sin(2x)e^{x} - 2cos(2x)e^{x} dx }
= cos(2x)e^{x} + 2sin(2x)e^{x} - 4cos(2x)e^{x} dx
Note that the term on the right is related to the integral we are trying to evaluate, we can write that

5cos(2x)e^{x} dx = cos(2x)e^{x} + 2sin(2x)e^{x}

The given integral is

cos(2x)e^{x} dx = (1/5)e^{x} {cos(2x) + 2sin(2x)} + C

Example 3: Evaluate the integral

sin(3x + 2) e^{3x} dx

Solution to Example 3:

Substitution: Let u = sin(3x + 2) and dv/dx = e^{3x} and apply the integration by parts twice.