# AGM method

In mathematics, the AGM method (for arithmetic–geometric mean) makes it possible to construct fast algorithms for calculation of exponential and trigonometric functions, and some mathematical constants and in particular, to quickly compute $\pi$.

## Method

Gauss noticed[1][2] that the sequences

\begin{align} a_0 & & b_0 \\ a_1 & = \frac{a_0+b_0}{2}, & b_1 & = \sqrt{a_0 b_0} \\ a_2 & = \frac{a_1+b_1}{2}, & b_2 & = \sqrt{a_1 b_1} \\ & {}\ \ \vdots & & {}\ \ \vdots \\ a_{N+1} & = \frac{a_N + b_N}{2}, & b_{N+1} & = \sqrt{a_N b_N} \end{align}

as

$N\to +\infty, \,$

have the same limit:

$\lim_{N\to\infty}a_N = \lim_{N\to\infty}b_N = M(a,b), \,$

It is possible to use this fact to construct fast algorithms for calculating elementary transcendental functions and some classical constants, in particular, the constant π.

## Applications

### The number π

For example, according to the Gauss–Salamin formula:[3]

$\pi = \frac{4 \left( M(1; \frac{1}{\sqrt{2}}) \right)^2} {\displaystyle 1 - \sum_{j=1}^\infty 2^{j+1} c_j^2} ,$

where

$c_j = \frac 12\left(a_{j-1}-b_{j-1}\right).$

### Complete elliptic integral K(α)

At the same time, if we take

$a_0 = 1, \quad b_0 = \cos\alpha,$

then

$\lim_{N\to\infty}a_N = \frac{\pi}{2K(\alpha)},$

where K(α) is a complete elliptic integral

$K(\alpha) = \int_0^{\pi/2}(1 - \alpha \sin^2\theta)^{-1/2} \, d\theta .$

### Other applications

Using this property of the AGM and also the ascending transformations of Landen,[4] Richard Brent[5] suggested the first AGM algorithms for fast evaluation of elementary transcendental functions (ex, cos x, sin x). Later many authors have been going on to study and use the AGM algorithms, see, for example, the book Pi and the AGM by Jonathan and Peter Borwein.[6]

3. ^ E. Salamin (1976). "Computation of $\pi$ using arithmetic-geometric mean". Math. Comp. 30 (135): 565–570. doi:10.2307/2005327. MR 0404124.