# Finding a closed-form solution to a definite integral.

I want to find a symbolic expression for the following integral as a function of $f$ and $g$:

$$\int_{0}^{\pi} \sqrt{1-\frac{2}{f + g \cdot \cos \theta}} \, d\theta$$

It is guaranteed that $f$ and $g$ are real numbers such that the argument to the square root is non-negative over the integration interval, e.g. $f = 36, g = -16$.

Unfortunately, I am stuck here. I can find solutions for $g = 0$, but other cases elude me.

Numerical integration handily yields numerical solutions that I have verified to be correct against the problem I'm trying to solve, but I'd appreciate a closed-form answer. Any help or insight on this would be greatly appreciated!

-
An elliptic integral. Plugging it into Maple, I get something in terms of elliptic integrals $K$, $F$, and $\Pi$. – GEdgar Jul 9 '12 at 13:24
Having a trigonometric function within a square root almost always leads to an elliptic integral... – J. M. Jul 9 '12 at 16:36

Maybe you could start at $$\int\sqrt{1-\frac{2}{1\pm\cos\left(x\right)}}\mathrm{d}x=2\mathop{\mathrm{atan_2}}\left(\sin\left(x\right),\cos\left(x\right)\pm1\right)-x$$ to reach you solution.
For example, Maple says $$\int_{0}^{\pi} \sqrt{1 - \frac{2}{4 + \operatorname{cos} (t)}} d t = \frac{2}{3} K \Bigl(\frac{2}{3}\Bigr) - \frac{4 i}{\sqrt5} \lim_{z\to+\infty} \Pi \biggl(i z,3,\frac{3}{\sqrt5}\biggr)$$