Find $\lim\limits _{n\to \infty }a_n$ where $a_{n+1}=\frac{a_n+b_n}{2},\:b_{n+1}=\sqrt{a_n b_n}$

I showed that the limit exists and that $\lim\limits_{n\to \infty }a_n=\lim\limits_{n\to \infty }b_n$. My question is how to compute the limit assuming $a_1$ and $a_2$ are given positive numbers.

The Wiki page on arithmetic-geometric mean contains an explicit answer together with its derivation. The formula for the limit is rather nontrivial and involves complete elliptic integrals of the first kind. Namely, $$M(a_1,a_2)=\frac{\pi}{4}\frac{a_1+a_2}{K\left(\frac{a_1-a_2}{a_1+a_2}\right)}.$$
• Accordingly, Gauss proposed that recurrence as an efficient way to compute $K(z)$. – GEdgar May 3 '15 at 12:42