Let I=∫π−π2x(1+sinx)1+cos2xdx
=∫π−π2x1+cos2xdx+∫π−π2xsinx1+cos2xdx
=I1+I2
Consider f(x)=2x1+cos2x
Now, f(−x)=2(−x)1+cos2(−x)=−2x1+cos2x=−f(x)
∴I1=∫π−π2x1+cos2xdx=0 since ∫a−af(x)dx=0 if f(−x)=-f\left(x\right)$
Consider g(x)=2xsinx1+cos2x
g(−x)=2(−x)sin(−x)1+cos2(−x)=2xsinx1+cos2x=g(x)
∴I2=∫π−π2xsinxdx1+cos2x
=2×2∫π0xsinxdx1+cos2x
=4∫π0xsinxdx1+cos2x
Then I2=4∫π0(π−x)sin(π−x)dx1+cos2(π−x)
=4∫π0(π−x)sinxdx1+cos2x ......(2)
Adding (1) and (2),we get
2I2=4∫π0πsinxdx1+cos2x
⇒2I2=4π∫π0sinxdx1+cos2x
Put cosx=z⇒−sinxdx=dz
When x→0,z→0
When x→π,z→−1
∴2I2=−4π∫−11dz1+z2
=−4π×[tan−1z]−11
=−4π[tan−1(−1)−tan−11]
=−4π(−π4−−π4)
=2π2
⇒I2=π2
∴I=I1+I2=0+π2=π2