Arithmetic-Geometric limit $\lim\limits_{n\to\infty} x_n = \lim\limits_{n\to\infty} y_n$ 
For $x,y>0$, define two sequences $(x_n)$ and $(y_n)$ by $x_1=x,y_1=y$ and $x_{n+1}=(x_n+y_n)/2$ and $y_{n+1}=\sqrt{x_ny_n}$. Prove that $\lim\limits_{n\to\infty} x_n = \lim\limits_{n\to\infty} y_n= \dfrac{\pi}{\int_0^\pi \dfrac{d\theta}{\sqrt{x^2 \cos^2\theta + y^2\sin^2\theta}}}.$

I think it might be easier to prove $\lim\limits_{n\to\infty} x_n = \lim\limits_{n\to\infty} y_n.$ Let the LHS of this equation be denoted $L$ and let the RHS be denoted $M$. By the AM-GM inequality and induction, $x_{n}\leq y_n$ for all $n\ge 2$. It could be useful to define a new sequence with a limit that's easier to evaluate. We have $L\leq M$ by limit properties, so we just need to show $L\ge M$ to get $L=M$. Suppose for a contradiction that $L < M.$ Then by definition, there exists $N$ so that for all $n\ge N, x_n < \frac{L+M}2$ and $y_n > \dfrac{L+M}2.$ How can I proceed from here?
As for showing it equals an expression involving a given integral, I think the integral is actually fairly hard to compute explicitly, so one should use some properties of the sequences to show the desired equality.
 A: Putting together (essentially) the proof from comments that the limits exist and are equal, by @AbhijeetVats and @DanielWainfleet:
If $x=y$, then $x_n=y_n=x=y$ for all $n$, so obviously the limits exist and are equal.
If $x \neq y$, then $y_2 < x_2$ by the AM-GM inequality. Also note $y_2 > 0$. Now prove by induction that for every $n \geq 2$,
$$ y_2 \leq y_n < y_{n+1} < x_{n+1} < x_n \leq x_2 $$
Since $x_n > y_n > 0$, $y_{n+1} = \sqrt{x_n y_n} > \sqrt{y_n y_n} = y_n$. Since $y_n \geq y_2$, this also shows $y_{n+1} > y_2$.
Since $y_n < x_n$, $x_{n+1} = \frac{x_n+y_n}{2} < \frac{x_n+x_n}{2} = x_n$.
And by the AM-GM inequality again, $y_{n+1} < x_{n+1}$. The induction proof is complete.
So $(x_n)$ is a strictly decreasing sequence bounded below by $y_2$, and therefore converges to a real value $L = \lim_{n \to \infty} x_n$. And $(y_n)$ is a strictly increasing sequence bounded above by $x_2$, and therefore converges to a real value $M = \lim_{n \to \infty} y_n$.
But then
$$ L = \lim_{n \to \infty} x_{n+1} = \lim_{n \to \infty} \frac{x_n+y_n}{2} = \frac{M+L}{2} $$
which implies that $L=M$:
$$ \lim_{n \to \infty} x_n = \lim_{n \to \infty} y_n$$
A: I will handle the integral at the end using the transformation given by Gauss. An alternative transformation is available on my blog (linked in comments to question).
Let us write $$I(x, y) =\int_0^{\pi/2}\frac{dt}{\sqrt{x^2\cos^2t+y^2\sin^2t}}\tag{1}$$ for $x, y>0$ and we prove $$I(x, y) =I\left(\frac{x+y} {2},\sqrt {xy} \right) \tag{2}$$ Gauss used the substitution $$\sin t=\frac{2x\sin u} {x+y+(x-y) \sin^2u}\tag{3}$$ to establish $(2)$. The substitution maps the interval $[0,\pi/2]$ to $[0,\pi/2]$.
Let us first observe that $$\cos t=\frac{\sqrt{(x+y)^2+(x-y)^2\sin^4u-2(x^2+y^2)\sin^2u}} {x+y+(x-y) \sin^2u} $$ which can be rewritten as $$\frac{\sqrt{4a^2+4(a^2-b^2)\sin^4u-4(2a^2-b^2)\sin^2u}} {x+y+(x-y) \sin^2u} $$ where $2a=x+y,b^2=xy$. The above can be further simplified as $$\cos t=\frac{2\cos u\sqrt{a^2\cos^2u+b^2\sin^2u}}{x+y+(x-y)\sin^2u}\tag{4}$$ Next we have $$x^2\cos^2t+y^2\sin^2t=\frac{4x^2\cos^2u(a^2\cos^2u+b^2\sin^2u)+4x^2y^2\sin^2u}{(x+y+(x-y)\sin^2u)^2}$$ which can be rewritten as $$\frac{x^2[(x+y)^2\cos^4u+4xy\sin^2u\cos^2u+4y^2\sin^2u]}{(x+y+(x-y)\sin^2u)^2} $$ Replacing $\cos^2u$ with $1-\sin^2u$ we get $$\sqrt{x^2\cos^2t+y^2\sin^2t}=\frac{x(x+y-(x-y)\sin^2u)}{x+y+(x-y)\sin^2u}\tag{5}$$ Differentiating equation $(3)$ with respect to $u$ we get $$\cos t\cdot \frac{dt}{du} =\frac{2x\cos u(x+y-(x-y) \sin^2u)} {(x+y+(x-y)\sin^2u)^2} \tag{6}$$ Using $(4),(5),(6)$ we get $$\int_{0}^{\pi/2}\frac{dt}{\sqrt{x^2\cos^2t+y^2\sin^2t}}=\int_{0}^{\pi/2}\frac{du}{\sqrt{a^2\cos^2u+b^2\sin^2u}} $$ or $I(x,y) =I(a,b) $.
Thus we get $I(x, y) =I(x_n, y_n) $ and taking limits as $n\to\infty$ we get $$I(x, y) =\lim_{n\to\infty} I(x_n, y_n) =I(\lim_{n\to\infty} x_n, \lim_{n\to\infty} y_n) =I(L, L) $$ We have used the fact that $I(x, y) $ is a continuous function of $x, y$ and that the sequences $x_n, y_n$ tend to a common limit, say $L$.
Now $I(L, L) =\pi/(2L)$ it follows that $$L=\frac{\pi} {2I(x,y)}=\dfrac{\pi}{\displaystyle \int_0^{\pi}\dfrac{dt}{\sqrt{x^2\cos^2t+y^2\sin^2t}}}$$
A: This limit is known as the arithmetic-geometric mean of $x$ and $y$, denoted by $AGM(x,y)$ and goes back to Lagrange. It is appears in the estimation of the  period of periodic solutions of the pendulum equation
$$\ddot{x}+ k\sin x=0$$
where elliptic integrals such as the one given in the OP appears.
Here is a summary of the convergence of the sequences in the OP and also the speed of converge.

*

*If $0\leq y_0=y_0$ then convergence is trivial and as the sequence is stationary: $x_n=x_0=y_n=x_0$


*If $y_0=0$ and $x_0>0$, then clearly $y_n=0$ for all $n$ and $x_n=2^{-n}x_0\xrightarrow{n\rightarrow\infty}0$.


*Without loss of generality, assume that $0<y_0<x_0$, for if $0<y_0x_0$ and $x_0\neq y_0$ then
$$y_1=\sqrt{x_0y_0}<\frac{x_0+y_0}{2}=x_1$$
By induction, given that $y_{n-1}<x_{n-1}$, we have that
\begin{align}
y_n&=\sqrt{x_{n-1}y_{n-1}}>y_{n-1}\\
x_n&=\frac{x_{n-1}+y_{n-1}}{2}<x_{n-1}\\
y_n&=\sqrt{x_{n-1}y_{n-1}}<\frac{x_{n-1}+y_{n-1}}{2}=x_n
\end{align}
Thus for some $y_0<y,x<x_0$, $y_n\nearrow y$ and $x_n\searrow x$ and so,
$$x=\frac{x+y}{2}$$
whence $x=y$. Finally, notice that
\begin{align}
x_n-y_n=\frac{x_{n-1}+y_{n-1}}{2}-\sqrt{x_{n-1}y_{n-1}}<\frac{x_{n-1}+y_{n-1}}{2}-y_n=\frac{x_{n-1}-y_{n-1}}{2}
\end{align}
whence it follows that
\begin{align}
AMG(x_0,y_0)-y_n&<\frac{x_0-y_0}{2^n}\\
x_n-AMG(x_0,y_0)&<\frac{x_0-y_0}{2^n}
\end{align}
This shows that the convergence to the limit $AMG(x_0,y_0)$ is actually quite fast. It is readily seen that
\begin{align}
AMG(rx,ry)&=r\,AMG(x,y), \qquad x,y,r\geq0\\
AMG(x,y)&= AMG\big(\frac{x+y}{2},\sqrt{xy}\big)
\end{align}
The integral expression of the limit $AMG(x_0,y_0)$ was obtained by Gauss (see this Wikipedia [article]((https://en.wikipedia.org/wiki/Arithmetic–geometric_mean) on his treatment of the Cayley elliptic integral
$$I(a, b):=\int^{\pi/2}_0\frac{d\theta}{\sqrt{a^2 \cos^2\theta + b^2\sin^2\theta}}$$
Gauss introduces the change of variables
\begin{align}
 \sin \theta ={\frac {2a\sin \theta'}{(a+b)+(a-b)\sin ^{2}\theta'}}
\end{align}
and obtains that
$$I(a, b)=I\big(\frac{a+b}{2},\sqrt{ab}\big)$$
$I$ is a continuous function on $(0,\infty)\times(0,\infty)$ and so
$$I(a, b)=I(a_n,b_n)$$
where $a_n=\frac{a_{n-1}+ b_{n-1}}{2}$ and $b_n=\sqrt{a_{n-1}b_{n-1}}$ and so,
$$I(a, b)=\lim_n I(a_n, b_n)=I(AMG(a, b), AMG(a, b))=\frac{\pi}{2}AMG(a, b)$$
A: 
Just showing that $x_1=x, y_1=y, x_{n+1}=\frac{x_n+y_n}{2}, y_{n+1}=\sqrt{x_ny_n}.$ Show that $\displaystyle \lim_{n\ \to \infty} x_n = \lim_{n \to \infty} y_n. $

let $x_n-y_n=d_n.$
Then, $d_n\geq 0$, because of AM-GM inequality.
$x_{n+1}=\frac{x_n+y_n}{2} \leq \frac{x_n+x_n}{2}=x_n.$
$y_{n+1}=\sqrt{x_ny_n} \geq \sqrt{y_ny_n}=y_n.$
$\therefore x_n-y_n \geq x_{n+1}-y_{n+1}.$
If $x_{n+1}=x_n$ and $y_{n+1}=y_n$, $x_n=y_n.$
That means that until $x_n-y_n \neq 0$, $x_n-y_n > x_{n+1}-y_{n+1}.$
Done. We got that $d_n$ is a bounded and decreasing function.
Therefore, we get $\displaystyle \lim_{n \to \infty} d_n=0.$
