How to evaluate $\int_0^{\frac{\pi}{2}} \frac{{\rm d}\alpha}{1+\cos\alpha\cos\beta}$ without using antiderivative? Someone gives a solution here:
\begin{align*} \int_0^{\frac{\pi}{2}} \frac{{\rm d}\alpha}{1+\cos\alpha\cos\beta}&=\int_0^{\frac{\pi}{2}} \sum_{n=0}^{\infty} (-\cos\alpha\cos\beta)^n{\rm d}\alpha\\ &=\sum_{n=0}^{\infty}(-\cos\beta)^n\int_0^{\frac{\pi}{2}} \cos^n\alpha{\rm d}\alpha\\ &=\sum_{n=0}^{\infty}(-\cos \beta) ^n\frac{\sqrt{\pi}\Gamma\left(\frac{n}{2}+\frac{1}{2}\right)}{2\Gamma\left(\frac{n}{2}+1\right)}\\  &=\frac{\pi-2\arcsin\cos \beta}{2\sqrt{1-\cos^2\beta}}\\ &=\frac{\beta}{\sin \beta}.   \end{align*}
Is it correct? How to obtain the fourth equlity?

$\int_0^{\frac{\pi}{2}} \frac{{\rm d}\alpha}{1+\cos\alpha\cos\beta}$ =  $\int_0^{\frac{\pi}{2}} \frac{{\rm d}\alpha}{1+k\cos\alpha}$
then use $cos\alpha$ = ($cos$ ^2)$\alpha/2$ - $(sin$^2)$\alpha/2$.
divide numerator and denom by ($cos$ ^2)$\alpha/2$
then take tan$\alpha/2$ = t
then u can get a quadratic in denominator which can be factorized, get two fraction.
