I'm trying to solve the integral $$\int_0^\pi \dfrac{\text{d}\phi}{\sqrt{\cos^2(\phi) - a \cos(\phi) + b}} = \int_{-1}^1 \dfrac{\text{d}x}{\sqrt{1-x^2}\sqrt{x^2-ax+b}} $$ where $a$ and $b$ are arbitrary positive real numbers, and $a^2-4b<0$.
I know that in theory the solution can be written in terms of elementary functions and standard elliptic integrals, but I'm struggling to put it in that form. I've tried working out a change of variables like $$x = \dfrac{rt+s}{ut+v}$$ to simplify the radicand for comparing against tables (Byrd and Friedman or Gradshteyn and Ryzhik), but since my polynomial has imaginary roots I keep getting stuck. Computer algebra like Wolfram Alpha also seems to fail.
Is this just impossible, or am I missing something? Thanks.