How to deal with This kind of integral Like $$\int \frac{1}{1-\alpha \cos x} dx$$
Or a more general one: $$\int \frac{1}{\beta + \alpha \cos x} dx$$ and $$\int \frac{1}{\beta + \alpha \sin x} dx$$
 A: The general technique is to use the tangent half-angle substitution, also known as the Weierstrass substitution. With this substitution, you can derive for yourself the answers given on wolfram alpha and in other places without too much difficulty. 
A: As previous answers told, Weierstrass substitution is the most simple and classical solution. It consists in the use of the trigonometirc properties based on half angles. 
Let us consider the case of a generalized form of your antiderivatives $$I=\int \frac{1}{ \alpha +\beta \cos x+\gamma \sin x} dx$$ Using as new variable $$t=\tan \frac{x}{2}$$ the relations to be used are $$\sin x=\frac{2t}{1+t^2}$$ $$\cos x=\frac{1-t^2}{1+t^2}$$ $$dx =\frac{2dt}{1+t^2}$$ Using all the above, after simplification, you arrive to $$I=2\int \frac{1}{(\alpha +\beta) +2 \gamma  t+(\alpha -\beta )t^2 } dt$$ which, for the most general case, will lead to $$I=\frac{2 \tan ^{-1}\left(\frac{\gamma +(\alpha  -\beta  )t}{\sqrt{\alpha ^2-\beta
   ^2-\gamma ^2}}\right)}{\sqrt{\alpha ^2-\beta ^2-\gamma ^2}}$$
A: Hint: Use the Weierstrass Substitution.
