gives the arithmetic‐geometric mean of a and b.
ArithmeticGeometricMean
gives the arithmetic‐geometric mean of a and b.
Details
- For certain special arguments, ArithmeticGeometricMean automatically evaluates to exact values.
- ArithmeticGeometricMean can be evaluated to arbitrary numerical precision.
- ArithmeticGeometricMean is a homogeneous function of a and b, and has a branch cut discontinuity in the complex
plane, with a branch cut running from
to 0. - ArithmeticGeometricMean automatically threads over lists.
- ArithmeticGeometricMean can be used with Interval and CenteredInterval objects. »
Examples
open all close allBasic Examples (4)
ArithmeticGeometricMean[1.8, 1.2]Plot over a subset of the reals:
Plot[ArithmeticGeometricMean[1, x], {x, 0, 1}]Plot over a subset of the complexes:
ComplexPlot3D[ArithmeticGeometricMean[1, z], {z, -2 - 2I, 2 + 2I}, PlotLegends -> Automatic]Series expansion at the origin:
Series[ArithmeticGeometricMean[1, x], {x, 0, 2}, Assumptions -> x > 0]Scope (25)
Numerical Evaluation (5)
ArithmeticGeometricMean[1.2, 5]ArithmeticGeometricMean[-2., -5]N[ArithmeticGeometricMean[52, 5], 30]The precision of the output tracks the precision of the input:
ArithmeticGeometricMean[2, 3.0000000000000000000000]N[ArithmeticGeometricMean[1 + I, 3 + I]]Evaluate efficiently at high precision:
ArithmeticGeometricMean[32, 5`100]//TimingArithmeticGeometricMean[32, 5`100];//TimingCompute worst-case guaranteed intervals using Interval and CenteredInterval objects:
ArithmeticGeometricMean[2, Interval[{.8, 1.2}]]ArithmeticGeometricMean[2, CenteredInterval[8, .2]]ArithmeticGeometricMean[CenteredInterval[8, .2], 1]Or compute average-case statistical intervals using Around:
ArithmeticGeometricMean[ 1, Around[2, 0.01]]Specific Values (4)
Table[ArithmeticGeometricMean[x, y], {x, {16, 8}}, {y, {4, 10}}]//NArithmeticGeometricMean[0, 0]ArithmeticGeometricMean[a, a]Find a value of x for which ArithmeticGeometricMean[3,x]=1.5:
xval = x /. FindRoot[ArithmeticGeometricMean[3, x] == 1.5, {x, 0.5}]Plot[ArithmeticGeometricMean[3, x], {x, 0, 2}, Epilog -> Style[Point[{xval, ArithmeticGeometricMean[3, xval]}], PointSize[Large], Red]]Visualization (2)
Plot the ArithmeticGeometricMean function for various orders:
Plot[{ArithmeticGeometricMean[1, x], ArithmeticGeometricMean[2, x], ArithmeticGeometricMean[3, x], ArithmeticGeometricMean[4, x]}, {x, 0, 2}]ComplexContourPlot[Re[ArithmeticGeometricMean[2, z]], {z, -1 - I, 1 + I}, Contours -> 20]ComplexContourPlot[Im[ArithmeticGeometricMean[2, z]], {z, -1 - I, 1 + I}, Contours -> 20]Function Properties (10)
Real domain of ArithmeticGeometricMean:
FunctionDomain[ArithmeticGeometricMean[x, y], {x, y}]FunctionDomain[ArithmeticGeometricMean[w, z], {w, z}, Complexes]ArithmeticGeometricMean achieves all real values:
FunctionRange[ArithmeticGeometricMean[x, z], {x, z}, y]//QuietArithmeticGeometricMean threads elementwise over lists:
ArithmeticGeometricMean[{1.0, 2.0, 3.0}, 5]ArithmeticGeometricMean is not an analytic function:
FunctionAnalytic[ArithmeticGeometricMean[x, 1], x]It has both singularities and discontinuities:
FunctionSingularities[ArithmeticGeometricMean[x, y], {x, y}]FunctionDiscontinuities[ArithmeticGeometricMean[x, y], {x, y}]
is nondecreasing on its real domain:
FunctionMonotonicity[{ArithmeticGeometricMean[1, x], x ≥ 0}, x]FunctionInjective[ArithmeticGeometricMean[1, x], x]Plot[{ArithmeticGeometricMean[1, x], 1}, {x, 0, 2}]FunctionSurjective[ArithmeticGeometricMean[1, x], x]Plot[{ArithmeticGeometricMean[1, x], -2}, {x, -2, 2}]
is non-negative on its real domain:
FunctionSign[{ArithmeticGeometricMean[1, x], x ≥ 0}, x]
is non-positive on its real domain:
FunctionSign[{ArithmeticGeometricMean[-1, x], x <= 0}, x]
is concave on its real domain:
FunctionConvexity[{ArithmeticGeometricMean[1, x], x ≥ 0}, x]TraditionalForm formatting:
ArithmeticGeometricMean[a, b]//TraditionalFormDifferentiation (2)
First derivative with respect to b:
D[ArithmeticGeometricMean[a, b], b]Higher derivatives with respect to b:
Table[D[ArithmeticGeometricMean[a, b], {b, k}], {k, 1, 3}]//FullSimplifyPlot the higher derivatives with respect to b when a=3:
Plot[Evaluate[% /. a -> 3], {b, 0, 4}, PlotLegends -> {"First Derivative", "Second Derivative", "Third Derivative"}]Series Expansions (2)
Find the Taylor expansion using Series:
Series[ArithmeticGeometricMean[y, x], {x, 0, 2}]//Normal//FullSimplifyPlots of the first three approximations around
:
terms = Normal@Table[Series[ArithmeticGeometricMean[2, x], {x, 0, m}], {m, 1, 3}];
Plot[{ArithmeticGeometricMean[2, x], terms}, {x, 0, 10}]Taylor expansion at a generic point:
Series[ArithmeticGeometricMean[y, x], {x, x0, 2}]//Normal// FullSimplifyApplications (4)
Explicit form of the iterations yielding the arithmetic‐geometric mean:
a[n_] := (a[n - 1] + b[n - 1]) / 2;b[n_] := Sqrt[a[n - 1] b[n - 1]];a[0] = 1.;b[0] = 2.;Table[{a[n], b[n]}, {n, 5}]Compare with ArithmeticGeometricMean:
ArithmeticGeometricMean[1., 2.]Functional implementation of the previous iterative procedure:
agmIterations[a_ ? InexactNumberQ, b_ ? InexactNumberQ] := FixedPointList[{(#[[1]] + #[[2]]) / 2, Sqrt[#[[1]]#[[2]]]}&, {a, b}]agmIterations[1., 2.]Closed form of the iteration steps for calculating the arithmetic‐geometric mean expressed through ArithmeticGeometricMean:
ArithmeticGeometricMeanIteration[n_, a_, b_] := With[{z = EllipticNomeQ[1 - (b / a)^2]}, ArithmeticGeometricMean[a, b]{EllipticTheta[3, 0, z^2^n]^2, EllipticTheta[4, 0, z^2^n]^2}]Table[ArithmeticGeometricMeanIteration[n, 1., 2.], {n, 0, 4}]Show convergence speed using arbitrary‐precision arithmetic:
With[{a = N[1, 2000], b = N[2, 2000]}, Table[ArithmeticGeometricMeanIteration[n, a, b], {n, 0, 10}] - ArithmeticGeometricMean[a, b]]//SetPrecision[#, 3]&Compute a thousand digits of
:
With[{a = 1``1010, b = 1 / Sqrt[2], o = 9}, 2ArithmeticGeometricMeanIteration[o + 1, a, b][[1]] ^ 2 / (1 - Sum[2 ^ n ({1, -1}.(ArithmeticGeometricMeanIteration[n, a, b] ^ 2)), {n, 0, o}])]% - PiN[1 / ArithmeticGeometricMean[1, Sqrt[2]], 50]Compare to its expression in terms of beta function:
% == (1/2π)Beta[(1/4), (1/2)]Plot the absolute value in the parameter plane:
Plot3D[Abs[ArithmeticGeometricMean[a, b]], {a, -2, 2}, {b, -2, 2}]//QuietProperties & Relations (3)
Derivatives of ArithmeticGeometricMean:
D[ArithmeticGeometricMean[a, b], a]//SimplifyD[ArithmeticGeometricMean[a, b], b]//SimplifyUse FunctionExpand to expand ArithmeticGeometricMean to other functions:
FunctionExpand[ArithmeticGeometricMean[a, b], a > 0 && b > 0]Show that ArithmeticGeometricMean obeys a hypergeometric‐type differential equation:
w[a_] := ArithmeticGeometricMean[a, b]FullSimplify[2 a (b ^ 2 - a ^ 2) w'[a] ^ 2 + w[a] ((3 a ^ 2 - b ^ 2) w'[a] +
a (a ^ 2 - b ^ 2) w''[a]) - a w[a] ^ 2 == 0, a > 0 && b > 0]Proof that iterations lie between the arithmetic and the geometric means:
a[n_] := (a[n - 1] + b[n - 1]) / 2;b[n_] := Sqrt[a[n - 1] b[n - 1]];a[0] = a0;b[0] = b0;Reduce[ForAll[{a0, b0}, {a0, b0}∈ Reals && a0 > 0 && b0 > 0, (a0 + b0) / 2 >= a[3] >= b[3] >= Sqrt[a0 b0]]]See Also
Tech Notes
Related Guides
Related Links
History
Introduced in 1988 (1.0) | Updated in 2021 (13.0) ▪ 2022 (13.1)
Text
Wolfram Research (1988), ArithmeticGeometricMean, Wolfram Language function, https://reference.wolfram.com/language/ref/ArithmeticGeometricMean.html (updated 2022).
CMS
Wolfram Language. 1988. "ArithmeticGeometricMean." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/ArithmeticGeometricMean.html.
APA
Wolfram Language. (1988). ArithmeticGeometricMean. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ArithmeticGeometricMean.html
BibTeX
@misc{reference.wolfram_2026_arithmeticgeometricmean, author="Wolfram Research", title="{ArithmeticGeometricMean}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/ArithmeticGeometricMean.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_arithmeticgeometricmean, organization={Wolfram Research}, title={ArithmeticGeometricMean}, year={2022}, url={https://reference.wolfram.com/language/ref/ArithmeticGeometricMean.html}, note=[Accessed: 12-June-2026]}