The integral is ∫1+sin2xcosx−sinxdx
Using the identity sin2x=2sinxcosx:
1+sin2x=1+2sinxcosx
Since sin2x+cos2x=1:
1+sin2x=sin2x+cos2x+2sinxcosx
=(sinx+cosx)2
The integral becomes:
∫(sinx+cosx)2cosx−sinxdx
Let t=sinx+cosx
Differentiating both sides:
dt=(cosx−sinx)dx
Substituting into the integral:
∫t21dt
=∫t−2dt
=−1t−1+C
=−t1+C
Substituting back t=sinx+cosx:
−sinx+cosx1+C
Therefore, the answer is cosx+sinx−1+C