∫ sin²x / eˣ dx

Start with power reduction formula:

∫ (½ - ½ cos(2x)) / eˣ dx

½ ∫ (1 - cos(2x)) e⁻ˣ dx

Integrate by parts:

u = 1 - cos(2x), du = 2 sin(2x) dx

dv = e⁻ˣ dx, v = -e⁻ˣ

½ [ (1 - cos(2x))(-e⁻ˣ) - ∫ -e⁻ˣ (2 sin(2x) dx) ]

½ [ (cos(2x) - 1) e⁻ˣ + 2 ∫ e⁻ˣ sin(2x) dx ]

½ (cos(2x) - 1) e⁻ˣ + ∫ e⁻ˣ sin(2x) dx

↑ Keep this equation in mind, we'll be coming back to it.

Integrate by parts a second time:

u = sin(2x), du = 2 cos(2x) dx

dv = e⁻ˣ dx, v = -e⁻ˣ

½ (cos(2x) - 1) e⁻ˣ + [ -e⁻ˣ sin(2x) - ∫ -e⁻ˣ (2 cos(2x) dx) ]

½ (cos(2x) - 1) e⁻ˣ - e⁻ˣ sin(2x) + 2 ∫ e⁻ˣ cos(2x) dx

Integrate by parts a third time:

u = cos(2x), du = -2 sin(2x) dx

dv = e⁻ˣ dx, v = -e⁻ˣ

½ (cos(2x) - 1) e⁻ˣ - e⁻ˣ sin(2x) + 2 [ -e⁻ˣ cos(2x) - ∫ -e⁻ˣ (-2 sin(2x) dx) ]

½ (cos(2x) - 1) e⁻ˣ - e⁻ˣ sin(2x) + 2 [ -e⁻ˣ cos(2x) - 2 ∫ e⁻ˣ sin(2x) dx ]

½ (cos(2x) - 1) e⁻ˣ - e⁻ˣ sin(2x) - 2e⁻ˣ cos(2x) - 4 ∫ e⁻ˣ sin(2x) dx

Now remember that this is equal to the equation from earlier:

½ (cos(2x) - 1) e⁻ˣ + ∫ e⁻ˣ sin(2x) dx = ½ (cos(2x) - 1) e⁻ˣ - e⁻ˣ sin(2x) - 2e⁻ˣ cos(2x) - 4 ∫ e⁻ˣ sin(2x) dx

∫ e⁻ˣ sin(2x) dx = -e⁻ˣ sin(2x) - 2e⁻ˣ cos(2x) - 4 ∫ e⁻ˣ sin(2x) dx

5 ∫ e⁻ˣ sin(2x) dx = -e⁻ˣ sin(2x) - 2e⁻ˣ cos(2x)

∫ e⁻ˣ sin(2x) dx = -⅕ e⁻ˣ [ sin(2x) + 2cos(2x) ]

Therefore, substituting into the earlier equation:

½ (cos(2x) - 1) e⁻ˣ - ⅕ e⁻ˣ [ sin(2x) + 2cos(2x) ]

e⁻ˣ [ ½ cos(2x) - ½ - ⅕ sin(2x) - ⅖ cos(2x) ]

e⁻ˣ [ ¹/₁₀ cos(2x) - ½ - ⅕ sin(2x) ]

¹/₁₀ e⁻ˣ [ cos(2x) - 5 - 2 sin(2x) ]

And of course, don't forget the arbitrary constant:

¹/₁₀ e⁻ˣ [ cos(2x) - 5 - 2 sin(2x) ] + C