Integral of square root of a quartic polynomial I have the following definite integral to solve
$$\int_{a_1}^{a_2} dx \sqrt{(a_1-x)(x-a_2)(x-c)(x-\bar{c})},$$
where $a_1$ is real and negative, $a_2$ is real and positive and $c$ is a complex number and $\bar{c}$ its complex conjugate.
I am sure that the result involves the eliptic functions and since the boundaries are fixed it can probably be reduced to only having complete eliptic integrals.
I tried to use Formulas like 259.03 together with 341.05 and (for $R_1$ needed) 361.54. in the book https://link.springer.com/book/10.1007%2F978-3-642-65138-0 by Byrd and Freeman.
In order to use this formula I rewrote the integral as
$$\int_{a_1}^{a_2} dx \frac{P(x)}{\sqrt{P(x)}}, \quad\text{where}\, P(x) = (a_1-x)(x-a_2)(x-c)(x-\bar{c}).$$
However, I was unable to find a pleasing form and I was wondering whether there is a simpler approach than starting with the quite general formula in 259.03.
For example I found
Integrals of the square root of a cubic polynomial
which unfortunately only covers the cubic case.
Any ideas are highly appreciated!
 A: A "general" integral can only beget a "general" answer.
Step 1: Apply a linear transformation sending $a_1$ to $-1$ and $a_2$ to $1$.
$$I=\int_{a_1}^{a_2}\sqrt{(x-a_1)(a_2-x)(x-c)(x-\overline c)}\,dx=K_0\int_{-1}^1\sqrt{(1-t^2)(t-d)(t-\overline d)}\,dt$$
$$K_0=\frac{(a_2-a_1)^3}8,d=\frac{2c-a_1-a_2}{a_2-a_1}$$
Step 2: Apply a linear fractional transformation sending $d$ and $\overline d$ to the imaginary axis while keeping the roots at $\pm1$ fixed. I computed this transformation here.
$$\int_{-1}^1\sqrt{(1-t^2)(t-d)(t-\overline d)}\,dt=K_1\int_{-1}^1\frac1{(u+A)^4}\sqrt{(u^2+B)(1-u^2)}\,du\newcommand{Re}{\operatorname{Re}}$$
$$A=\frac{1+|d|^2+|d^2-1|}{2\Re(d)}$$
$$A_1=A^2-2A\Re(d)+|d|^2\qquad A_2=A^2|d|^2-2A\Re(d)+1\qquad B=\frac{A_2}{A_1}$$
$$K_1=(A^2-1)^{3/2}A_1^{1/2}$$
Step 3: Multiply top and bottom by $\sqrt{(u^2+B)(1-u^2)}(u-A)^4$, delete odd powers of $u$ because we are integrating over $[-1,1]$ and perform a partial fraction decomposition with respect to $u^2$.
$$\int_{-1}^1\frac1{(u+A)^4}\sqrt{(u^2+B)(1-u^2)}\,du=2\sum_{k=0}^4c_kI_k$$
$$c_4=-8(A^2-1)A^4(A^2+B)\qquad c_3=8A^2(-2A^2+3A^4-B+2A^2B)$$
$$c_2=9A^2-25A^4+B-9A^2B\qquad c_1=10A^2+B-1\qquad c_0=-1$$
$$I_k=\int_0^1\frac1{(A^2-u^2)^k\sqrt{(u^2+B)(1-u^2)}}\,du$$
Step 4: Use Byrd and Friedman 213.11 and 336 to evaluate the $I_k$ in terms of complete elliptic integrals (since we are going from pole to pole) and sum everything up. The result is bona fide messy, even when expressed in terms of $A$ and $B$, but gives the right answer.
