Prove $\int_0^\infty \frac{dx}{\sqrt{(x^4+a^4)(x^4+b^4)}}=\frac{\pi}{2 \sqrt2 a b} ( \text{agm} (\frac{a+b}{2},\sqrt{\frac{a^2+b^2}{2}} ))^{-1}$ The following definite integral turns out to be expressible as the Arithmetic-Geometric Mean: $$I_4(a,b)=\int_0^\infty \frac{dx}{\sqrt{(x^4+a^4)(x^4+b^4)}}=\frac{\pi}{2 \sqrt2 a b} \left( \text{agm} \left(\frac{a+b}{2},\sqrt{\frac{a^2+b^2}{2}} \right)\right)^{-1}$$
$$I_4(1,1)=\frac{\pi}{2 \sqrt2}$$
I would like to remind you that:
$$I_2(a,b)=\int_0^\infty \frac{dx}{\sqrt{(x^2+a^2)(x^2+b^2)}}=\frac{\pi}{2} \left( \text{agm} \left(a,b \right)\right)^{-1}$$
$$I_2(1,1)=\frac{\pi}{2}$$
Which is why I have two questions:

How do we prove the identity for $I_4(a,b)$?
Is it possible to also express other integrals of this type using agm? Such as $I_8(a,b)$?


Because of the relation of the agm to elliptic integrals, we can also write:
$$I_4(a,b)=\frac{1}{a b \sqrt{a^2+b^2}} K \left( \frac{a-b}{\sqrt{2(a^2+b^2)}} \right)$$
Here the parameter convention is $$K(k)=\int_0^1 \frac{dt}{\sqrt{(1-t^2)(1-k^2 t^2)}}$$
This seems to be the best way to prove the identity, but I don't know which substitution to use.
Another way to express this integral would be through the hypergeometric function:
$$I_4(a,b)=\frac{\pi}{2 \sqrt2 a^3} {_2F_1} \left(\frac{1}{2},\frac{3}{4};1;1-\frac{b^4}{a^4} \right)$$
And for every integral of this type we have:
$$I_m(a,b)=\frac{I_m(1,1)}{a^{m-1}} {_2F_1} \left(\frac{1}{2},\frac{m-1}{m};1;1-\frac{b^m}{a^m} \right)$$
The outline for the proof can be found in this question for $m=3$ and is easily adapted to the general case.
Here we assume $a \geq b$.
As for the arithmetic geometric mean, I tried to get it into a simpler form, but the only transformation I was able to achieve is this:
$$\text{agm} \left(\frac{a+b}{2},\sqrt{\frac{a^2+b^2}{2}} \right)=\text{agm} \left(\frac{a+b}{2}+i \frac{a-b}{2},\frac{a+b}{2}-i \frac{a-b}{2} \right)$$
Since we have complex conjugates, it's quite obvious, that they will give real numbers at first iteration, an it would give the left hand side.

Substitition is sufficient.
Let $$\displaystyle z=x-\frac1x,w=x+\frac1x$$
then $$\displaystyle
\frac{\mathrm dx}{\sqrt{x^8+p x^4+1}}=\frac12\left(
\frac{\mathrm dz}{\sqrt{z^4+4z^2+2+p}}+\frac{\mathrm dw}{\sqrt{w^4-4w^2+2+p}}\right)
$$
So $$f(p)=\displaystyle
\int_0^\infty
\frac{\mathrm dx}{\sqrt{x^8+p x^4+1}}
=\frac12\int_{-\infty}^\infty
\frac{\mathrm dx}{\sqrt{x^4+4x^2+2+p}}
=\int_0^\infty
\frac{\mathrm dx}{\sqrt{x^4+4x^2+2+p}}
$$
let $$x^4+4x^2+2+p=
(x^2+u^2)(x^2+v^2)
$$
We know that $$\displaystyle
\operatorname{agm}(u,v)=
\frac{\pi}2\left(
\int_0^\infty
\frac{\mathrm dx}{\sqrt{(x^2+u^2)(x^2+v^2)}}\right)^{-1}
=\frac{\pi}2
f(p)^{-1}
$$
With the identity of agm,
$$
\operatorname{agm}(u,v)=\operatorname{agm}\left(\frac{u+v}2,\sqrt{uv}\right)
=\operatorname{agm}\left(\sqrt{\frac{\sqrt{p+2}}2+1},\sqrt[4]{p+2}\right)
$$
So
$$
\int_0^\infty
\frac{\mathrm dx}{\sqrt{(x^4+a^4)(x^4+b^4)}}
=\frac1{ab\sqrt{ab}}f\left(\frac{a^2}{b^2}+\frac{b^2}{a^2}\right)
=\frac\pi{2ab\sqrt{ab}}\left(\operatorname{agm}\left(
\frac{a+b}{\sqrt{2ab}},\sqrt{\frac{a^2+b^2}{ab}}
\right)\right)^{-1}
=\frac\pi{2\sqrt2 ab}\left(\operatorname{agm}\left(
\frac{a+b}2,\sqrt{\frac{a^2+b^2}2}
\right)\right)^{-1}
$$
