<s>[INST] Finding $\int \frac{dx}{a+b \cos x}$ without Weierstrass substitution. I saw somewhere on Math Stack that there was a way of finding integrals in the form $$\int \frac{dx}{a+b \cos x}$$ without using Weierstrass substitution, which is the usual technique. 
When $a,b=1$ we can just multiply the numerator and denominator by $1-\cos x$ and that solves the problem nicely. 
But I remember that the technique I saw was a nice way of evaluating these even when $a,b\neq 1$.
 [/INST] If $a=b$ then you can modify the technique for $a=b=1$ slightly to obtain:
$\int \frac{dx}{b+b\cos x}=\int\frac{b-b\cos x}{(b+b\cos x)(b-b\cos x)}dx$
$=\int\frac{b-b\cos x}{b^2-b^2\cos^2 x}dx=\int\frac{b-b\cos x}{b^2(1-\cos^2 x)}dx=\frac{1}{b}\int\frac{1-\cos x}{\sin^2 x}dx$
Splitting the numerator, and further simplifying:
$\frac{1}{b}\int\frac{1}{\sin^2 x}dx-\frac{1}{b}\int\frac{\cos x}{\sin^2 x}dx=\frac{1}{b}\int\csc^2 x\:dx-\frac{1}{b}\int\frac{\cos x}{\sin^2 x}dx$
The integral on the left is $-\cot x$ and the one on the right is an easy $u$-sub with $u=\sin x$.
So what happens with $a\neq b$?
$\int \frac{dx}{a+b\cos x}=\int\frac{a-b\cos x}{(a+b\cos x)(a-b\cos x)}dx=\int\frac{a-b\cos x}{a^2-b^2\cos^2 x}dx$
Now, add and subtract $b^2$ to the denominator and group the $+b^2$ with $-b^2\cos^2x$.
$=\int\frac{a-b\cos x}{a^2-b^2+b^2-b^2\cos^2 x}dx=\int\frac{a-b\cos x}{(a^2-b^2)+b^2(1-\cos^2 x)}dx$
Split the numerator again, and use pythagorean identity.
$\int\frac{a-b\cos x}{(a^2-b^2)+b^2(\sin^2 x)}dx$
and here I am stuck.
</s>