# Month: June 2021

This post is devoted to some aspects of the Landen transformation, essentially ${x\mapsto(1-x)/(1+x)}$ or ${x\mapsto 4x/(1+x)^2}$, used for certain special functions. It was introduced by John Landen (1719 — 1790) for expressing a hyperbolic arc in terms of two elliptic arcs. It is useful for numerical evaluation. Since its invention, the infinitesimal calculus was systematically used in order to compute geometric quantities such as for instance the length of an arc of ellipse and in particular the circumference of an ellipse. There is no closed formula like in the special case of the circle, and this leads to integrals known as elliptic integrals. Nowadays, they belong to the vast zoo of special functions.

Complete elliptic integrals of first and second kind. Given, for ${\rho\in[0,1]}$, by

$K(\rho) :=\int_0^{\frac{\pi}{2}}\frac{\mathrm{d}\theta}{\sqrt{1-\rho\sin^2(\theta)}} =\int_0^1\frac{\mathrm{d}t}{\sqrt{1-\rho t^2}\sqrt{1-t^2}}$

and

$E(\rho):=\int_0^{\frac{\pi}{2}}\sqrt{1-\rho\sin^2(\theta)}\mathrm{d}\theta =\int_0^1\frac{\sqrt{1-\rho t^2}}{\sqrt{1-t^2}}\mathrm{d}t.$

The incomplete elliptic integrals are given by the same formula after replacing ${\frac{\pi}{2}}$ by an arbitrary angle. The inverse of incomplete elliptic integrals are known as elliptic functions. Geometrically, the length of the arc of an ellipse can be expressed using the elliptic integral of the second kind, while the surface measure of an ellipsoid involves a combination of elliptic integrals of first and second kind. Elliptic integrals and functions appear at many places in mathematics, physics, and engineering, and were studied by several mathematicians, including historically, among others, Leonhard Euler (1707 — 1783), Adrien-Marie Legendre (1752 — 1833), Johann Carl Friedrich Gauss (1777 — 1855), Niels Henrik Abel (1802 — 1829), Carl Gustav Jacob Jacobi (1804 — 1851), Karl Weierstrass (1815 — 1897), and Arthur Cayley (1821 — 1895). Elliptic integrals and functions, are, as most classical special functions, very well known by software packages specialized in mathematics such as Maple and Mathematica.

Landen transformation. For all ${x\in[0,1]}$,

$K\Bigr(\Bigr(\frac{1-x}{1+x}\Bigr)^2\Bigr) =\frac{1+x}{2}K(1-x^2)$

and

$E\Bigr(\Bigr(\frac{1-x}{1+x}\Bigr)^2\Bigr) =\frac{1}{1+x}E(1-x^2)+\frac{2x}{(1+x)^2}K\Bigr(\Bigr(\frac{1-x}{1+x}\Bigr)^2\Bigr).$

Reformulation. If ${x_1:=\frac{1-x}{1+x}}$ then ${1+x_1=\frac{2}{1+x}}$ and ${\frac{4x_1}{(1+x_1)^2}=1-x^2}$, and we get

$K\Bigr(\frac{4x_1}{(1+x_1)^2}\Bigr) = (1+x_1)K(x_1^2).$

Note that ${x_1}$ runs over ${[0,1]}$ when ${x}$ runs over ${[0,1]}$. Similarly we get

$E\Bigr(\frac{4x_1}{(1+x_1)^2}\Bigr) = \frac{2}{1+x_1}E(x_1^2)-(1-x_1)K(x_1^2).$

For all ${x\geq1}$, the identity ${\frac{4x}{(1+x)^2}=\frac{4x^{-1}}{(1+x^{-1})^2}}$ allows to express ${K}$ and ${E}$ at ${\frac{4x}{(1+x)^2}}$ for all ${x\geq1}$.

Ivory derivation via hypergeometric series. It is possible to derive the formulas by using powerful change of variables, presented later on in this post, which remain valid for more general formulas for incomplete elliptic integrals. Nevertheless, following James Ivory (1765 — 1842), for complete elliptic integrals, it is more efficient to proceed by using a hypergeometric series expansion. Namely, by using the trick

$1+2x\cos(\alpha)+x^2=(1+x\mathrm{e}^{\mathrm{i}\alpha})(1+x\mathrm{e}^{-\mathrm{i}\alpha})$

and the Newton binomial theorem

$\frac{1}{(1-z)^{\alpha}}=\sum_{n=0}^\infty\frac{(\alpha)_n}{n!}z^n,$

where ${(\alpha)_n:=\alpha(\alpha+1)\cdots(\alpha+n-1)}$ is the rising factorial, we get, for ${0\leq x<1}$,

$\begin{array}{rcl} K\Bigr(\frac{4x}{(1+x)^2}\Bigr) &=&\frac{1}{2}\int_0^{\pi} \Bigr(\Bigr(1-\frac{4x}{(1+x)^2}\sin^2(\theta)\Bigr)^{-1/2} \mathrm{d}\theta\\ &=&\frac{1}{2}\int_0^{\pi} \Bigr(\Bigr(1-\frac{2x}{(1+x)^2}(1-\cos(2\theta))\Bigr)^{-1/2} \mathrm{d}\theta\\ &=&\frac{1+x}{2}\int_0^{\pi} \Bigr(1+x^2+2x\cos(2\theta)\Bigr)^{-1/2} \mathrm{d}\theta\\ &=&\frac{1+x}{2}\int_0^{\pi} \Bigr(1+x\mathrm{e}^{2\mathrm{i}\theta}\Bigr)^{-1/2} \Bigr(1+x\mathrm{e}^{-2\mathrm{i}\theta}\Bigr)^{-1/2} \mathrm{d}\theta\\ &=&\frac{1+x}{2}\sum_{m=0}^\infty \frac{(\frac{1}{2})_m(-x)^m}{m!} \sum_{n=0}^\infty \frac{(\frac{1}{2})_n(-x)^n}{n!} \int_0^{\pi}\mathrm{e}^{2\mathrm{i}(m-n)\theta}\mathrm{d}\theta\\ &=&\frac{\pi}{2}(1+x)\sum_{n=0}^\infty\frac{(\frac{1}{2})_n^2x^{2n}}{n!^2}\\ &=&(1+x)\frac{\pi}{2}F_{2,1}\Bigr(\frac{1}{2},\frac{1}{2};1;x^2\Bigr)\\ &=&(1+x)K(x^2). \end{array}$

This can be seen as a formula for hypergeometric series: if ${0\leq x<1}$ then

$F_{2,1}\Bigr(\frac{1}{2},\frac{1}{2};1;\frac{4x}{(1+x)^2}\Bigr) =(1+x)F_{2,1}\Bigr(\frac{1}{2},\frac{1}{2};1;x^2\Bigr).$

Similarly, using in the last step

$K(x^2)=F_{2,1}\Bigr(\frac{1}{2},\frac{1}{2};1;x^2\Bigr) \quad\text{and}\quad E(x^2)=F_{2,1}\Bigr(-\frac{1}{2},\frac{1}{2};1;x^2\Bigr),$

we get

$\begin{array}{rcl} (1+x)E\Bigr(\frac{4x}{(1+x)^2}\Bigr) &=&\frac{1+x}{2}\int_0^{\pi} \Bigr(1-\frac{4x}{(1+x)^2}\sin^2(\theta)\Bigr)^{1/2} \mathrm{d}\theta\\ &=&\frac{1+x}{2}\int_0^{\pi} \Bigr(\Bigr(1-\frac{2x}{(1+x)^2}(1-\cos(2\theta))\Bigr)^{1/2} \mathrm{d}\theta\\ &=&\frac{1}{2}\int_0^{\pi} \Bigr(1+x^2+2x\cos(2\theta)\Bigr)^{1/2} \mathrm{d}\theta\\ &=&\frac{1}{2}\int_0^{\pi} \Bigr(1+x\mathrm{e}^{2\mathrm{i}\theta}\Bigr)^{1/2} \Bigr(1+x\mathrm{e}^{-2\mathrm{i}\theta}\Bigr)^{1/2} \mathrm{d}\theta\\ &=&\frac{1}{2}\sum_{m=0}^\infty \frac{(-\frac{1}{2})_m(-x)^m}{m!} \sum_{n=0}^\infty \frac{(-\frac{1}{2})_n(-x)^n}{n!} \int_0^{\pi}\mathrm{e}^{2\mathrm{i}(m-n)\theta}\mathrm{d}\theta\\ &=&\frac{\pi}{2}\sum_{n=0}^\infty\frac{(-\frac{1}{2})_n^2x^{2n}}{n!^2}\\ &=&\frac{\pi}{2}F_{2,1}\Bigr(-\frac{1}{2},-\frac{1}{2};1;x^2\Bigr)\\ &=&\frac{\pi}{2}\Bigr(2F_{2,1}\Bigr(-\frac{1}{2},\frac{1}{2};1;x^2\Bigr) -(1-x^2)F_{2,1}\Bigr(\frac{1}{2},\frac{1}{2};1;x^2\Bigr)\Bigr)\\ &=&2E(x^2)-(1-x^2)K(x^2). \end{array}$

This corresponds to the hypergeometric identity

$\begin{array}{rcl} (1+x)F_{2,1}\Big(-\frac{1}{2},\frac{1}{2};1;\frac{4x}{(1+x)^2}\Bigr) &=&F_{2,1}\Bigr(-\frac{1}{2},-\frac{1}{2};1;x^2\Bigr)\\ &=&2F_{2,1}\Bigr(-\frac{1}{2},\frac{1}{2};1;x^2\Bigr) -(1-x^2)F_{2,1}\Bigr(\frac{1}{2},\frac{1}{2};1;x^2\Bigr). \end{array}$

Invariance of Cayley elliptic integral. For all ${a,b>0}$, the Cayley elliptic integral

$I(a,b) :=\int_0^{\frac{\pi}{2}} \frac{1}{\sqrt{a^2\cos^2(\theta)+b^2\sin^2(\theta)}} \mathrm{d}\theta$

is left unchanged if we replace ${a,b}$ by their arithmetic and geometric means, namely

$I(a,b)=I\left(\frac{a+b}{2},\sqrt{ab}\right).$

Similarly if we define

$J(a,b):= \int_0^{\frac{\pi}{2}} \sqrt{a^2\cos^2(\theta)+b^2\sin^2(\theta)} \mathrm{d}\theta$

then

$2J\Bigr(\frac{a+b}{2},\sqrt{ab}\Bigr) =J(a,b) + ab I(a,b)$

Link with Landen transformation for ${K}$. If ${a>b>0}$ then

$I(a,b) =\int_0^{\frac{\pi}{2}} \frac{1}{\sqrt{a^2-(a^2-b^2)\sin^2(\theta)}} \mathrm{d}\theta =\frac{1}{a}K\left(\frac{a^2-b^2}{a^2}\right)$

and

$I\left(\frac{a+b}{2},\sqrt{ab}\right) =\frac{1}{\frac{a+b}{2}} K\left(\frac{\left(\frac{a+b}{2}\right)^2-b^2}{\left(\frac{a+b}{2}\right)^2}\right) =\frac{2}{a+b}K\left(\frac{(a+b)^2-4b^2}{(a+b)^2}\right) =\frac{2}{a+b}K\left(\left(\frac{a-b}{a+b}\right)^2\right),$

and thus, by the invariance of Cayley elliptic integrals,

$K\left(\left(\frac{a-b}{a+b}\right)^2\right) =\frac{a+b}{2a}K\left(\frac{a^2-b^2}{a^2}\right).$

Setting ${x:=\frac{a-b}{a+b}}$ we get ${1+x=\frac{2a}{a+b}}$, ${\frac{4x}{(1+x)^2}=a^2-b^2}$, and, when ${a=1}$,

$(1+x)K(x^2) = K\left(\frac{4x}{(1+x)^2}\right).$

We have thus obtained, from the invariance formula for the Cayley integral ${I(a,b)}$, an alternative proof of the Landen transform formula involving ${K}$. Similarly, the invariance formula for ${J(a,b)}$ leads to the Landen transform formula involving ${E}$ and ${K}$.

Link with arithmetic-geometric mean. If we define ${a_0:=a}$, ${b_0=b}$, and

$a_{n+1}:=\frac{a_n+b_n}{2} \quad\text{and}\quad b_{n+1}:=\sqrt{a_nb_n}$

for all ${n\geq0}$, then it can be shown that

$b=b_0\leq b_1\leq\cdots\leq b_{n+1}\leq a_{n+1}\leq\cdots\leq a_1\leq a_0=a$

and that actually both sequences converge as ${n\rightarrow\infty}$ to a common limit, the arithmetic-geometric mean (AGM) ${M(a,b)}$. Indeed, if ${c_n:=\sqrt{a_n^2-b_n^2}}$ then

$c_{n+1}=\frac{a_n-b_n}{2}\quad\text{and}\quad c_n^2=(a_n-b_n)(a_n+b_n)=4c_{n+1}a_{n+1},$

hence ${c_n}$ decreases to ${0}$ as ${n\rightarrow\infty}$ and

$M(a,b):= \lim_{n\rightarrow\infty}a_n=\lim_{n\rightarrow\infty}b_n.$

Using the invariance of Cayley integrals and observing that ${(a,b)\mapsto I(a,b)}$ is continuous and ${I(c,c)=\frac{\pi}{2c}}$ for all ${c}$, we get

$I(a,b)=I(M(a,b),M(a,b))=\frac{\pi}{2M(a,b)}.$

Moreover since ${I(a,b)=\frac{1}{a}K\Bigr(\frac{a^2-b^2}{a^2}\Bigr)}$ we get

$M(a,b)=\frac{a\pi}{K\Big(\frac{a^2-b^2}{a^2}\Bigr)}.$

If we set ${x:=\frac{\sqrt{a^2-b^2}}{a}}$ then using

$M(a,b)=a^2M\Bigr(1,\frac{b}{a}\Bigr)=M(1,\sqrt{1-x^2})=M(1-x,1+x)$

we get

$M(1-x,1+x)=\frac{\pi}{2K(x^2)}.$

Proof of the invariance of Cayley elliptic integrals. The change of variable

$b\tan\theta=x$

gives ${\mathrm{d}\theta=\frac{\cos^2(\theta)}{b}\mathrm{d}x}$, and since ${\cos^2(\theta)=\frac{b^2}{x^2+b^2}}$,

$I(a,b) =\int_0^\infty \frac{1}{\sqrt{\cos^2(\theta)}\sqrt{(a^2+x^2)}}\frac{b}{x^2+b^2} \mathrm{d}x =\int_0^\infty\frac{1}{\sqrt{(a^2+x^2)(x^2+b^2)}} \mathrm{d}x.$

The further substitution ${x=t+\sqrt{t^2+ab}}$ satisfies

$\mathrm{d}x=(1+\frac{t}{\sqrt{t^2+ab}})\mathrm{d}t=\frac{x}{\sqrt{t^2+ab}}\mathrm{d}t,$

and the identity

$\sqrt{(x^2+a^2)(x^2+b^2)} =2x\sqrt{t^2+\left(\frac{a+b}{2}\right)^2},$

which can be checked using the simpler identity ${x^2=2tx+ab}$, gives

$I(a,b) = \frac{1}{2}\int_{-\infty}^\infty \frac{1}{\sqrt{t^2+\left(\frac{a+b}{2}\right)^2}\sqrt{t^2+ab}} \mathrm{d}t = \int_0^\infty \frac{1}{\sqrt{\left(t^2+\left(\frac{a+b}{2}\right)^2\right) \left(t^2+\sqrt{ab}^2\right)}} \mathrm{d}t$

which is equal to ${I\left(\frac{a+b}{2},\sqrt{ab}\right)}$ according to the preceding formula with ${\frac{a+b}{2},\sqrt{ab}}$ instead of ${a,b}$. Alternatively, following Jean-Pierre Demailly (1957 –), using the change of variable

$\varphi=\theta+\arctan\Bigr(\frac{b}{a}\tan(\theta)\Bigr)$

which is an increasing bijection from ${[0,\pi/2)}$ to ${[0,\pi)}$, we have

$\frac{\mathrm{d}\varphi}{\mathrm{d}\theta} =1+\frac{\frac{b}{a}(1+\tan^2(\theta))}{1+\frac{b^2}{a^2}\tan^2(\theta)} =\frac{(a+b)(a\cos^2(\theta)+b\sin^2(\theta))}{a^2\cos^2(\theta)+b^2\sin^2(\theta)}.$

On the other hand

$\varphi=\theta+\alpha\quad\text{where}\quad\alpha:=\arctan\Bigr(\frac{b}{a}\tan(\theta)\Bigr)\in[0,\pi/2).$

We have ${\tan(\alpha)=\frac{b}{a}\tan(\theta)}$ and since

$\cos(\alpha)=\frac{1}{\sqrt{1-\tan^2(\alpha)}} \quad\text{and}\quad \sin(\alpha)=\frac{\tan(\alpha)}{\sqrt{1+\tan^2(\alpha)}}$

we get

$\begin{array}{rcl} \cos(\varphi) &=&\cos(\theta)\cos(\alpha)-\sin(\theta)\sin(\alpha)\\ &=&\cos(\theta)\frac{1}{\sqrt{1+\Bigr(\frac{b}{a}\Bigr)^2\tan^2(\theta)}} -\sin(\theta)\frac{\frac{b}{a}\tan(\theta)}{\sqrt{1+\Bigr(\frac{b}{a}\Bigr)^2\tan^2(\theta)}} =\frac{a\cos^2(\theta)-b\sin^2(\theta)}{\sqrt{a^2\cos^2(\theta)+b^2\sin^2(\theta)}} \end{array}$

and

$\begin{array}{rcl} \sin(\varphi) &=&\sin(\theta)\cos(\alpha)+\cos(\theta)\sin(\alpha)\\ &=&\sin(\theta)\frac{1}{\sqrt{1+\Bigr(\frac{b}{a}\Bigr)^2\tan^2(\theta)}} +\cos(\theta)\frac{\frac{b}{a}\tan(\theta)}{\sqrt{1+\Bigr(\frac{b}{a}\Bigr)^2\tan^2(\theta)}} =\frac{(a+b)\sin(\theta)\cos(\theta)}{\sqrt{a^2\cos^2(\theta)+b^2\sin^2(\theta)}}. \end{array}$

This gives

$\begin{array}{rcl} a_1^2\cos^2(\varphi)+b_1^2\sin^2(\varphi) &=&\Bigr(\frac{a+b}{2}\Bigr)^2\Bigr(\cos^2(\varphi)+\frac{4ab}{(a+b)^2}\sin^2(\varphi)\Bigr)\\ &=&\Bigr(\frac{a+b}{2}\Bigr)^2 \frac{(a\cos^2(\theta)-b\sin^2(\theta))^2+4ab\sin^2(t)\cos^2(t)} {a^2\cos^2(\theta)+b^2\sin^2(\theta)}\\ &=&\Bigr(\frac{a+b}{2}\Bigr)^2 \frac{(a\cos^2(\theta)+b\sin^2(\theta))^2} {a^2\cos^2(\theta)+b^2\sin^2(\theta)}. \end{array}$

In other words, setting ${\Delta(\theta):=\sqrt{a^2\cos^2(\theta)+b^2\sin^2(\theta)}}$, we get

$\Delta_1(\varphi) :=\sqrt{a_1^2\cos^2(\varphi)+b_1^2\sin^2(\varphi)} =\frac{a+b}{2}\frac{a\cos^2(\varphi)+b\sin^2(\theta)}{\sqrt{a^2\cos^2(\theta)+b^2\sin^2(\theta)}} =\frac{a+b}{2}\frac{a\cos^2(\theta)+b\sin^2(\theta)}{\Delta(\theta)}$

and thus, combining this with a formula above for ${\mathrm{d}\varphi/\mathrm{d}\theta}$ we obtain

$\frac{1}{2}\frac{\mathrm{d}\varphi}{\Delta_1(\varphi)} =\frac{1}{2}\frac{\mathrm{d}\varphi}{\sqrt{a_1^2\cos^2(\varphi)+b_1^2\sin^2(\varphi)}} =\frac{\mathrm{d}\theta}{\sqrt{a^2\cos^2(\theta)+b^2\sin^2(\theta)}} =\frac{\mathrm{d}\theta}{\Delta(\theta)}$

hence finally

$I\Big(\frac{a+b}{2},\sqrt{ab}\Bigr)=I(a,b).$

Next, for the formula concerning ${J}$, we observe that

$\Delta_1(\varphi)+\frac{a-b}{2}\cos(\varphi) =\frac{a^2\cos^2(\theta)+b^2\sin^2(\theta)}{\sqrt{a^2\sin^2(\theta)+b^2\cos^2(\theta)}} =\Delta(\theta)$

and

$\Delta_1(\varphi)-\frac{a-b}{2}\cos(\varphi) =\frac{ab\cos^2(\theta)+ab\sin^2(\theta)}{\sqrt{a^2\sin^2(\theta)+b^2\cos^2(\theta)}} =\frac{ab}{\Delta(\theta)},$

hence

$2\Delta_1(\varphi)=\Delta(\theta)+\frac{ab}{\Delta(\theta)},$

while a formula above reads ${\mathrm{d}\varphi=2\frac{\Delta_1(\varphi)}{\Delta(\theta)}\mathrm{d}\theta}$ hence

$\Delta_1(\varphi)\mathrm{d}\varphi +\frac{a-b}{2}\cos(\varphi)\mathrm{d}\varphi =\Delta(\theta)\mathrm{d}\varphi =2\Delta_1(\varphi)\mathrm{d}\theta =\Bigr(\Delta(\theta)+\frac{ab}{\Delta(\theta)}\Bigr)\mathrm{d}\theta.$

Finally, since ${\int_0^{2\pi}\cos(\theta)\mathrm{d}\theta=0}$ we get as expected

$2J(a_1,b_1)=J(a,b)+abI(a,b).$

Historical proof by change of variable due to Landen. This proof works also for incomplete elliptic integrals, and admits a geometrical interpretation. Let

$x\in[0,1],\quad x’=\sqrt{1-x^2},\quad x_1=\frac{1-x’}{1+x’}.$

We start from the formula

$2K(x_1^2) =\int_0^{\pi}\frac{\mathrm{d}\theta_1}{\sqrt{1-x_1^2\sin^2(\theta_1)}}.$

We would like to set ${x_1\sin(\theta_1)=\sin(\alpha)}$ in such a way that ${x_1^2\sin^2(\theta_1)=\sin^2(\alpha)}$. But it turns out that it is better to use another change of variable, namely replace ${\theta_1}$ by ${\theta}$ with

$2\theta=\theta_1+\alpha=\theta_1+\arcsin(x_1\sin(\theta_1))$

where ${\arcsin}$ takes its values in ${[0,\pi/2]}$. Then ${\theta}$ runs over ${[0,\pi/2]}$ when ${\theta_1}$ runs over ${[0,\pi]}$, the derivative of the formula with respect to ${\theta_1}$ is ${1+\cos(\theta_1)/\sqrt{1-x_1^2\sin^2(\theta_1)}}$, which vanishes only for ${\theta_1=\pi}$. The crucial point now is the identity

$(1+x_1)\sqrt{1-x^2\sin^2(\theta)} =\sqrt{1-x_1^2\sin^2(\theta_1)} +x_1\cos(\theta_1)$

Now we get

$(1+x_1)x^2 \frac{\sin(\theta)\cos(\theta)} {\sqrt{1-x^2\sin^2(\theta)}} \mathrm{d}\theta = \left( x_1^2 \frac{\sin(\theta_1)\cos(\theta_1)} {\sqrt{1-x_1^2\sin^2(\theta_1)}} +x_1\sin(\theta_1) \right)\mathrm{d}\theta_1$

hence

$\frac{1+x_1}{2x_1}x^2 \frac{\sin(2\theta)} {\sqrt{1-x^2\sin^2(\theta)}} \mathrm{d}\theta = \left( \frac{x_1\sin(\theta_1)\cos(\theta_1) +\sin(\theta_1)\sqrt{1-x_1^2\sin^2(\theta_1)}} {\sqrt{1-x_1^2\sin^2(\theta_1)}} \right)\mathrm{d}\theta_1$

hence

$(1+x’) \frac{\sin(2\theta)} {\sqrt{1-x^2\sin^2(\theta)}} \mathrm{d}\theta = \left( \frac{\sin(\alpha)\cos(\theta_1) +\sin(\theta_1)\cos(\alpha)} {\sqrt{1-x_1^2\sin^2(\theta_1)}} \right)\mathrm{d}\theta_1$

hence

$(1+x’)\frac{\sin(2\theta)} {\sqrt{1-x^2\sin^2(\theta)}} \mathrm{d}\theta = \left( \frac{\sin(\alpha+\theta_1)} {\sqrt{1-x_1^2\sin^2(\theta_1)}} \right)\mathrm{d}\theta_1$

and finally

$(1+x’) \frac{1} {\sqrt{1-x^2\sin^2(\theta)}} \mathrm{d}\theta = \frac{1} {\sqrt{1-x_1^2\sin^2(\theta_1)}} \mathrm{d}\theta_1.$

Integrating over the range of ${\theta}$ and ${\theta_1}$ we obtain

$(1+x’) \int_0^{\frac{\pi}{2}} \frac{\mathrm{d}\theta} {\sqrt{1-x^2\sin^2(\theta)}} = \int_0^{\pi} \frac{\mathrm{d}\theta_1} {\sqrt{1-x_1^2\sin^2(\theta_1)}}$

which gives ${(1+x’)K(x^2)=2K(x_1^2)}$, in other words ${(1+x’)K(1-x’^2)=2K(x_1^2)}$ which is the desired formula with ${x’}$ instead of ${x}$. To get the formula involving ${E}$, we write

$1-x^2\sin^2(\theta) =1-x^2\frac{1-\cos(2\theta)}{2} =1-\frac{x^2}{2}+\frac{x^2}{2}\cos(2\theta),$

and since

$\cos(2\theta) =\cos(\theta_1)\cos(\alpha)-\sin(\theta_1)\sin(\alpha) =\cos(\theta_1)\sqrt{1-x_1^2\sin^2(\theta_1)}-x_1\sin^2(\theta_1)$

we get

$1-x^2\sin^2(\theta) =1-\frac{x^2}{2}-\frac{x^2}{2x_1} +\frac{x^2}{2}\cos(\theta_1)\sqrt{1-x_1^2\sin(\theta_1)} +\frac{x^2}{2x_1}(1-x_1^2\sin^2(\theta_1)).$

Now since ${\frac{x^2}{2x_1}=\frac{(1+x’)^2}{2}}$ and ${1-\frac{x^2}{2}-\frac{x^2}{2x_1}=-x’}$ we obtain

$1-x^2\sin^2(\theta) =x’ +\frac{x^2}{2}\cos(\theta_1)\sqrt{1-x_1^2\sin(\theta_1)} +\frac{(1+x’)^2}{2}(1-x_1^2\sin^2(\theta_1)).$

Combining this identity with a previous identity we obtain

$(1+x’) \int_0^{\frac{\pi}{2}} \sqrt{1-x^2\sin^2(\theta)} \mathrm{d}\theta = \int_0^{\pi} \frac{-x’ +\frac{x^2}{2}\cos(\theta_1)\sqrt{1-x_1^2\sin(\theta_1)} +\frac{(1+x’)^2}{2}(1-x_1^2\sin^2(\theta_1))} {\sqrt{1-x_1^2\sin^2(\theta_1)}} \mathrm{d}\theta_1,$

hence ${(1+x’)E(x^2)=-2x’K(x_1^2)+0+\frac{(1+x’)^2}{2}2E(x_1^2)}$ which rewrites as ${\frac{1}{1+x’}E(1-x’^2)=-\frac{2x’}{(1+x’)^2}K(x_1^2)+E(x_1^2)}$ which is the desired formula with ${x’}$ instead of ${x}$.

Alternative expression of the change of variable. It reads

$\tan(\alpha) =\frac{x_1\sin(\theta_1)}{\sqrt{1-x_1^2\sin^2(\theta_1)}} =\frac{x_1\sin(2\theta)}{1+x_1\cos(2\theta)}.$

Indeed, we have

$\cos(2\theta) =\cos(\theta_1)\cos(\alpha)-\sin(\theta_1)\sin(\alpha) =\cos(\theta_1)\sqrt{1-x_1^2\sin^2(\theta_1)}-x_1\sin^2(\theta_1)$

thus

$1+x_1\cos(2\theta) =\sqrt{1-x_1^2\sin^2(\theta_1)} \Bigr(x_1\cos(\theta_1)+\sqrt{1-x_1^2\sin^2(\theta_1)}\Bigr)$

and therefore

$\sqrt{1-x_1^2\sin^2(\theta_1)} =\frac{1+x_1\cos(2\theta)} {x_1\cos(\theta_1)+\sqrt{1-x_1^2\sin^2(\theta_1)}} =\frac{1+x_1\cos(2\theta)} {(1+x_1)\sqrt{1-x^2\sin^2(\theta)}}.$

Similarly we get

$\sin(2\theta) =\sin(\theta_1)\cos(\alpha)+\cos(\theta_1)\sin(\alpha) =\sin(\theta_1)\sqrt{1-x_1^2\sin^2(\theta_1)}+x_1\sin(\theta_1)\cos(\theta_1)$

and therefore

$x_1\sin(\theta_1) =\frac{x_1\sin(2\theta)} {\sqrt{1-x_1^2\sin^2(\theta_1)}+x_1\cos(\theta_1)} =\frac{x_1\sin(2\theta)} {(1+x_1)\sqrt{1-x^2\sin^2(\theta)}}$

Finally writing ${\tan(\alpha)=\frac{\sin(\alpha)}{\cos(\alpha)}=\frac{x_1\sin(\alpha)}{\sqrt{1-x_1^2\sin^2(\theta)}}}$ leads to the desired expression.