Complex definite integrals/residue I am trying to evaluate this integral:
$$
\int_0^\pi \frac{d\theta}{(a + b \cos \theta)^2}
$$
for $0 < b < a$. I feel like the way I'm trying to solve [using $\cos t=(e^{it}+e^{-it})/2$ and $z=e^{it}$, but it doesn't seem to come out right. Can anyone help me step by step?

From Taylor series of $\dfrac1{(a+bx)^2}$, we have
$$\dfrac1{(a+b \cos(t))^2} = \sum_{k=0}^{\infty} \dfrac{(k+1)(-b)^k}{a^{k+2}} \cos^{k}(t)$$
Now $$\int_0^{2\pi} \cos^k(t) dt = 0 \text{ if $k$ is odd}$$
We also have that
$$\color{red}{\int_0^{2\pi}\cos^{2k}(t) dt = \dfrac{(2k-1)!!}{(2k)!!} \times \pi = \pi \dfrac{\dbinom{2k}k}{4^k}}$$
Hence,
$$I=\int_0^{2 \pi}\dfrac{dt}{(a+b \cos(t))^2} = \sum_{k=0}^{\infty} \dfrac{(2k+1)b^{2k}}{a^{2k+2}} \int_0^{2\pi}\cos^{2k}(t) dt = \dfrac{\pi}{a^2} \sum_{k=0}^{\infty}(2k+1) \left(\dfrac{b}{2a}\right)^{2k} \dbinom{2k}k$$
Now from Taylor series, we have
$$\color{blue}{\sum_{k=0}^{\infty}(2k+1) x^{2k} \dbinom{2k}k = (1-4x^2)^{-3/2}}$$
Hence,
$$\color{green}{I = \dfrac{\pi}{a^2} \cdot \sum_{k=0}^{\infty}(2k+1) \left(\dfrac{b}{2a}\right)^{2k} \dbinom{2k}k = \dfrac{\pi}{a^2} \cdot \left(1-\left(\dfrac{b}a\right)^2 \right)^{-3/2} = \dfrac{\pi a}{\left(a^2-b^2 \right)^{3/2}}}$$
