Landen's transformation

Landen's transformation is a mapping of the parameters of an elliptic integral, useful for the efficient numerical evaluation of elliptic functions. It was originally due to John Landen and independently rediscovered by Carl Friedrich Gauss.

Statement
The incomplete elliptic integral of the first kind $F$ is
 * $$ F(\varphi \setminus \alpha) = F(\varphi, \sin \alpha) = \int_0^\varphi \frac{d \theta}{\sqrt{1-(\sin \theta \sin \alpha)^2}},$$

where $$\alpha$$ is the modular angle. Landen's transformation states that if $$\alpha_0$$, $$\alpha_1$$, $$\varphi_0$$, $$\varphi_1$$ are such that $$(1 + \sin\alpha_1)(1 + \cos\alpha_0) = 2$$ and $$\tan(\varphi_1 - \varphi_0) = \cos\alpha_0 \tan \varphi_0$$, then
 * $$\begin{align}

F(\varphi_0 \setminus \alpha_0) &= (1 + \cos\alpha_0)^{-1} F(\varphi_1 \setminus \alpha_1) \\ &= \tfrac{1}{2}(1 + \sin\alpha_1) F(\varphi_1 \setminus \alpha_1). \end{align}$$ Landen's transformation can similarly be expressed in terms of the elliptic modulus $$k = \sin\alpha$$ and its complement $$k' = \cos\alpha$$.

Complete elliptic integral
In Gauss's formulation, the value of the integral
 * $$I = \int_0^{\frac{\pi}{2}}\frac{1}{\sqrt{a^2 \cos^2(\theta) + b^2 \sin^2(\theta)}} \, d \theta$$

is unchanged if $$a$$ and $$b$$ are replaced by their arithmetic and geometric means respectively, that is
 * $$a_1 = \frac{a + b}{2},\qquad b_1 = \sqrt{a b},$$
 * $$I_1 = \int _0^{\frac{\pi}{2}}\frac{1}{\sqrt{a_1^2 \cos^2(\theta) + b_1^2 \sin^2(\theta)}} \, d \theta.$$

Therefore,
 * $$I=\frac{1}{a}K\left(\frac{\sqrt{a^2 - b^2}}{a}\right),  $$
 * $$I_1=\frac{2}{a+b}K\left(\frac{a-b}{a+b}\right). $$

From Landen's transformation we conclude
 * $$K\left(\frac{\sqrt{a^2 - b^2}}{a}\right)=\frac{2a}{a+b}K\left(\frac{a-b}{a+b}\right) $$

and $$I_1=I$$.

Proof
The transformation may be effected by integration by substitution. It is convenient to first cast the integral in an algebraic form by a substitution of $$\theta = \arctan (x/b)$$, $$d \theta = (\cos^{2}(\theta)/b) d x$$ giving


 * $$I = \int _0^{\frac{\pi}{2}}\frac{1}{\sqrt{a^2 \cos^2(\theta) + b^2 \sin^2(\theta)}} \, d \theta = \int _0^\infty \frac{1}{\sqrt{(x^2 + a^2) (x^2 + b^2)}} \, dx$$

A further substitution of $$x = t + \sqrt{t^{2} + a b}$$ gives the desired result


 * $$\begin{align}I & = \int _0^\infty \frac{1}{\sqrt{(x^2 + a^2) (x^2 + b^2)}} \, dx \\

& = \int _{- \infty}^\infty \frac{1}{2 \sqrt{\left( t^2 + \left( \frac{a + b}{2}\right)^2 \right) (t^2 + a b)}} \, dt \\ & = \int _0^\infty\frac{1}{\sqrt{\left( t^2 + \left( \frac{a + b}{2}\right)^2\right) \left(t^2 + \left(\sqrt{a b}\right)^2\right)}} \, dt \end{align}$$

This latter step is facilitated by writing the radical as


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

and the infinitesimal as


 * $$ dx = \frac{x}{\sqrt{t^2 + a b}} \, dt$$

so that the factor of $$x$$ is recognized and cancelled between the two factors.

Arithmetic-geometric mean and Legendre's first integral
If the transformation is iterated a number of times, then the parameters $$a$$ and $$b$$ converge very rapidly to a common value, even if they are initially of different orders of magnitude. The limiting value is called the arithmetic-geometric mean of $$a$$ and $$b$$, $$\operatorname{AGM}(a,b)$$. In the limit, the integrand becomes a constant, so that integration is trivial


 * $$I = \int _0^{\frac{\pi}{2}} \frac{1}{\sqrt{a^2 \cos^2(\theta) + b^2 \sin^2(\theta)}} \, d\theta = \int _0^{\frac{\pi}{2}}\frac{1}{\operatorname{AGM}(a,b)} \, d\theta = \frac{\pi}{2 \operatorname{AGM}(a,b)}$$

The integral may also be recognized as a multiple of Legendre's complete elliptic integral of the first kind. Putting $$b^2 = a^2 (1 - k^2)$$


 * $$I = \frac{1}{a} \int _0^{\frac{\pi}{2}} \frac{1}{\sqrt{1 - k^2 \sin^2(\theta)}} \, d\theta = \frac{1}{a} F\left( \frac{\pi}{2},k\right) = \frac{1}{a} K(k)$$

Hence, for any $$a$$, the arithmetic-geometric mean and the complete elliptic integral of the first kind are related by


 * $$K(k) = \frac{\pi }{2 \operatorname{AGM}(1, \sqrt{1 - k^2})}$$

By performing an inverse transformation (reverse arithmetic-geometric mean iteration), that is


 * $$a_{-1} = a + \sqrt{a^2 - b^2} \, $$


 * $$b_{-1} = a - \sqrt{a^2 - b^2} \, $$


 * $$\operatorname{AGM}(a,b) = \operatorname{AGM}\left(a + \sqrt{a^2 - b^2},a - \sqrt{a^2 - b^2}\right) \, $$

the relationship may be written as


 * $$K(k) = \frac{\pi}{2 \operatorname{AGM}(1 + k, 1 - k)} \, $$

which may be solved for the AGM of a pair of arbitrary arguments;


 * $$ \operatorname{AGM}(u,v) = \frac{\pi (u + v)}{4 K\left( \frac{u - v}{v + u}\right)}.$$