Solution:
Key idea: We write sinx=(1+sinx)−1 to split the integrand into 1+sinx and 1+sinx1. Then 1+sinx is the perfect square (cos2x+sin2x)2.
Step 1 — Split the integrand.
We add and subtract 1 in the numerator and divide each part by 1+sinx.
1+sinxsinx=1+sinx(1+sinx)−1
1+sinxsinx=1+sinx−1+sinx1
Step 2 — Write 1+sinx as a square.
We use 1=cos22x+sin22x and sinx=2sin2xcos2x.
1+sinx=(cos2x+sin2x)2
We work where cos2x+sin2x>0 (this holds for −2π<x<23π), so the root is the bracket itself.
1+sinx=cos2x+sin2x
Step 3 — Write the root as one sine.
We take out 2 and use sin(A+B)=sinAcosB+cosAsinB, with B=4π.
1+sinx=2sin(2x+4π)
Step 4 — Integrate the first part.
Each half-angle term integrates with a factor 2.
∫(cos2x+sin2x)dx=2sin2x−2cos2x
Step 5 — Integrate the second part by substitution.
We put u=2x+4π, so dx=2du, and use ∫cosecudu=logtan2u.
∫2sin(2x+4π)dx=22∫cosecudu
∫1+sinxdx=2logtan2u
∫1+sinxdx=2logtan(4x+8π)
Step 6 — Combine (first part minus second part).
We subtract the result of Step 5 from that of Step 4 and add the constant.
I=2(sin2x−cos2x)−2logtan(4x+8π)+C
Therefore, ∫1+sinxsinxdx=2(sin2x−cos2x)−2logtan(4x+8π)+C for −2π<x<23π.