Solution:
Given =1+sin2xcosx−sinx
By using the standard trigonometric identity, (1+sin2x)=sin2x+cos2x+2sinxcosx.
Then,
=(sin2x+cos2x)+2sinxcosxcosx−sinx=(sinx+cosx)2cosx−sinx
Now,
Let us assume that, sinx+cosx=t
And also, (cosx−sinx)dx=dt
Integrating on both the sides and substitute the value of (cosx−sinx)dx and (sinx+cosx) we get,
=∫1+sin2xcosx−sinxdx=∫(sinx+cosx)2cosx−sinxdx=∫t2dt=−t−1+C=−t1+C=sinx+cosx−1+C