TITLE: How to integrate $\int\frac{1}{1+\cos{x}}\ dx$?
QUESTION [7 upvotes]: I've looked at wolfram alpha for a possible solution, but it does something that makes no sense to me... It says to let $u=\tan(\frac{x}{2})$ with no clear reason as to why...
So what would be a first step to approaching this? I've thought of converting it to $\frac{\sec{x}}{\sec{x}+1}$, but that seems to be fruitless...

REPLY [2 votes]: I will try to explain wolfram alpha's method.
You can use the formula for $$\cos2x=\frac{1-\tan^2(x)}{1+\tan^2(x)}$$
And for this question which converts to $$\cos x=\frac{1-\tan^2(x/2)}{1+\tan^2(x/2)}$$ and now, You can substitute $Y=\tan \frac{x}{2}$ and use the method for partial fraction or otherwise to solve the problem further by already known methods.       
And in the end after integration substitute back $Y=\tan \frac{x}{2}$