Let I=∫π0x2cosx(1+sinx)2dx
Integrating by parts
I=[−x211+sinx]π0+2∫11+sinxxdx=−π2+2I1
Where
I1=∫π0x1+sinxdx=∫π0π−x1+sin(π−x)dx ....( using integration property )
2I1=π∫π011+sinxdx=π∫π01−sinxcos2xdx
=π∫(sec2x−secxtanx)dx=π[tanx−secx]π0=π[2]=2π
Therefore I=−π2+2π=π(2−π)