We have,
I=∫cosx1+cosxdx
We know that
cosx=2cos2x2−1=cos2x2−sin2x2
Therefore,
I=∫cos2x2−sin2x21+2cos2x2−1dx
I=12∫cos2x2−sin2x2cos2x2dx
I=12∫cos2x2cos2x2dx−12∫sin2x2cos2x2dx
I=12∫1dx−12∫tan2x2dx
I=12∫1dx−12∫(sec2x2−1)dx
I=x2−12⎡⎢ ⎢ ⎢⎣tanx212−x⎤⎥ ⎥ ⎥⎦+C
I=x2−tanx2+x+C
I=3x2−tanx2+C
Hence, this is the answer.