Let I=∫π0log(1+cosx)dx ........... (1)
⇒I=∫π0log(1+cos(π−x))dx,(∵∫a0f(x)dx=∫a0f(a−x)dx)
⇒I=∫π0log(1−cosx)dx ........... (2)
Adding (1) and (2), we obtain
2I=∫π0{log(1+cosx)+log(1−cosx)}dx
⇒2I=∫π0log(1−cos2x)dx
⇒2I=∫π0logsin2xdx
⇒2I=2∫π0logsinxdx
⇒I=∫π0logsinxdx ........ (3)
sin(π−x)=sinx
∴I=2∫π20logsinxdx ............ (4)
⇒I=2∫π20logsin(π2−x)dx=2∫π20logcosxdx .............. (5)
Adding (4) and (5), we obtain
2I=2∫π20(logsinx+logcosx)dx
⇒I=∫π20(logsinx+logcosx+log2−log2)dx
⇒I=∫π20(log2sinxcosx−log2)dx
⇒I=∫π20logsin2xdx−∫π20log2dx
Let 2x=t⇒2dx=dt
When x=0,t=0 and when x=π2
∴I=12∫π20logsintdt−π2log2
⇒I=12I−π2log2
⇒I2=−π2log2
⇒=−πlog2