Let us go for algorithms 1) 2) and 4)! I am going
to tempt to well structure the posting of the results because the web is not the
more convenient for the mathematical prooves!
Arithmeticogeometrical mean
let a and b two positive or nil reals. We define series (a_{n}) and (b_{n}) by :
I Convergence
Lemma 1 : (a_{n}) and (b_{n}) are convergent and of the same limit. Furthermore, (a_{n}) is decreasing and (b_{n}) is increasing. This limit is noted M(a,b) and called arithmeticogeometrical
mean of a and b. 
Proof
I.a) Let us prove that for n>0 and a#b,
 In fact, if a=b, one immediately obtains for every integer n that a_{n}=a=b_{n}
 If a=0 or b=0, one has (immediately again !) for every integer n b_{n}=0 and a_{n+1}=a_{n}/2 that well proves (1) and (2)
 If a>0 and b>0, a#b
I.a).(1) A small recurrence for (1) to begin well !
n=1 : a#b so by developping, so b_{1}<a_{1}, and by redoing the same, b_{2}<a_{2}.
Moreover, a_{2}=a_{1 }/2+b_{1} /2<a_{1} /2+a_{1} /2=a_{1} so a_{2}<a_{1} and b_{2}>(b_{1}^{2})^{1/2}=b_{1} so, finally, one has the result (1) at the rank 1
Let us suppose now that result (1) is true for k in [[1,n]]...
Since b_{n}<a_{n}, one has again (a_{n}b_{n})^{1/2}<(a_{n}+b_{n})/2 so b_{n+1}<a_{n+1} and a_{n+1}<2a_{n}/2=a_{n} and finally b_{n+1}>(b_{n}^{2})^{1/2}=b_{n}
So 0<b_{n}<b_{n+1}<a_{n+1}<a_{n}
This is realy the hypothesis at the following rank, so by the recurrence theorem,
the result (1) is correct for every integer n not nil...
I.a).(2) Pour tout n>0, on a :
That is well the result (2) !
I.b) Let us
show now that these series are convergent :
 If a=b one hase for every n a_{n}=b_{n} ans so (difficult !) a_{n}=a=b_{n}
 If b=0, a#0 one has fir every n>0 : b_{n}=0 and a_{n}=a_{n1 }/2=a_{0 }/2^{n} so a_{n}=b_{n}=0
 If a=0, a_{n}=0 and so b_{n}=0 for every n, that solves the problem of the limit !
 If a>0, b>0, a#b
_ According to I a) (1) (b_{n}) is increasing,
and (a_{n}) is decreasing
_ Moreover, according to I a) (2) and by an immediate recurrence, a_{n}b_{n}<(a_{1}b_{1})/2^{n1} so (a_{n}b_{n})=0, hullo !
Would not it be adjacent series ? Of course yes ! So they converge toward a same
limit that we will note M(a,b)
II Properties of the arithmeticogeometrical
mean AGM
II.a) M(a_{n},b_{n})=M(a,b)
II.b) M(a,b)=M(b,a)
II.c) M(ßa,ßb)=ßM(a,b) for every integer n, ß>0, a>0, b>0 
Proof
II.a) Given n_{0}>0
(a_{no+k})_{k} and (b_{no+k})_{k} got same limit that (a_{k})_{k} and (b_{k})_{k} so, M(a_{no},b_{no})=M(a,b)
II.b) Given (a'_{n}) and (b'_{n}) the series defined by (a_{n}) and (b_{n}), but with a'_{0}=b and b'_{0}=a
One has a'_{1}=a_{1} and b'_{1}=b_{1} so according to I. a) with n=1, one has M(a,b)=M(b,a)
II.c) Also, if one defines (a"_{n}) and (b"_{n}) by a"_{0}=ßa_{0} and b"_{0}=ßb_{0}, one has immediately for every n : a"_{n}=ßa_{n} and b"_{n}=ßb_{n}.
So, at the limit one has, M(ßa,ßb)=ßM(a,b)
III Function f(x)=M(1,x)
Here we are in the heart of the proof : for a=1 and b=x, the previous results (convergence...) allow us to build
a function f defined by :
For x positive or nil real,
f(x)=M(1,x)
The interesting results on this function are :
III.a) Lemma 2
f is
continuous on [0,+[ 
Proof
In the case a_{0}=a=1 and b_{0}=b=x, we will show that the uniform convergence of the series (a_{n}) and (b_{n}) on every compact of R^{+} toward the function f. To well differentiate this case of the previous study,
I will note respectively (U_{n}) and (V_{n}) these series of functions...
III.a).1) Let us show that for every integer n, U_{n} and V_{n} are continuous on R^{+}
By recurrence, for example !
n=0 : U_{0}(x)=1, V_{0}(x)=x, no comment !
Let us suppose the result until a certain integer n,
U_{n+1}=(U_{n}+V_{n})/2 and V_{n+1}=(U_{n}V_{n})^{1/2} so U_{n+1} and V_{n+1} are clearly continuous as composition of continuous functions...
The recurrence theorem is verified, U_{n} and V_{n} are continuous for every n on R^{+}.
III.a).2) Let us show the uniform convergence of U_{n} and V_{n} toward f on every compact of R^{+} :
 According to I.a).1). one has n0, b_{n}M(a,b)a_{n} so :
 xR^{+}, V_{n}(x)f(x)U_{n}(x) so :
0U_{n}(x)f(x)U_{n}(x)V_{n}(x)<(U_{n1}(x)V_{n1}(x))/2<1x.2^{n} for every xR^{+}
 Let us place on a compact [A,B] of R^{+}
nN*, 0U_{n}(x)f(x)(B+1)2^{n}
Also, 0f(x)V_{n}(x)U_{n}(x)V_{n}(x)<1x2^{n}(B+1).2^{n}
This upper bounding is uniform, so there is uniform
convergence of (U_{n}) and (V_{n}) toward the function f on every compact of R^{+}
So f is countinuous on [0,+[,
it's already a very important result !
III.b) Lemma 3
f is
increasing on [0,+[ 
Proof
III.b).1) Let us show by a recurrence (again!) on nN that (Un) and (Vn) are increasing on [0,+[
U_{0}=1 and V_{0}=x so one has the result for n=0
Let us suppose that the result is true for a certain nN
U_{n} and V_{n} being increasing, U_{n}+V_{n} and also(U_{n}V_{n})^{1/2} so U_{n+1} and V_{n+1} are also increasing and this is the hypothesis at the following
rank !
The result is true for every nN.
III.b).2). Given x_{1}0, x_{2}0 with x_{1}<x_{2}
Since there is uniform convergence of (U_{n}) towards f, one has f(x_{2})f(x_{1})=(U_{n}(x_{2})U_{n}(x_{1}))
now nN*, U_{n}(x_{2})U_{n}(x_{1})0 (growth of U_{n}), so f(x_{2})f(x_{1})0, that insure us of the growth of f on [0,+[,
and so, this is the end of the proof of lemma 3 !
III.c) Lemma 4 (Study at bounds...)
f admits
a vertical tangent in x=0
In 0, lim f =0
In +, lim f =+ , f(x)=o(x) 
Proof
III.c).1) one has x^{1/2}=V_{1}(x)f(x) xR^{+*},
so x^{1/2}f(x)/x and finally :
so f admit a vertical tangent in x=0.
If x=0,
for n1 U_{n}(x)=U_{n1}(x)/2=2^{n}, and V_{n}(x)=0 so f(0)=0
III.c).2) According to II.b) et II.c),
xR^{+*}, f(x)=M(1,x)=xM(1/x,1)=xM(1,1/x)=xf(1/x)
When x > + lim f(1/x)=f(0)=0 because f is continuous in 0
so f(x)/x>0 and in +, f(x)=o(x)
Moreover xR^{+*}, f(x)x^{1/2}, so in +, lim
f=+
III.d) Theorem 5
f is C class on ]0,+[ 
This result is very strong (almost too, since we will only need of the character C^{1}!) is not simple to proove. It will even drive us to the theory of
elliptic integrals !
So, we will successively :
III.d).1) Express M(a,b) by an elliptic integral I(a,b)
III.d).2) Apply this result to function f
III.d).3) Use the character C of I(1,x) to deduct the one of f !
Proof
III.d).1) We will take an interest in the following integral,
Given a,b>0, let pose :
III.d).1).i) Convergence
Given and m(0)=1/(ab), now m being of course continuous on R^{+}, m is integrable on R^{+} and so I(a,b) is well defined...
III.d).1).ii) Change of variable
Let us pose
this is a increasing bijection so let us do a little change of variable... Let us
pose t=b.tan(y), one obtains :
III.d).1).iii) function g
One defines the function g by g(x)=I(1,x)
Let us show that it is C class on ]0,+[
Given h(x,y)= with (x,y)]0,+[*[0,/2]
Let us show by a recurrence on nN (allways !) that exists ans is continuous on ]0,+[*[0,/2]
In this way, let us show in the same time, allways by recurrence, that with the hypothesis
on parameters :
(x,y)= where x >
P_{n}(x,y)R_{n}[x]
 n=0,
this is the definition of h !
h is clearly continuous on ]0,+[*[0,/2] and admit a partial derivative in x
 n=1 :
This is truly the foretelled form for n=1 and this is perfectly continuous on ]0,+[*[0,/2]
 Let us suppose now the result for a certain nN
that is truly the waited result with P_{n+1} of the wanted form... P_{n+1} is a polynomial in x and a trigonometrical polynomial in y and is so therefore
continuous on ]0,+[*[0,/2] and derivable
in x.
As for the denominator, the hypothesis of recurrence is verified at rank n+1, that concludes
the recurrence !
h is C on ]0,+[*[0,/2]
Since we are on the segment [0,/2] for y,
the function g defined by :
g(x)=h(x,y)dy
is C on R^{+*} and one
has :
g^{(n)}(x)=(x,y)dy
x > I(1,x) is a C function on R^{+*}
Now we have to express M(a,b) in function of I(a,b)
This is, of course, the main result of this study and it was obtained by Gauss (he did not go farer !).
III.d).1).iv) First of all let us show that :
=I (a,b)
In that way, let us pose j(t)= defied on R^{+*} and that is clearly a bijection from R^{+*} to R ( j'(t)=>0 ) so, in I(1,t) defined at 1), one poses s= and one obtains :
and on the other hand, ds=dt, so one obtain finally :
The last but one equality being obtained thank
to the parity of the term under the integral
III.d).1).v) So, let us show now that
One has clearly I(ßa,ßb)=I(a,b)/ß so :
now a_{n}=M(a,b) and one has a_{n}/b_{n}=1.
Moreover, g is continuous on R^{+* }according to iii) so :
that allow us to conclude :
III.d).2) by applying this result to the function f, one obtains
III.d).3) And the proof of the theorem 5 is finished, g being C on R^{+*}, f also on the same interval
Small note : f is continuous in 0 but is not differentiable in 0 according to lemma 4...
III.e) Asymptotic attitude of f
We will search for equivalent of f at the bounds of R^{+} thank to equivalents of g
Lemma 6
Proof
III.e).1) A new expression of g !
Let us pose haphazardly (!) s=x/t :
III.e).2) Let us find now an equivalent of
g in the neighbourhood of 0
t[0,x^{1/2}], one has 11+t^{2}1+x, so
so according to III.d).2) one has :
the second equivalence being coarsly obtained thank to III.c).2) (f(x)=x.f(1/x))
IV Expression of Pi in function of f and f'
We will show that =
In that way, we restrain U_{n} and V_{n} to ]0,1[ and we introducet W_{n} and k_{n}, function defined on ]0,1[ by :
W_{n}= and k_{n}=
These functions are obviously well defined and
positive because according to III a)2) 0<V_{n}(x)<U_{n}(x) on ]0,1[
IV.a) Convergence of (k_{n})_{n}
IV.a).1) Properties
2M(Un+1,Wn+1)=M(Un,Wn)

Proof
Let us pose a=U_{n}+V_{n}=a_{0}, b=U_{n}V_{n}=b_{0} as at I, one has
IV.a).2) Convergence
Proof
Proof
so according to the asymptotic study of III e), one obtains :
according to the previous property, that allow us to conlude :
strong !
IV.b) Convergence of (k'_{n})_{n}
Let us be interested in the derivative series of functions (k'_{n})_{n}.
In fact, f' appears in the final searched expression , so there is great chances
that we speack of derivatives series at a moment... so that is become clear :
IV.b).1) Existence et positivity
nN, U_{n}, V_{n}, W_{n}, k_{n} are continuously derivable
Moreover, x]0,1[, nN*, U'_{n}>0,
V'_{n}>0 
As for the continuity of U_{n} and V_{n}, we do a recurrence on n to prove that. So let us be brief !
U_{1} and V_{1} obviously verify the property and if we suppose that the property
is true for a certain rank n, a small calculus according to the definition of U_{n} and V_{n} gives us
that insure the existence, the continuity and the positivity at rank n+1... Hop,
this is finished, needless to waste time on such recurrences !
W_{n} and k_{n} being composition of continuously derivable functions, they are
also for every n...
IV.b).2) Expression of (k'_{n})
Proof :
according to IV a)1) so
now V_{n}^{2}=U_{n}^{2}W_{n}^{2} and if we derive, 2V_{n}V_{n}'=2U_{n}U_{n}'2W_{n}W_{n}' so :
and one finally obtains :
IV.b).3) Convergence
(k'_{n}) uniformly converges on every compact of ]0,1[ towards : x> 
Proof
Let us set on [a,b] compact of ]0,1[, 0<a<b<1
nN, x[a,b], one has :
by using III.a).2)...
This upper bounding involves the uniform convergence of (k'_{n})_{n} towards
x > on every compact of ]0,1[
IV.c) Expression of Pi
Here we are, finally !
IV.c).1) Dérivative
x > is the derivative of x > 
Proof
 nN, k_{n} is C^{1} class on ]0,1[ according to IV b)1)
 the series of function (k_{n})simply converges on ]0,1[ towards the function
x> according to IV a)2)
 The series of functions (k'_{n}) uniformly
converges on every compact of ]0,1[ towards x >
So by applying the theorem of derivation of the
series of functions,
x> is the derivative on ]0,1[ of x >
IV.c).2) Différential equations
f verifies
the differential equation :
x]0,1[,

Proof
Easy ! We simply have to derive x > and to use the previous result a).
I do not do that, that is only calculus !
IV.c).3) Expression of Pi
The quest of the mathematical Holy Graal would go to his end ? Anyway, we touch here
the most important result of the proof !
= 
Reference from the Encyclopedia of Integer
Sequences about M(1,sqrt(2)) : A003054
Proof
Easy again ! We just have to pose x= in the diiferential equation. As previously, that is only
calculus. I will not overload this page with useless expressions.
That is a great result !
And it will be the fundation of many very efficient algorithms with a quadratic convergence
V Applications
Serious things now !
Many uses on this formula are possible :
V.a) Direct use of derivative series
The first thing of that we think is to use the derivative series (U'_{n}) and (V'_{n}) converge towards f' (the proof of this convergence is given at V.b) ). One
obtains replacing f and f' by U_{n} and V_{n} of different ways the following algorithm :
Even if it seems more complicated than the algorithms
of Borwein or Brent/Salamin, I was amazed to not find it anywhere
! But in my concern of exhaustiveness, I could not miss to notice it.
V.b) Algorithm of J. and P. BORWEIN (1987)
This algorithm was published in Pi and the AGM. I will give the detailed proof
and by estimating the efficiencecy... It is given under the form :
Proof
We will set us during all the proof on a compact K of ]0,1[
With the notations of the previous parts, let us pose for n1 :
V.b).1) Convergence
Let us show that :
y_{n}1, z_{n}1, nN*
(y_{n}) and (z_{n}) uniformly converge towards 1 on K

Proof
* According to III.a).2). and the definition of y_{n} and z_{n}, U_{n}V_{n}, so y_{n}1
* nN, x]0,1[
according to III.a).2). and V_{n}(x)>V_{0}(x)=x.
On K,
one has x>1/x1 is bounded (continuous on a compact) by a certain MR^{+*}^{,} so
xK, y_{n}(x)1<M.2^{n}
by this way, (y_{n}) uniformly converges towards 1 on K
* Let us show by a recurrence on nN* that z_{n}1
n=1 : z_{1}=x^{1/2}>1 on ]0,1[
Let us suppose the result for a certain nN*
that show us the relations of recurrence for (y_{n}) and (z_{n}) !
so
because z_{n}1 by the hypothesis of recurrence and y_{n}1 according to previously,
in consequence this ends the recurrence...
For n1, z_{n+1}y_{n+1} is of the sign of :
2(1+y_{n}z_{n})(1+z_{n})(1+y_{n})=1+y_{n}z_{n}z_{n}y_{n}=(z_{n}1)(y_{n}1)0
so
z_{n+1}y_{n+1}
z_{n+1}y_{n}^{1/2} is also af the sign of :
1+y_{n}z_{n}y_{n}(1+z_{n})=1y_{n}0
now y_{n}1 so y_{n}^{1/2}y_{n} and finally :
y_{n+1}z_{n+1}y_{n}^{1/2}y_{n}
so 0<y_{n+1}1<z_{n+1}1<y_{n}1 and :
Sup_{K}(z_{n+1}(x)1)Sup_{K}(y_{n}(x)1)
The uniform convergence of (y_{n}) towards 1 on K insures, by this way, the uniform convergence of (z_{n}) towards 1 on K...
V.b).2) Let us show now that (U'_{n}) and (V'_{n}) uniformly converge on K. This is certainly the hardiest to obtain, but it works
and it is the main thing !!
Given x]0,1[, nN*,
z_{n}1, so U'_{n}V'_{n} and as U'_{n+1}=(U'_{n}+V'_{n})/2 one has U'_{n+1}U'_{n}
so (U'_{n}) is increasing
V'_{n+1}(x)V'_{n}(x)= so te sign of V'_{n+1}(x)V'_{n}(x) is the one of :
.
By dividing by U'_{n}(x)V'_{n}(x)>0 one obtains :
now, according to a), y_{n}^{1/2}1y_{n}1z_{n}1, and (z_{n}) uniformly converge towards 1 on K so at a certain rank n_{0}, for nn_{0},
xK, 0<z_{n}(x)1<1/2, so :
because z_{n}(x)2
so for nn_{0} and xK, V'_{n+1}(x)V'_{n}(x) and finally :
U'_{n}(x)U'_{n+1}(x)V'_{n+1}(x)V'_{n}(x)
This being, given ß>0
(z_{n}) uniformly converges towards 1 on K, so it exists n_{1}N such that :
nn_{1} => 0sup_{K}(z_{n}(x)1)<ß*V_{no}(x)^{1}
now
with nMax(n_{0},n_{1}) and since (V'_{n}) is decreasing according to above (eh yes!), one has for nMax(n_{0},n_{1}) V'_{n}(x)V'_{no}(x), so :
0V'_{n}(x)U'_{n}(x)<ßV'_{no}(x)V'_{no}(x)^{1}=ß
x]0,1[, (U'_{n}(x) and (V'_{n}(x)) are adjacent series and converge towards the same limit that we
will note µ(x).
So one has :
x]0,1[, 0U'_{n}(x)U'_{n+1}(x)µ(x)V'_{n+1}(x)V'_{n}(x)
For nMax(n_{0},n_{1}) one has :
x]0,1[, 0µ(x)U'_{n}(x)V'_{n}(x)µ(x)ß
So the series (U'_{n}) and (V'_{n}) uniformly converge on K towards µ(x)
V.b).3) Let us build the series (f_{n})
(finally !)
(U_{n}) uniformly converges (so simply) on K towards f and (U'_{n}) uniformly converges on K so his limit is f' on ]0,1[
Let us pose
One has :
then
that concludes the proof. Ah ! what a beautiful result !