Gauss's hypergeometric formula for the AGM can also be interpreted in terms of a complete elliptic integral $\int_0^{\pi/2} \phantom. d\theta / \sqrt{a^2 \cos^2 \theta + b^2 \sin^2 \theta}$. There's a remarkable generalization to complete hyperelliptic integrals in genus 2 arising from a four-variable AGM: $$ (a,b,c,d) \mapsto \left( \frac14(a+b+c+d), \frac12\bigl(\sqrt{ab}+\sqrt{cd}\phantom.\bigr), \frac12\bigl(\sqrt{ac}+\sqrt{bd}\phantom.\bigr), \frac12\bigl(\sqrt{ad}+\sqrt{bc}\phantom.\bigr) \right) $$ (whose specialization $a=b$, $c=d$ recovers the usual AGM). One source available online is
Jarvis, Frazer: Higher genus arithmetic-geometric meansHigher genus arithmetic-geometric means, Ramanujan J. 17 (2008), 1–17.