Solve definite integral $\int_0^{2\pi} \frac{\cos^2x}{(1+b\cos x)^4} dx$ I am struggling with analytically solving the definite integral 
$$\int_0^{2\pi} \frac{\cos^2x}{(1+b\cos x)^4} dx$$
I am more generally having issues with solving integrals of the form  $\int_0^{2\pi}\frac{1}{(1+b\cos(x))^a} dx$, how can I solve these (both numerically and analytically. ($b<1$))
 A: Let 
\begin{align}
I(b) &= \int_0^{\pi} \frac{1}{(1+b \cos x)^2} dx\\
 &= \frac1{1-b^2}\int_0^{\pi}\left( 
-d (\frac{b\sin x}{ 1+b \cos x}  ) + \frac{1}{1+b \cos x} dx\right) \\
 &= \frac1{1-b^2}\int_0^{\pi} \frac{1}{1+b \cos x} dx
 =  \frac\pi{(1-b^2)^{3/2}}
\end{align}
Then
$$\int_0^{2\pi} \frac{\cos^2 x}{(1+b \cos x)^4} dx
=\frac13\frac {d^2I(b)}{db^2}=\frac{\pi (1+4b^2)}{(1-b^2)^{7/2} }$$
——————————————-
Edit:
\begin{align}
& \int_0^{\pi} \frac{1}{1+b \cos x} dx \\
=&\int_0^{\pi} \frac{1}{1+b (2\cos^2\frac x2 -1)}dx
 =\int_0^{\pi} \frac{2d(\tan \frac x2)}{(1-b )\tan^2\frac x2 +(1+b)}dx \\
=& \frac2{\sqrt{1-b^2}}\tan^{-1}\left(\sqrt{\frac{1-b}{1+b}}\tan\frac x2\right)_0^{\pi}= \frac\pi{\sqrt{1-b^2}}
\end{align}
A: This is an answer in response to your curiosity regarding the integral you mentioned for general $a$. I have found a closed-form for $a \in \mathbb{N}$. First, apply a half-angle substitution, $t=\tan(x/2)$, and use the binomial expansion, to obtain
$$\frac{4}{(1-b)^a}\sum_{k=0}^{a-1}{a-1 \choose k} \int_0^\infty \frac{t^{2k}}{\left(t^2 +\frac{1+b}{1-b}\right)^a}\,dt.$$
You can now substitute $t = \sqrt{\frac{1+b}{1-b}}u$ to transform the integral to
$$\frac{4}{(1+b)^a}\sqrt{\frac{1-b}{1+b}}\sum_{k=0}^{a-1}{a-1 \choose k}\left( \frac{1+b}{1-b}\right)^k\int_0^\infty \frac{u^{2k}}{\left( u^2 + 1\right)^a}\,du.$$
Now, we may use one of the integral representations of the beta function to evaluate the integral, reducing our expression to a finite sum:
$$\frac{1}{\Gamma(a)}\frac{2}{(1+b)^a}\sum_{k=0}^{a-1}{a-1 \choose k}\left( \frac{1+b}{1-b}\right)^{k-1/2} \Gamma(k+1/2)\Gamma(a-k-1/2).$$
