Use integration by parts to find
taking u = sin x for the first integration.
u = sin x
v' = ex
u' = cos x
v = ex
When we stuff everything into the integration-by-parts formula, we get
Now we need to use integration by parts again to find
Remembering the lessons of the previous example, we'll keep u and v' with their same parts by taking
u = cos x
u' = -sin x
We put this into the formula and get
Putting this back into the first application of the formula for gives us
(being careful to properly distribute the negative sign!).
Again, we've found a formula we can solve for .