Solution:
Key idea: Write sin2x=2sinxcosx. Then cosxdx is available for the substitution t=sinx, and the result is a rational function of t with two distinct linear factors, which splits into partial fractions.
Step 1 — Substitute t = sin x.
We write sin2x as 2sinxcosx and put t=sinx, so dt=cosxdx.
I=∫(1+sinx)(2+sinx)2sinxcosxdx
I=∫(1+t)(2+t)2tdt
Step 2 — Set up the partial fractions.
Both factors are linear and different, so one constant goes over each.
(1+t)(2+t)2t=1+tA+2+tB
2t=A(2+t)+B(1+t)
Step 3 — Find A and B.
We put t=−1, which removes the B term.
−2=A
We put t=−2, which removes the A term.
−4=−B
B=4
Step 4 — Integrate.
Each fraction gives a logarithm.
I=−2log∣1+t∣+4log∣2+t∣+C
Step 5 — Return to x.
We put back t=sinx. Since 2+sinx>0 and 1+sinx≥0, the modulus signs may be dropped wherever the integrand is defined.
I=4log(2+sinx)−2log(1+sinx)+C
Therefore, ∫(1+sinx)(2+sinx)sin2xdx=4log(2+sinx)−2log(1+sinx)+C.