# Arithmetic-geometric mean

In mathematics, the arithmetic-geometric mean (AGM) of two positive real numbers x and y is defined as follows:

First compute the arithmetic mean of x and y and call it a1. Next compute the geometric mean of x and y and call it g1; this is the square root of the product xy:

{\displaystyle {\begin{aligned}a_{1}&={\frac {1}{2}}(x+y)\\g_{1}&={\sqrt {xy}}\end{aligned}}}

Then iterate this operation with a1 taking the place of x and g1 taking the place of y. In this way, two sequences (an) and (gn) are defined:

{\displaystyle {\begin{aligned}a_{n+1}&={\frac {1}{2}}(a_{n}+g_{n})\\g_{n+1}&={\sqrt {a_{n}g_{n}}}\end{aligned}}}

These two sequences converge to the same number, which is the arithmetic-geometric mean of x and y; it is denoted by M(x, y), or sometimes by agm(x, y).

This can be used for algorithmic purposes as in the AGM method.

## Example

To find the arithmetic-geometric mean of a0 = 24 and g0 = 6, first calculate their arithmetic mean and geometric mean, thus:

{\displaystyle {\begin{aligned}a_{1}&={\frac {1}{2}}(24+6)=15\\g_{1}&={\sqrt {24\times 6}}=12\end{aligned}}}

and then iterate as follows:

{\displaystyle {\begin{aligned}a_{2}&={\frac {1}{2}}(15+12)=13.5\\g_{2}&={\sqrt {15\times 12}}=13.41640786500\dots \\\dots \end{aligned}}}

The first four iterations give the following values:

n an gn
0 24 6
1 15 12
2 13.5 13.41640786500…
3 13.45820393250… 13.45813903099…
4 13.45817148175… 13.45817148171…

The arithmetic-geometric mean of 24 and 6 is the common limit of these two sequences, which is approximately 13.45817148173.

## Properties

The geometric mean of two positive numbers is never bigger than the arithmetic mean (see inequality of arithmetic and geometric means); as a consequence, (gn) is an increasing sequence, (an) is a decreasing sequence, and gn ≤ M(xy) ≤ an. These are strict inequalities if xy.

M(x, y) is thus a number between the geometric and arithmetic mean of x and y; in particular it is between x and y.

If r ≥ 0, then M(rx,ry) = rM(x,y).

There is an integral-form expression for M(x,y):

${\displaystyle \mathrm {M} (x,y)={\frac {\pi }{4}}(x+y)\;/\;K\left({\frac {x-y}{x+y}}\right)}$

where K(m) is the complete elliptic integral of the first kind:

${\displaystyle K(m)=\int _{0}^{\frac {\pi }{2}}{\frac {d\theta }{\sqrt {1-m\sin ^{2}(\theta )}}}}$

Indeed, since the arithmetic-geometric process converges so quickly, it provides an effective way to compute elliptic integrals via this formula.

The reciprocal of the arithmetic-geometric mean of 1 and the square root of 2 is called Gauss's constant, after Carl Friedrich Gauss.

${\displaystyle {\frac {1}{\mathrm {M} (1,{\sqrt {2}})}}=G=0.8346268\dots }$

The geometric-harmonic mean can be calculated by an analogous method, using sequences of geometric and harmonic means. The arithmetic-harmonic mean can be similarly defined, but takes the same value as the geometric mean.

The modified arithmetic-geometric mean was introduced and defined by Semjon Adlaj on p. 1094 of the September 2012 issue of the Notices of the AMS.[1] It turned out useful for computing complete elliptic integrals of the second kind.

## Proof of existence

From inequality of arithmetic and geometric means we can conclude that:

${\displaystyle g_{i}\leqslant a_{i}}$

and thus

${\displaystyle g_{i+1}={\sqrt {g_{i}\cdot a_{i}}}\geqslant {\sqrt {g_{i}\cdot g_{i}}}=g_{i}}$

that is, the sequence gi is nondecreasing.

Furthermore, it is easy to see that it is also bounded above by the larger of x and y (which follows from the fact that both arithmetic and geometric means of two numbers both lie between them). Thus by the monotone convergence theorem the sequence is convergent, so there exists a g such that:

${\displaystyle \lim _{n\to \infty }g_{n}=g}$

However, we can also see that:

${\displaystyle a_{i}={\frac {g_{i+1}^{2}}{g_{i}}}}$

and so:

${\displaystyle \lim _{n\to \infty }a_{n}=\lim _{n\to \infty }{\frac {g_{n+1}^{2}}{g_{n}}}={\frac {g^{2}}{g}}=g}$

## Proof of the integral-form expression

The following proof relies on the work of Carl Wilhelm Borchardt.

Set,

{\displaystyle {\begin{aligned}a_{0}\equiv x\\g_{0}\equiv y\end{aligned}}}
{\displaystyle {\begin{aligned}a_{1}&={\frac {1}{2}}(a_{0}+g_{0})\qquad (1)\\g_{1}&={\sqrt {a_{0}g_{0}}}\end{aligned}}}

It is obvious that ${\displaystyle \scriptstyle M(a_{0},\,g_{0})\;=\;M(a_{1},\,g_{1})\;=\;\ldots \;=\;M(a_{n},\,g_{n})}$. As mentioned above, if ${\displaystyle \scriptstyle r\;\geq \;0}$ then ${\displaystyle \scriptstyle M(ra_{0},\,rg_{0})\;=\;rM(a_{0},\,g_{0})}$. Therefore following expression holds:

${\displaystyle g=a_{0}M\left(1,{\frac {g_{0}}{a_{0}}}\right)=a_{1}M\left(1,{\frac {g_{1}}{a_{1}}}\right)\qquad (2)}$

Next we define 4 new variables:

{\displaystyle {\begin{aligned}x&={\frac {g_{0}}{a_{0}}},\quad x_{1}={\frac {g_{1}}{a_{1}}}\\y&={\frac {1}{M\left(1,{\frac {g_{0}}{a_{0}}}\right)}},\quad y_{1}={\frac {1}{M\left(1,{\frac {g_{1}}{a_{1}}}\right)}}\qquad (3)\end{aligned}}}

Furthermore, from (1) we can deduce the following relation between ${\displaystyle \scriptstyle x}$ and ${\displaystyle \scriptstyle x_{1}}$:

${\displaystyle x_{1}={\frac {2{\sqrt {x}}}{1+x}}}$
${\displaystyle \Rightarrow {dx_{1} \over dx}={\frac {1-x}{(1+x)^{2}{\sqrt {x}}}}={\frac {\left(x_{1}-x_{1}^{3}\right)(1+x)^{2}}{2\left(x-x^{3}\right)}}\qquad (4)}$

From (2) and (3) we can deduce that

{\displaystyle {\begin{aligned}y&=y_{1}{\frac {a_{0}}{a_{1}}}=y_{1}{\frac {2a_{0}}{a_{0}+g_{0}}}={\frac {2y_{1}}{1+x}}\\{dy \over dx}&=-{\frac {2}{(1+x)^{2}}}y_{1}+{\frac {2}{1+x}}{dy_{1} \over dx_{1}}{dx_{1} \over dx}\end{aligned}}}

If we substitute (4) to the last expression and multiply it by ${\displaystyle \scriptstyle x\,-\,x^{3}}$ we'll get

${\displaystyle \left(x-x^{3}\right){dy \over dx}={\frac {2x(x-1)}{1+x}}y_{1}+(1+x)\left(x_{1}-x_{1}^{3}\right){dy_{1} \over dx_{1}}}$

Taking derivative on both sides we will get the next expression:

${\displaystyle {\frac {d}{dx}}{\left[\left(x-x^{3}\right){dy \over dx}\right]}=2y_{1}{d \over dx}\left[{\frac {x(x-1)}{1+x}}\right]+{\frac {2x(x-1)}{1+x}}{dy_{1} \over dx_{1}}{dx_{1} \over dx}+\left(x_{1}-x_{1}^{3}\right){dy_{1} \over dx_{1}}+(1+x){d \over dx_{1}}{\left[\left(x_{1}-x_{1}^{3}\right){dy_{1} \over dx_{1}}\right]}{dx_{1} \over dx}}$

After some elementary rearrangement we get:

${\displaystyle {d \over dx}\left[\left(x-x^{3}\right){dy \over dx}\right]-xy={\frac {1-x}{(1+x){\sqrt {x}}}}\left\{{d \over dx_{1}}\left[\left(x_{1}-x_{1}^{3}\right){dy_{1} \over dx_{1}}\right]-x_{1}y_{1}\right\}}$

Using the same considerations we can deduce that:

${\displaystyle {d \over dx_{1}}\left[\left(x_{1}-x_{1}^{3}\right){dy_{1} \over dx_{1}}\right]-x_{1}y_{1}={\frac {1-x_{1}}{(1+x_{1}){\sqrt {x_{1}}}}}\left\{{d \over dx_{2}}\left[\left(x_{2}-x_{2}^{3}\right){dy_{2} \over dx_{2}}\right]-x_{2}y_{2}\right\}}$

We can continue the process. Assuming,

{\displaystyle {\begin{aligned}H^{*}(y)&\equiv {d \over dx}\left[\left(x-x^{3}\right){dy \over dx}\right]-xy\\H^{*}(y)&={\frac {1-x}{(1+x){\sqrt {x}}}}{\frac {1-x_{1}}{(1+x_{1}){\sqrt {x_{1}}}}}\ldots {\frac {1-x_{n}}{(1+x_{n}){\sqrt {x_{n}}}}}H^{*}(y_{n})\end{aligned}}}
${\displaystyle H^{*}(y)=0}$

So we found a differential equation for y:

${\displaystyle {d \over dx}\left[\left(x-x^{3}\right){dy \over dx}\right]-xy=0}$

which is equivalent to:

${\displaystyle \left(x-x^{3}\right){d^{2}y \over dx^{2}}+\left(1-3x^{2}\right){dy \over dx}-xy=0}$

One of the solutions to the above equation is the complete elliptic integral of the first kind ${\displaystyle \scriptstyle K(x)}$.

${\displaystyle K(x)=\int _{0}^{\frac {\pi }{2}}{\frac {d\theta }{\sqrt {1-x\sin ^{2}(\theta )}}}}$

So, we can write the complete expression for y:

${\displaystyle y=\alpha K(x)+\beta K\left({\sqrt {1-x^{2}}}\right)}$

Using the definition of y and x as

{\displaystyle {\begin{aligned}y&={\frac {1}{M\left(1,{\frac {g_{0}}{a_{0}}}\right)}}={\frac {a_{0}}{M(a_{0},g_{0})}}\\x&={\frac {g_{0}}{a_{0}}}\end{aligned}}}

we conclude that

${\displaystyle {\frac {a_{0}}{M(a_{0},g_{0})}}=\alpha K\left({\frac {g_{0}}{a_{0}}}\right)+\beta K\left({\sqrt {1-{\frac {g_{0}^{2}}{a_{0}^{2}}}}}\right)\qquad (5)}$

Finally we need to find the values of α and β. It is easy to see that ${\displaystyle \scriptstyle M(a_{0},\,a_{0})\;=\;a_{0}}$. Substituting this to the last equation we get:

${\displaystyle {\frac {a_{0}}{a_{0}}}=\alpha K(1)+\beta K(0)}$

The values of K(x) at x = 0, 1 are: ${\displaystyle \scriptstyle K(0)\;=\;{\frac {\pi }{2}}}$, ${\displaystyle \scriptstyle K(1)\;=\;\infty }$, so α must be equal to 0. Therefore

${\displaystyle 1=\beta {\frac {\pi }{2}}\Rightarrow \beta ={\frac {2}{\pi }}}$

Returning to (5) and subtitutiong for β, we get an expression for ${\displaystyle \scriptstyle M(a_{0},\,g_{0})}$:

${\displaystyle {\frac {a_{0}}{M(a_{0},g_{0})}}={\frac {2}{\pi }}K\left({\sqrt {1-{\frac {g_{0}^{2}}{a_{0}^{2}}}}}\right)}$

hence

${\displaystyle M(a_{0},g_{0})={\frac {a_{0}\pi }{2K\left({\sqrt {1-{\frac {g_{0}^{2}}{a_{0}^{2}}}}}\right)}}}$

The expression in the properties section stated that

${\displaystyle M(a_{0},g_{0})={\frac {\pi }{4}}(a_{0}+g_{0})\;/\;K\left({\frac {a_{0}-g_{0}}{a_{0}+g_{0}}}\right)}$

To prove it we can use the expression mentioned above:

${\displaystyle g=M(a_{0},g_{0})=M(a_{1},g_{1})}$

So,

${\displaystyle g={\frac {{\frac {\pi }{2}}(a_{0}+g_{0})}{2K\left({\sqrt {1-{\frac {a_{0}g_{0}}{{\frac {1}{4}}(a_{0}+g_{0})^{2}}}}}\right)}}={\frac {\pi (a_{0}+g_{0})}{4K{\sqrt {\left({\frac {a_{0}-g_{0}}{a_{0}+g_{0}}}\right)^{2}}}}}={\frac {\pi }{4}}(a_{0}+g_{0})\;/\;K\left({\frac {a_{0}-g_{0}}{a_{0}+g_{0}}}\right)}$

which completes the proof.

## References

• {{#invoke:Citation/CS1|citation

|CitationClass=journal }}

• Jonathan Borwein, Peter Borwein, Pi and the AGM. A study in analytic number theory and computational complexity. Reprint of the 1987 original. Canadian Mathematical Society Series of Monographs and Advanced Texts, 4. A Wiley-Interscience Publication. John Wiley & Sons, Inc., New York, 1998. xvi+414 pp. ISBN 0-471-31515-X Template:MR
• Zoltán Daróczy, Zsolt Páles, Gauss-composition of means and the solution of the Matkowski-Suto problem. Publ. Math. Debrecen 61/1-2 (2002), 157–218.
• {{#invoke:citation/CS1|citation

|CitationClass=citation }}

1. Adlaj, S. An eloquent formula for the perimeter of an ellipse, Notices of the AMS 59(8), pp. 1094-1099.