# Closed-form expression for an iterated integral

Does the following iterated integral have a simple closed-form expression in terms of $z$?

$$I = \int_0^\infty \int_0^\infty \sqrt{\frac{1 + x^2 y^2 + x^2 z^2 + y^2 z^2}{(x^2 + y^2 + z^2 + x^2 y^2 z^2)^3}} \, dy \, dx$$

where $x \in \mathbb{R^+}$ and $y \in \mathbb{R^+}$. Assume $z \in \mathbb{R^+}$ is a constant.

I tried substituting:

$$u = \frac{1}{2} \left[ 1 + \frac{y^2(1 + x^2 z^2)-(x^2+z^2)}{y^2(1 + x^2 z^2)+(x^2+z^2)} \right]$$

which simplifies the integral to this:

\begin{align} I &= \int_0^\infty \frac{\pi}{2} \frac{1}{x^2+z^2} \operatorname{_2F_1} \left( -\tfrac{1}{2}, \tfrac{1}{2}; 1; 1{-}\left[ \frac{x^2+z^2}{1+x^2 z^2} \right]^2 \right) \, dx \\ &= \int_0^\infty \frac{1}{x^2+z^2} \operatorname{E} \left( \sqrt{1{-}\left[ \frac{x^2+z^2}{1+x^2 z^2} \right]^2} \right) \, dx \end{align}

$\operatorname{E}(k)$ here is the complete elliptic integral of the second kind (using elliptic modulus $k$, not the parameter $m=k^2$).

I can't seem to simplify this any further. Is there a way to proceed with this integral over $\operatorname{E}(k)$? (I have looked through tables of integrals of elliptic integrals, but nothing seems to match.) Or is there another way to simplify the iterated integral, e.g. via a substitution for both $x$ and $y$?

For the record, this integral arises when deriving a certain kind of prior distribution for the parameters of a particular probabilistic model.

Berger & Bernardo, 1992, "Ordered Group Reference Priors with Application to the Multinomial Problem" describe a sort of generalized Jeffreys prior which assumes a specific parameter ordering and grouping. Essentially, the "conditional Jeffreys prior" is derived for each group based on a conditional Fisher information matrix (with the parameters earlier in the ordering held constant), which is based on a marginal likelihood function (with parameters later in the ordering integrated out).

The integral above appears when deriving such a prior for a bivariate Bernoulli model with a specific parameterization and ordered grouping of parameters. For two binary variables $X$ and $Y$ with joint probability denoted e.g. $p_{11}$, consider the saturated model with three "odds ratio" parameters:

$$O_X=\left(\frac{p_{10} p_{11}}{p_{00} p_{01}}\right)^{1/4}, O_Y=\left(\frac{p_{01} p_{11}}{p_{00} p_{10}}\right)^{1/4}, O_{XY}=\left(\frac{p_{00} p_{11}}{p_{10} p_{01}}\right)^{1/4}$$

(These are similar to the classic log-linear parameters defined e.g. in Bishop, Fienberg, & Holland, 1975, Discrete Multivariate Analysis, but without the logs. I assume the integral here would also appear for the case with log-linear parameters.)

Assuming the ordered grouping: $(\{O_{XY}\},\{O_X,O_Y\})$, the integral above appears as part of the normalizing constant for the conditional prior $p(O_X,O_Y|O_{XY})$. Finding the joint prior $p(O_X,O_Y,O_{XY})$ then involves deriving $p(O_{XY})$ from a marginal likelihood.

-
Phew! May I ask where this integral comes from? It might very well not have a simple closed form. – Bruno Joyal Oct 23 '13 at 2:53
@Marie It comes from computing the normalizing constant of a Jeffreys prior for a probabilistic model over a bivariate Bernoulli distribution using odds-ratio parameters. – Tyler Streeter Oct 23 '13 at 3:39
I have tried to expand the elliptic integral into a power series, and looks like each term integrates into a polynomial of $(z-1/z)^2$. No further results yet. – Chen Wang Feb 5 '14 at 23:12

$$\mathcal{I}{\left(z\right)}=\frac{2\left[2\,K{\left(\frac{1-z}{\sqrt{2}\sqrt{1+z^2}}\right)}E{\left(\frac{1-z}{\sqrt{2}\sqrt{1+z^2}}\right)}-\left(\frac{1+z+z^2}{1+z^2}\right)K{\left(\frac{1-z}{\sqrt{2}\sqrt{1+z^2}}\right)}^2\right]}{z}.$$

Define the auxiliary parameter $\frac{1-z^2}{1+z^2}=:a$, for $z\in\mathbb{R}^{+}$. Inverting, this corresponds to $z=\sqrt{\frac{1-a}{1+a}}$ for $-1<a<1$. Substituting in the double integral the transformations $x=\sqrt{\frac{1-t}{1+t}}\land y=\sqrt{\frac{1-u}{1+u}}$, we find:

\begin{align} \mathcal{I}{\left(z\right)} &=\iint_{[0,\infty)^2}\mathrm{d}x\mathrm{d}y\,\sqrt{\frac{1+x^2y^2+x^2z^2+y^2z^2}{\left(x^2+y^2+z^2+x^2y^2z^2\right)^3}}\\ &=\small{\iint_{[-1,1]^2}\frac{\mathrm{d}t\mathrm{d}u}{\left(1+t\right)\left(1+u\right)\sqrt{\left(1-t^2\right)\left(1-u^2\right)}}\,\sqrt{\frac{\left(\frac{4(1+atu)}{(1+a)(1+t)(1+u)}\right)}{\left(\frac{4(1-atu)}{(1+a)(1+t)(1+u)}\right)^3}}}\\ &=\frac{1+a}{4}\iint_{[-1,1]^2}\frac{\mathrm{d}t\mathrm{d}u}{\sqrt{\left(1-t^2\right)\left(1-u^2\right)}}\,\sqrt{\frac{1+atu}{\left(1-atu\right)^3}}\\ &=\frac{1+a}{4}\iint_{[-1,1]^2}\mathrm{d}t\mathrm{d}u\,\frac{\frac{1+atu}{1-atu}}{\sqrt{\left(1-t^2\right)\left(1-u^2\right)\left(1-a^2t^2u^2\right)}}\\ &=\frac{1+a}{4}\iint_{[0,1]^2}\mathrm{d}t\mathrm{d}u\,\frac{\frac{1+atu}{1-atu}}{\sqrt{\left(1-t^2\right)\left(1-u^2\right)\left(1-a^2t^2u^2\right)}}\\ &~~~~~+\frac{1+a}{4}\iint_{[-1,0]^2}\mathrm{d}t\mathrm{d}u\,\frac{\frac{1+atu}{1-atu}}{\sqrt{\left(1-t^2\right)\left(1-u^2\right)\left(1-a^2t^2u^2\right)}}\\ &~~~~~+\frac{1+a}{4}\iint_{[0,1]\times[-1,0]}\mathrm{d}t\mathrm{d}u\,\frac{\frac{1+atu}{1-atu}}{\sqrt{\left(1-t^2\right)\left(1-u^2\right)\left(1-a^2t^2u^2\right)}}\\ &~~~~~+\frac{1+a}{4}\iint_{[-1,0]\times[0,1]}\mathrm{d}t\mathrm{d}u\,\frac{\frac{1+atu}{1-atu}}{\sqrt{\left(1-t^2\right)\left(1-u^2\right)\left(1-a^2t^2u^2\right)}}\\ &=\frac{1+a}{2}\iint_{[0,1]^2}\mathrm{d}t\mathrm{d}u\,\frac{\frac{1+atu}{1-atu}}{\sqrt{\left(1-t^2\right)\left(1-u^2\right)\left(1-a^2t^2u^2\right)}}\\ &~~~~~+\frac{1+a}{2}\iint_{[0,1]\times[-1,0]}\mathrm{d}t\mathrm{d}u\,\frac{\frac{1+atu}{1-atu}}{\sqrt{\left(1-t^2\right)\left(1-u^2\right)\left(1-a^2t^2u^2\right)}}\\ &=\frac{1+a}{2}\iint_{[0,1]^2}\mathrm{d}t\mathrm{d}u\,\frac{\frac{1+atu}{1-atu}+\frac{1-atu}{1+atu}}{\sqrt{\left(1-t^2\right)\left(1-u^2\right)\left(1-a^2t^2u^2\right)}}\\ &=\frac{1+a}{2}\iint_{[0,1]^2}\mathrm{d}t\mathrm{d}u\,\frac{\frac{2(1+a^2t^2u^2)}{1-a^2t^2u^2}}{\sqrt{\left(1-t^2\right)\left(1-u^2\right)\left(1-a^2t^2u^2\right)}}\\ &=\left(1+a\right)\iint_{[0,1]^2}\mathrm{d}t\mathrm{d}u\,\frac{\frac{2}{1-a^2t^2u^2}-1}{\sqrt{\left(1-t^2\right)\left(1-u^2\right)\left(1-a^2t^2u^2\right)}}\\ &=2\left(1+a\right)\iint_{[0,1]^2}\frac{\mathrm{d}t\mathrm{d}u}{\sqrt{\left(1-t^2\right)\left(1-u^2\right)\left(1-a^2t^2u^2\right)^3}}\\ &~~~~~-\left(1+a\right)\iint_{[0,1]^2}\frac{\mathrm{d}t\mathrm{d}u}{\sqrt{\left(1-t^2\right)\left(1-u^2\right)\left(1-a^2t^2u^2\right)}}.\\ \end{align}

Now we're clearly on the right track because we have a pair of double elliptic integrals pretty much in standard form. Evaluating the double integrals as iterated integrals, we now find:

\begin{align} \mathcal{I}{\left(z\right)} &=2\left(1+a\right)\iint_{[0,1]^2}\frac{\mathrm{d}t\mathrm{d}u}{\sqrt{\left(1-t^2\right)\left(1-u^2\right)\left(1-a^2t^2u^2\right)^3}}\\ &~~~~~-\left(1+a\right)\iint_{[0,1]^2}\frac{\mathrm{d}t\mathrm{d}u}{\sqrt{\left(1-t^2\right)\left(1-u^2\right)\left(1-a^2t^2u^2\right)}}\\ &=2\left(1+a\right)\int_{0}^{1}\mathrm{d}t\int_{0}^{1}\mathrm{d}u\,\frac{1}{\sqrt{\left(1-t^2\right)\left(1-u^2\right)\left(1-a^2t^2u^2\right)^3}}\\ &~~~~~-\left(1+a\right)\int_{0}^{1}\mathrm{d}t\int_{0}^{1}\mathrm{d}u\,\frac{1}{\sqrt{\left(1-t^2\right)\left(1-u^2\right)\left(1-a^2t^2u^2\right)}}\\ &=\small{2\left(1+a\right)\int_{0}^{1}\mathrm{d}t\int_{0}^{1}\mathrm{d}u\,\frac{\partial}{\partial a}\left[\frac{a}{\sqrt{\left(1-t^2\right)\left(1-u^2\right)\left(1-a^2t^2u^2\right)}}\right]}\\ &~~~~~\small{-\left(1+a\right)\int_{0}^{1}\mathrm{d}t\int_{0}^{1}\mathrm{d}u\,\frac{1}{\sqrt{\left(1-t^2\right)\left(1-u^2\right)\left(1-a^2t^2u^2\right)}}}\\ &=\small{2\left(1+a\right)\frac{d}{da}\left[a\int_{0}^{1}\mathrm{d}t\int_{0}^{1}\mathrm{d}u\,\frac{1}{\sqrt{\left(1-t^2\right)\left(1-u^2\right)\left(1-a^2t^2u^2\right)}}\right]}\\ &~~~~~\small{-\left(1+a\right)\int_{0}^{1}\mathrm{d}t\int_{0}^{1}\mathrm{d}u\,\frac{1}{\sqrt{\left(1-t^2\right)\left(1-u^2\right)\left(1-a^2t^2u^2\right)}}}\\ &=\small{\left(1+a\right)\left(1+2a\frac{d}{da}\right)\int_{0}^{1}\mathrm{d}t\int_{0}^{1}\mathrm{d}u\,\frac{1}{\sqrt{\left(1-t^2\right)\left(1-u^2\right)\left(1-a^2t^2u^2\right)}}}\\ &=\small{\left(1+a\right)\left(1+2a\frac{d}{da}\right)\int_{0}^{1}\frac{\mathrm{d}t}{\sqrt{1-t^2}}\int_{0}^{1}\frac{\mathrm{d}u}{\sqrt{\left(1-u^2\right)\left(1-a^2t^2u^2\right)}}}\\ &=\left(1+a\right)\left(1+2a\frac{d}{da}\right)\int_{0}^{1}\mathrm{d}t\,\frac{K{\left(\left|a\right|t\right)}}{\sqrt{1-t^2}}.\\ \end{align}

Thus, we only need calculate the following integral: for $-1<a<1$,

\begin{align} \int_{0}^{1}\frac{K{\left(\left|a\right|t\right)}}{\sqrt{1-t^2}}\,\mathrm{d}t &=\frac{\pi}{2}\int_{0}^{1}\frac{{_2F_1}{\left(\frac12,\frac12;1;a^2t^2\right)}}{\sqrt{1-t^2}}\,\mathrm{d}t\\ &=\frac{\pi}{4}\int_{0}^{1}\frac{{_2F_1}{\left(\frac12,\frac12;1;a^2x\right)}}{\sqrt{x}\sqrt{1-x}}\,\mathrm{d}x;~~~\small{\left[t=\sqrt{x}\right]}\\ &=\frac{\pi^2}{4}\,{_3F_2}{\left(\frac12,\frac12,\frac12;1,1;a^2\right)}\\ &=\frac{\pi^2}{4}\,{_2F_1}{\left(\frac12,\frac12;1;\frac{1-\sqrt{1-a^2}}{2}\right)}^2\\ &=\frac{\pi^2}{4}\,{_2F_1}{\left(\frac12,\frac12;1;\left(\frac{\sqrt{1+a}-\sqrt{1-a}}{2}\right)^2\right)}^2\\ &=K{\left(\frac{\sqrt{1+a}-\sqrt{1-a}}{2}\right)}^2.\\ \end{align}

Hence,

\begin{align} \mathcal{I}{\left(z\right)} &=\left(1+a\right)\left(1+2a\frac{d}{da}\right)\int_{0}^{1}\mathrm{d}t\,\frac{K{\left(\left|a\right|t\right)}}{\sqrt{1-t^2}}\\ &=\left(1+a\right)\left(1+2a\frac{d}{da}\right)\left[K{\left(\frac{\sqrt{1+a}-\sqrt{1-a}}{2}\right)}^2\right]\\ &=\left(1+a\right)K{\left(\frac{\sqrt{1+a}-\sqrt{1-a}}{2}\right)}^2\\ &~~~~~+2a\left(1+a\right)\frac{d}{da}\left[K{\left(\frac{\sqrt{1+a}-\sqrt{1-a}}{2}\right)}^2\right]\\ &=\left(1+a\right)K{\left(\frac{\sqrt{1+a}-\sqrt{1-a}}{2}\right)}^2\\ &~~~~~+a\left(\frac{1+a}{\sqrt{1+a}}+\frac{1+a}{\sqrt{1-a}}\right)K{\left(k\right)}\frac{dK{(k)}}{dk}\bigg{|}_{k=\frac{\sqrt{1+a}-\sqrt{1-a}}{2}}\\ &=\left(1+a\right)K{\left(\frac{\sqrt{1+a}-\sqrt{1-a}}{2}\right)}^2\\ &~~~~~+a\left(1+a\right)\left(\frac{\sqrt{1+a}+\sqrt{1-a}}{\sqrt{1-a^2}}\right)K{\left(k\right)}\frac{dK{(k)}}{dk}\bigg{|}_{k=\frac{\sqrt{1+a}-\sqrt{1-a}}{2}}\\ &=\left(1+a\right)K{\left(\frac{\sqrt{1+a}-\sqrt{1-a}}{2}\right)}^2\\ &~~~~~+\frac{a^2\left(1+a\right)}{\sqrt{1-a^2}}\frac{K{\left(k\right)}\frac{dK{(k)}}{dk}}{k}\bigg{|}_{k=\frac{\sqrt{1+a}-\sqrt{1-a}}{2}}\\ &=\left(1+a\right)K{\left(\frac{\sqrt{1+a}-\sqrt{1-a}}{2}\right)}^2\\ &~~~~~+\frac{4\left(1+a\right)}{\sqrt{1-a^2}}\,K{\left(k\right)}\left[kk^{\prime\,2}\frac{dK{(k)}}{dk}\right]\bigg{|}_{k=\frac{\sqrt{1+a}-\sqrt{1-a}}{2}}\\ &=\left(1+a\right)K{\left(\frac{\sqrt{1+a}-\sqrt{1-a}}{2}\right)}^2\\ &~~~~~+\frac{4\left(1+a\right)}{\sqrt{1-a^2}}\,K{\left(k\right)}\left[E{\left(k\right)}-k^{\prime\,2}\,K{\left(k\right)}\right]\bigg{|}_{k=\frac{\sqrt{1+a}-\sqrt{1-a}}{2}}\\ &=\frac{\left(1+a\right)}{\sqrt{1-a^2}}K{\left(k\right)}\left[4\,E{\left(k\right)}-\left(2+\sqrt{1-a^2}\right)K{\left(k\right)}\right]\bigg{|}_{k=\frac{\sqrt{1+a}-\sqrt{1-a}}{2}}\\ &=\frac{1}{z}K{\left(k\right)}\left[4\,E{\left(k\right)}-\left(2+\frac{2z}{1+z^2}\right)K{\left(k\right)}\right]\bigg{|}_{k=\frac{1-z}{\sqrt{2}\sqrt{1+z^2}}}\\ &=\frac{2}{z}K{\left(k\right)}\left[2\,E{\left(k\right)}-\left(\frac{1+z+z^2}{1+z^2}\right)K{\left(k\right)}\right]\bigg{|}_{k=\frac{1-z}{\sqrt{2}\sqrt{1+z^2}}}\\ &=\frac{2\left[2\,K{\left(\frac{1-z}{\sqrt{2}\sqrt{1+z^2}}\right)}E{\left(\frac{1-z}{\sqrt{2}\sqrt{1+z^2}}\right)}-\left(\frac{1+z+z^2}{1+z^2}\right)K{\left(\frac{1-z}{\sqrt{2}\sqrt{1+z^2}}\right)}^2\right]}{z}.\\ \end{align}

-
Very nice! Your initial substitutions are what I was missing. – Tyler Streeter Jul 12 '15 at 16:17
Thanks. In case you're curious, the key insight which made me think of the substitutions is the algebraic identity $(1+ab+ac+bc)\pm(a+b+c+abc)=(1\pm a)(1\pm b)(1\pm c)$. I encountered the identity while working on another problem and immediately thought of your integral here. It's almost painfully obvious in hindsight. sigh – David H Jul 13 '15 at 1:57
Yes, I am curious, so that extra info is helpful. Thank you. – Tyler Streeter Jul 13 '15 at 11:56