<s>[INST] Definite integral of the square root of a polynomial ratio I found myself with the following integral
$$ \int_{b_1}^{b_2} \sqrt{\frac{(b-b_1)(b_2-b)(b_3-b)}{(b_4-b)}} \ db $$
with $ b_1 < b_2 < b_3 < b_4 $. I know that
$$ \int_{b_1}^{b_2} \frac{db}{\sqrt{(b-b_1)(b_2-b)(b_3-b)(b_4-b)}} $$
is equal to
$$ \frac{2}{(b_4-b_2)(b_3-b_1)} K(k) $$
where $K(k)$ is the complete elliptic integral of first kind, so I suspect that this integral is somehow reducible to a linear combination of elliptic integrals, but I can't find the right way.
 [/INST] We may as well rescale and translate so $b_1 = 0$ and $b_2 = 1$, leaving just two parameters instead of four.  Maple produces a result involving a limit of elliptic integrals:
$$
\frac{\underset{t \rightarrow 1-}{\mathrm{lim}}\frac{i \left(b_{3}^{2}+\left(2 b_{4}-2\right) b_{3}-3 b_{4}^{2}+2 b_{4}+1\right) \left(\sqrt{t}-t^{\frac{3}{2}}\right) \sqrt{b_{3}-t}\, \sqrt{b_{4}-t}\, \sqrt{b_{3}-1}\, \Pi \left(\frac{i \sqrt{b_{3}-1}\, \sqrt{t}}{\sqrt{b_{3}}\, \sqrt{1-t}}, \frac{b_{3}}{b_{3}-1}, \frac{\sqrt{b_{4}-1}\, \sqrt{b_{3}}}{\sqrt{b_{4}}\, \sqrt{b_{3}-1}}\right)+\left(i \left(b_{3}-3 b_{4}+1\right) \left(\sqrt{t}-t^{\frac{3}{2}}\right) b_{4} \sqrt{b_{3}-t}\, \sqrt{b_{4}-t}\, \sqrt{b_{3}-1}\, E\left(\frac{i \sqrt{b_{3}-1}\, \sqrt{t}}{\sqrt{b_{3}}\, \sqrt{1-t}}, \frac{\sqrt{b_{4}-1}\, \sqrt{b_{3}}}{\sqrt{b_{4}}\, \sqrt{b_{3}-1}}\right)-i \left(b_{3}-b_{4}-1\right) \left(\sqrt{t}-t^{\frac{3}{2}}\right) \sqrt{b_{3}-t}\, \sqrt{b_{4}-t}\, \sqrt{b_{3}-1}\, F\left(\frac{i \sqrt{b_{3}-1}\, \sqrt{t}}{\sqrt{b_{3}}\, \sqrt{1-t}}, \frac{\sqrt{b_{4}-1}\, \sqrt{b_{3}}}{\sqrt{b_{4}}\, \sqrt{b_{3}-1}}\right)+t \left(-2 \sqrt{b_{4}}\, \sqrt{b_{3}-t}\, \sqrt{b_{4}-t}\, \left(t -1\right) \sqrt{-\left(t -1\right) \left(-b_{4}+t \right) \left(-b_{3}+t \right)}+\left(-b_{3}+t \right) \sqrt{1-t}\, \left(\left(-3 t -b_{3}-1\right) b_{4}^{\frac{3}{2}}+3 b_{4}^{\frac{5}{2}}+\left(t b_{3}+t \right) \sqrt{b_{4}}\right)\right)\right) \left(b_{3}-1\right)}{\sqrt{b_{3}-t}\, \sqrt{t}\, \sqrt{b_{4}-t}\, \left(t -1\right)}}{\sqrt{b_{4}}\, \left(4 b_{3}-4\right)}
$$
Let's try a special case: $b_3 = 2$, $b_4 = 3$.  Numerical evaluation of the
above result and numerical integration, both using 20 decimal digits, agree
on the value $0.30296476900449078284$.
</s>