Solution:
Key idea: We lower the power with sin2x=21−cos2x, so I=21∫exdx−21L with L=∫excos2xdx. We find L by parts twice, ∫uvdx=u∫vdx−∫(dxdu∫vdx)dx, keeping ex as the second function.
Step 1 — Lower the power and split.
We replace sin2x and split into two integrals.
I=21∫exdx−21∫excos2xdx
I=21ex−21L
Step 2 — First use of parts on L.
We take u=cos2x, so dxdu=−2sin2x, and ∫exdx=ex.
L=excos2x−∫(−2sin2x)exdx
L=excos2x+2∫exsin2xdx
Step 3 — Second use of parts.
Now we take u=sin2x, so dxdu=2cos2x.
∫exsin2xdx=exsin2x−2∫excos2xdx
∫exsin2xdx=exsin2x−2L
Step 4 — Solve for L.
We put Step 3 into Step 2, add 4L to both sides and divide by 5.
L=excos2x+2exsin2x−4L
5L=ex(cos2x+2sin2x)
L=51ex(cos2x+2sin2x)
Step 5 — Combine.
We put L into Step 1 and add the constant.
I=21ex−101ex(cos2x+2sin2x)+C
Therefore, ∫exsin2xdx=21ex−101ex(cos2x+2sin2x)+C.