I am trying to evaluate the definite integral $I(a,b)$, with $a,b\in\mathbb{R}$, defined by
$$I(a,b):=\int_{0}^{2\pi}\sqrt{1-(a+b\cos{\theta})^2}\mathrm{d}\theta.$$
Assume $a,b$ are suitably restricted to keep the integrand real-valued.
My attempt.
Introduce the parameter $w$ into the integrand and differentiate with respect to it:
$$\begin{align}I(a,b,w)&=\int_{0}^{2\pi}\sqrt{1-(a+b\cos{(w\theta)})^2}\mathrm{d}\theta\\ \implies \partial_w I(a,b,w)&=\int_{0}^{2\pi}\frac{b\theta\sin{(w\theta)}(a+b\cos{(w\theta)})}{\sqrt{1-(a+b\cos{w\theta})^2}}\mathrm{d}\theta\\ &=ab\int_{0}^{2\pi}\frac{\theta\sin{(w\theta)}}{\sqrt{1-(a+b\cos{w\theta})^2}}\mathrm{d}\theta+b^2\int_{0}^{2\pi}\frac{\theta\sin{(w\theta)}\cos{(w\theta)}}{\sqrt{1-(a+b\cos{w\theta})^2}}\mathrm{d}\theta\end{align}.$$
My next step would probably be to integrate by parts, but at this point I'm wondering if there is a less messy way to go about this. Thoughts?
A completely equivalent question was answered here. The result is expressed in terms of elliptic integrals: $$\boxed{\displaystyle I(a,b)=4\sqrt{\frac{b}{k}}\,\biggl[\mathbf{E}\left(k^2\right)-\left(1-k^2\right)\mathbf{K}\left(k^2\right)+\left(1-k^2\right)\Pi\left(c^{-2}|k^2\right)\biggr]} $$
where the Mathematica conventions for the arguments of $\mathsf{EllipticE}$, $\mathsf{EllipticK}$ and $\mathsf{EllipticPi}$ are used, and the parameters $k$ and $c$ are defined by \begin{align} k=\frac{1+b^2-a^2-\sqrt{(1+b^2-a^2)^2-4b^2}}{2b},\qquad c=\frac{a}{b-k}. \end{align}