Consider the given integral.
I=∫cosx1+cosxdx
Put t=tanx2. So,
sinx=2t1+t2
cosx=1−t21+t2
dx=21+t2dt
Therefore,
I=∫cosx1+cosxdx
I=∫1−t21+t21+1−t21+t221+t2dt
I=2∫1−t21+t2+1−t211+t2dt
I=∫1−t21+t2dt
I=∫−1dt+∫21+t2dt
I=−t+2tan−1t+C
I=−tanx2+x+C
Hence, this is the required value of the integral.