Let I = ∫2cos x(1−sin x)(1+sin2x)dx
Put sin x=t⇒cosx dx=dt
I=∫2dt(1−t)(1+t2)
∴2(1−t)(1+t2)=A1−t+Bt+C1+t2
2=A(1+t2)+(Bt+C)(1−t)
2=A+At2+Bt+C−Bt2−Ct
2=(A+C)+(A−B)t2+(B−C)t
Comparing both sides, we get,
A−B=0⇒A=B and B−C=0⇒B=C
A+C=2⇒A+A=2⇒2A=2⇒A=1
∴A=B=C=1
2(1−t)(1+t2)=11−t+t+11+t2
∴I=∫11−tdt+∫t+11+t2dt
=∫11−tdt+∫t1+t2dt+∫11+t2dt
=∫11−tdt+12∫2t1+t2dt+∫11+t2dt
Let u=1+t2 in the middle integral. ∴du=2t dt
=∫11−tdt+12∫1udu+∫11+t2dt
= log|1−t|−1+12log|u|+tan−1t+C
=−log|1−sin x|+12log|1+sin2x|+tan−1(sin x)+C