Integrate $\int_{0}^{2\pi}\frac{1}{\sqrt{(1+a-\cos\theta)(3+a-\cos\theta)}}\mathrm{d}\theta$ Consider the following integral with $a>0$:
\begin{equation}
I=\int_{0}^{2\pi}\frac{1}{\sqrt{(1+a-\cos\theta)(3+a-\cos\theta)}}\mathrm{d}\theta
\end{equation}
How does one deal with this integral?
I tried various substitutions such as $u=\cos\theta$ but nothing seems to work. I expect the integral to diverge at $a=0$, but for $a>0$ I should have a smooth behaviour.
Here is a list plot for $I$ in function of $a$:

 A: $$
I=2\int_{0}^{\pi}\frac{d\theta}{\sqrt{(1+a-\cos(\theta))(3+a-\cos(\theta))}}$$
As @Darshan P. commented, use the tangent half-angle substitution to make
$$I=4\int_0^\infty\frac {dt} {\sqrt{\left(a^2+6 a+8\right) x^4+2\left( a^2+4a+2\right) x^2+a(a+2) }}$$ which is an elliptic integral.
We have for the antiderivative (forget the $4$ for time being)
$$-\frac{i F\left(i \sinh ^{-1}\left(x\sqrt{\frac{a+4}{a+2}}
   \right)|\frac{(a+2)^2}{a (a+4)}\right)}{\sqrt{a (a+4)}}$$where $F(.)$ is the elliptic integral of the first kind.
All of that makes
$$I=\frac{4}{\sqrt{a (a+4)}}K\left(-\frac{4}{a(a+4)}\right)=\frac{4 }{a+2}K\left(\frac{4}{(a+2)^2}\right)$$ where $K(.)$ is the complete elliptic integral of the first kind.
This is confirmed by Wolfram Alpha.
However, it seems that we do not agree. In order you check  your calculations, for $a=2$, the numerical value is $1.68575$. Also checked using Wolfram Alpha.
I also computed the original integral (see here). Notice that Wolfram Alpha returns just a number.
In terms of infinite series
$$I=\sum_{n=0}^\infty \left(\frac{\Gamma \left(n+\frac{1}{2}\right)}{\Gamma (n+1)}\right)^2 \left(\frac{2}{a+2}\right)^{2n+1}$$
