I'm trying to solve the simultaneous convergent sequences of geometric/arithmetic means where $a_{n+1}=\frac{1}{2}(a_n+b_n)$ and $b_{n+1}=\sqrt{a_nb_n}$ and initial values are $a_0=1+x$ and $b_0=1-x$. I've tried an implementation using RSolve[]
as follows but Mathematica just spits my input back at me without raising an error. Can someone point me in the right direction?
RSolve[{a[n + 1] == 1/2 (a[n] + b[n]), b[n + 1] == Sqrt[a[n] b[n]],
a[0] == 1 + x, b[0] == 1 - x}, {a, b}, n]
EDIT/UPDATE: I have taken Sasha's advice and implemented ArithmeticGeometricMean[]
. The solution $M(x)$ matches the iterative solution obtained from the last element of the following recurrence table.
RecurrenceTable[{a[n + 1] == 1/2 (a[n] + b[n]),b[n + 1] == Sqrt[a[n] b[n]], a[0] == 1 + x, b[0] == 1 - x}, {a,b}, {n, 1, 10}]
That is, the coefficients of the series expansion for the approximate iterative solution match those for the series expansion of the ArithmeticGeometricMean[]
function up to order 10 at least. Further, and for completeness, the series expansion of $\frac{1}{M(x)}$ also matches that of the following integral, which is actually what I was ultimately after.
$$\frac{1}{\pi}\int_0^\pi\frac{d\phi}{\sqrt{1-x^2\cos^2(\phi)}}$$
Thanks everyone for the help! I'm closing the question now.
x
from the initial conditions might coax it, but doing so still only returns the input on my system. $\endgroup$Sqrt
and the product ofa[n] b[n]
) from the geometric mean equation it evaluates, even with thex
in the initial conditions. However, I wouldn't expectRSolve
to be incapable of handling these relationships when the documentation gives examples of it solving linear fractional systems under "Scope->Systems of Difference Equations." $\endgroup$