In mathematics, the arithmetic–geometric mean of two positive real numbers x and y is the mutual limit of a sequence of arithmetic means and a sequence of geometric means:
Begin the sequences with x and y:
Then define the two interdependent sequences (an) and (gn) as
These two sequences converge to the same number, the arithmetic–geometric mean of x and y; it is denoted by M(x, y), or sometimes by agm(x, y) or AGM(x, y).
The arithmetic–geometric mean is used in fast algorithms for exponential and trigonometric functions, as well as some mathematical constants, in particular, computing π.
The arithmetic–geometric mean can be extended to complex numbers and when the branches of the square root are allowed to be taken inconsistently, it is, in general, a multivalued function.
To find the arithmetic–geometric mean of a0 = 24 and g0 = 6, iterate as follows:
The first five iterations give the following values:
The number of digits in which an and gn agree (underlined) approximately doubles with each iteration. The arithmetic–geometric mean of 24 and 6 is the common limit of these two sequences, which is approximately 13.4581714817256154207668131569743992430538388544.
The first algorithm based on this sequence pair appeared in the works of Lagrange. Its properties were further analyzed by Gauss.
The geometric mean of two positive numbers is never bigger than the arithmetic mean (see inequality of arithmetic and geometric means). As a consequence, for n > 0, (gn) is an increasing sequence, (an) is a decreasing sequence, and gn ≤ M(x, y) ≤ an. These are strict inequalities if x ≠ y.
M(x, y) is thus a number between the geometric and arithmetic mean of x and y; it is also between x and y.
If r ≥ 0, then M(rx,ry) = r M(x,y).
There is an integral-form expression for M(x,y):
where K(k) is the complete elliptic integral of the first kind:
Indeed, since the arithmetic–geometric process converges so quickly, it provides an efficient way to compute elliptic integrals via this formula. In engineering, it is used for instance in elliptic filter design.