Consider the given integral.
I=∫2cosx(1−sinx)(1+sin2x)dx
Let t=sinx
dt=cosxdx
Therefore,
I=∫2(1−t)(1+t2)dt
I=∫(11−t+t+1t2+1)dt
I=−∫1t−1dt+12∫2tt2+1dt+∫1t2+1dt
I=−ln(t−1)+12ln(t2+1)+tan−1t+C
On putting the value of t, we get
I=−ln(sinx−1)+12ln(sin2x+1)+tan−1(sinx)+C
Hence, this is the answer.