Definite integral on $[0,\pi]$ How to calculate the following integral if $\varepsilon \in (0,1)$:
$$\int \limits_{0}^{\pi}\frac{d\varphi}{(1+\varepsilon\cos \varphi)^2}$$
 A: Hint:
Use the substitution
$$
s=\tan{\frac{\varphi}{2}}, \quad \sin{\varphi}=\frac{2s}{s^2+1}, \quad \cos{\varphi} = \frac{1-s^2}{s^2+1}.
$$
(Apparently more details are given in this answer.)
A: Complex analysis approach: by letting $z=e^{i\varphi}$ we obtain
\begin{align*}
\int_{0}^{\pi}\frac{d\varphi}{(1+\varepsilon\cos \varphi)^2}&=
\frac{1}{2}\int \limits_{-\pi}^{\pi}\frac{d\varphi}{(1+\varepsilon\cos \varphi)^2}\\
&=\frac{1}{2}\int \limits_{|z|=1}\frac{1}{(1+\varepsilon(z+1/z)/2)^2}\cdot \frac{dz}{iz}\\
&=\frac{2}{i}\int \limits_{|z|=1}\frac{z}{(\varepsilon z^2+2z+\varepsilon)^2}\,dz\\
&=\frac{4\pi}{\varepsilon^2}\,\mbox{Res}\left(\frac{z}{ (z-w_+)^2(z-w_-)^2},w_+
\right)\\
&=\frac{\pi}{(1-\varepsilon^2)^{3/2}}.
\end{align*}
where $\displaystyle w_{\pm}=\frac{\pm\sqrt{1-\varepsilon^2}-1}{\varepsilon}$.
A: $$\int \frac{d\varphi}{(1+\varepsilon\cos\varphi)^2} = -\frac{1}{(1-\varepsilon^2)}\Bigg[\frac{\varepsilon\sin\varphi}{1+\varepsilon\cos\varphi}-\int \frac{d\varphi}{1+\varepsilon\cos\varphi}\Bigg]$$
Table of Integrals, Series, And Products 7th ed 2.554.3
