We have,
∫11+cosxdx
Now,
∫11+cosx
⇒∫11+1−tan2x21+tan2x2
⇒∫11+tan2x2+1−tan2x21+tan2x2dx
⇒∫1+tan2x21+tan2x2+1−tan2x2dx
⇒∫sec2x22dx
⇒12∫sec2x2dx
On integrating and we get,
⇒12tanx212+C
⇒tanx2+C