Consider the given integral.
I=∫cosx1+cosxdx
I=∫1+cosx−11+cosxdx
I=∫1+cosx1+cosxdx−∫11+cosxdx
We know that
cosx=2cos2x2−1
Therefore,
I=∫1dx−∫11+2cos2x2−1dx
I=∫1dx−12∫1cos2x2dx
I=∫1dx−12∫sec2x2dx
I=x−12tanx212+C
I=x−tanx2+C
Hence, this is the answer.