Solution:
Key idea: We write sin2x=2sinxcosx and cancel sinx. What is left is a constant times secx, and ∫secxdx=log∣secx+tanx∣+C.
Step 1 — Simplify the fraction.
We use the double-angle formula for sin2x.
sin2xsinx=2sinxcosxsinx
We cancel sinx, which is allowed wherever sinx=0 (the integrand is not defined there anyway).
2sinxcosxsinx=2cosx1
2cosx1=21secx
Step 2 — Integrate.
We take the constant 21 outside and use the standard integral of secx.
∫21secxdx=21log∣secx+tanx∣+C
Therefore, ∫sin2xsinxdx=21log∣secx+tanx∣+C.