We have,
I=∫cosx1+cosxdx
We know that
cosx=1−2sin2x2=2cos2x2−1
Therefore,
I=∫2cos2x2−11+1−2sin2x2dx
I=∫2cos2x2−12−2sin2x2dx
I=∫cos2x2−121−sin2x2dx
I=∫cos2x2−12cos2x2dx
I=∫1dx−12∫1cos2x2dx
I=∫1dx−12∫sec2x2dx
I=x−12⎛⎜ ⎜ ⎜⎝tanx212⎞⎟ ⎟ ⎟⎠+C
I=x−tanx2+C
Hence, this is the answer.