Arithmetic-Geometric Mean of Gauss

8 comments

Prelude

Contrary to the popular belief that mathematics is the most dreaded subject, many people in their younger years are struck by many mathematical curiosities. Some of them use these curiosities as puzzles for friends, others try to find the reason behind it and are satisfied once they find the reason. But the great heroes of mathematics are those who, being intrigued by a mathematical curiosity, develop the idea in a systematic manner and connect it to other ideas of existing mathematical knowledge.

The following examples will illustrate my point clearly
1) 987654321123456789=864197532: Here the same digits appear after subtraction and people generally pose it as a puzzle: Subtract 45 from 45 and get 45. Here the sum of digits is 45.

2) Divisibility rule for 7: Split the number in blocks of 3 digits starting from least significant digit. If the difference between sum of even numbered blocks and the sum of odd numbered blocks is divisible by 7 then the number is divisible by 7. The reason behind the rule is that 103+1=1001 is divisible by 7 and since 1001 is also divisible by 13 the rule applies to 13 as well.

3) Process of square root extraction by long division: The method seems quite weird and strange when presented to students at the age of 12-13 yrs. I scratched my head sometime during my 15th year and found the reason why it works. The method is based on the following simple formula (again studied at 12 yrs of age) (x+h)2=x2+2xh+h2=x2+h(2x+h) which allows us to write (10 is being used because the long division method of square root is used for decimal numbers) (10x+h)2a=0(210x+h)h=a(10x)2 Here a is the number whose square root we need, x is the the number formed by removing least significant digit from the square root and h is the least significant digit of the square root. This is a special case (and easy) of Horner's method of finding numerical roots of polynomial equations where we find the root digit by digit.

Introduction

After this prelude we now come to our topic of this post. For the first time I studied the concept of Arithmetic-Geometric mean in an exercise problem on sequences in some average quality book on infinite series when I was in 11th grade (i.e. it was presented just as a curious mathematical problem with no special significance other than being related to the arithmetic and geometric mean).

To begin our journey let's start with two positive real numbers a and b and define two sequences {an} and {bn} as follows a0=a,b0=ban+1=an+bn2bn+1=anbn Thus we start with a0=a and b0=b and find their arithmetic mean as a1 and their geometric mean as b1. The process is then repeated to get a2 and b2 from a1 and b1. This process generates the sequences {an} and {bn}. The exercise problem in my book was to prove that these two sequences converge to the same limit as n.

The solution to the problem is not that complicated. In the trivial case when a=b it is clear that both sequences are constant and hence their common limit is a=b. Assuming then that a>b (if not so, by AM > GM inequality we will always have a1>b1) we can easily see that sequence {an} is strictly decreasing and bounded below by b and sequence {bn} is strictly increasing and bounded above by a. Therefore both the sequences tend to limits say, A and B. Since we have an+1=an+bn2 it is clear that A=(A+B)/2 and so A=B. It is also interesting to see that an+1bn+1=(anbn)22 which leads to an+1bn+1=(anbn)22(an+bn)2 Finally we get an+1bn+1(anbn)28b since all an and bn are greater than or equal to b. Applying this recursively we get an+pbn+p(anbn)2p(8b)p Since both sequences tend to the same limit there will be a value of n such that |anbn|<1,|(anbn)/(8b)|<1 and then the above equation shows that the termwise difference between the sequences will converge very fast to 0. In fact the convergence will be quadratic meaning that in each iteration the number of agreeing decimal digits in an and bn will double.

The common limit of these two sequences {an} and {bn} is called the Arithmetic-Geometric Mean of a and b and is denoted by M(a,b). We shall use the abbreviation AGM for Arithmetic-Geometric Mean in what follows. I played around with this concept of AGM using my calculator and found that usually for numbers in the range of 1010 the AGM was found in less than 10 iterations. Further iterations were giving the same result due to limitation of 10 decimal digits of calculator. For me the journey of AGM was finished here and I remembered it just as a very peculiar mathematical curiosity.

Gauss on AGM

From here Gauss takes on the stage. He calculated the AGM of 1 and 2 upto 11 places of decimals and found that it agreed with ratio of π and a certain number ω. This number ω is related to the following elliptic integral ω=210dx1x4 which is involved in the calculation of arc-length of a curve called lemniscate given by the equation (x2+y2)2=x2y2 and by the way, π is given by the following integral: π=210dx1x2 Such was the genius and intuition of Gauss that he recognized that such an agreement up to 11 places of decimals between two numbers arising out of entirely different contexts could not be a mere coincidence. I am still struck by awe as to how Gauss could think of such a thing. Seeing numerical equality up to a certain places of decimals between two numbers in the vast uncountable sea of reals and interpreting it as a true equality is an unparalleled feat of genius. Gauss mentioned in his diary that this connection would open up new fields of study in mathematical analysis. Gauss' prediction came true (with contributions from himself, Abel and Jacobi) creating the theory of elliptic functions and integrals.

AGM and Elliptic Integrals

Gauss proceeded to prove that these two numbers were in fact equal. In other words he established the following identity 10dx1x4=π2M(1,2) To do so he first started a systematic study of AGM and its properties. From the definition it is immediately obvious that the following hold true
a) M(a,a)=a
b) M(a,b)=M(b,a)
c) M(a,b)=M(a0,b0)=M(a1,b1)==M(an,bn), in particular we have M(a,b)=M(a+b2,ab) d) M(ka,kb)=kM(a,b)
Note that we can invert c) and write
e) M(a,b)=M(a+a2b2,aa2b2)

First Proof: Stage 1

Gauss begins his analysis starting from the function M(1+x,1x) for 0x<1. In the following we are going to use the properties of AGM mentioned above M(1+x,1x)=(1+x)M(1,1x1+x) (using (d)). Noting that 1(1x1+x)2=4x(1+x)2 we get using (e) M(1+x,1x)=(1+x)M(1+2x1+x,12x1+x) Taking reciprocals we get 1M(1+x,1x)=(11+x)(1M(1+2x1+x,12x1+x))

First Proof: Stage 2

Now Gauss uses a very powerful technique of power series expansion. Since 1/M(1+x,1x) is an even function of x (i.e. its value does not change by changing the sign of x) therefore it can be expressed as a power series of x consisting of only even powers of x.

Thus we assume along with Gauss that 1M(1+x,1x)=1+p1x2+p2x4++pnx2n+ where coefficients p1,p2,,pn, are to be determined. The initial coefficient 1 comes from the fact that for x=0 we get M(1,1)=1.

On using this power series we get 1+p1x2+p2x4++pnx2n+=11+x+22p1x(1+x)3+24p2x2(1+x)5++22npnxn(1+x)2n+1+ Equating coefficients of various powers of x one can get the values of pn for all n. By hand calculation it can be checked that p1=14=(12)2p2=964=(38)2p3=25256=(516)2p4=122516384=(35128)2 and it seems that all pn are fractions and perfect squares at that, but there is no pattern. Gauss finds the pattern by taking successive ratios of the coefficients pn as follows p2p1=(34)2p3p2=(56)2p4p3=(78)2 so that we have finally pnpn1=(2n12n)2 and therefore pn=(135(2n1)2462n)2 Gauss does not stop here and he justifies this pattern by actually doing algebraic manipulations while equating coefficients of both power series (these computations are quite time consuming and need patience therefore omitted from this discussion). Thus Gauss finally arrives at the following result 1M(1+x,1x)=n=0(135(2n1)2462n)2x2n (where the first term in the series on right is 1 corresponding to n=0).

First Proof: Stage 3

The other development about the ω integral is simple. Gauss starts with the famous elliptic itntegral (they were already being studied by Legendre) K(x) defined by K(x)=π/20dθ1x2sin2θ and expands the integrand in a power series using binomial theorem to get K(x)=n=0135(2n1)2nn!x2nπ/20sin2nθdθ Now the integral for powers of sines and cosines is easily evaluated using the following formula π/20sin2nθdθ=2n12nπ/20sin2n2θdθ Repeated application of this formula gives us π/20sin2nθdθ=135(2n1)2462nπ/20dθ=135(2n1)2462nπ2 Thus we get K(x)=π2n=0(135(2n1)2462n)2x2n

First Proof: Finally Putting Pieces Together

The connection between AGM and elliptic integral is now put in place K(x)=π2M(1+x,1x) Noting that M(1+x,1x)=M(1,1x2) we get K(x)=π2M(1,1x2) Putting y=1x2 we get π2M(1,y)=K(1y2)=π/20dθ1(1y2)sin2θ Putting y=2 and x=sinθ in the integral we get 10dx1x4=π2M(1,2) In our analysis we neglected the issue of convergence of various power series involved. However it can be shown easily that they converge for |x|<1. Also under these conditions we have |y|<1 and therefore setting y=2 is not allowed. However, the formula connecting the elliptic integral and the AGM holds for all values of the variables involved. The restrictions on them were needed because of the particular power series approach used in the proof.

Interlude

Great mathematical ideas often spring from simple concepts and their greatness lies in the way they get connected to other prevailing ideas and concepts of mathematics. However it is also true that establishing a connection between otherwise disconnected ideas almost always requires a genius. Even the first step of recognizing a probable connection requires great intuition, but this is possible for many people if they are observant enough. The really hard part is trying to establish the connection using a mathematical proof.

Gauss' Second Proof

Gauss developed his theory of elliptic integrals further and proved the famous integral formula which shows the connection with AGM even more explicitly. He proved that the integral π/20dθa2cos2θ+b2sin2θ is invariant under the Arithmetic-Geometric transformation given by aa+b2,bab and therefore the integral is easily evaluated using AGM as follows π/20dθa2cos2θ+b2sin2θ=π2M(a,b) Gauss was such an algebraist that he proved the invariance of the integral directly using just one substitution sinθ=2asinϕa+b+(ab)sin2ϕ This substitution involves heavy algrebraical manipulation to change the integrand in terms of ϕ and calulating the derivative dθ/dϕ. It is not clear as to how Gauss found this substitution formula. Later authors simplified the substitution into two parts. First a substitution t=btanθ reduces the integral to I(a,b)=12dt(t2+a2)(t2+b2) Setting c=(a+b)/2 and d=ab and using the substitution t=(xab/x)/2 one gets t2+c2=(x2ab)24x2+(a+b)24=x42abx2+a2b2+(a2+b2)x2+2abx24x2=x4+(a2+b2)x2+a2b24x2=(x2+a2)(x2+b2)4x2 and t2+d2=(x2ab)24x2+(ab)2=x42abx2+a2b2+4abx24x2=x4+2abx2+a2b24x2=(x2+ab)24x2 and dt=x2+ab2x2dx so that we get (also note that the substitution from t to x maps the interval (,) to interval (0,)) I(c,d)=12dt(t2+c2)(t2+d2)=1204x2(x2+a2)(x2+b2)1x2+abx2+ab2x2dx=0dx(x2+a2)(x2+b2)=12dx(x2+a2)(x2+b2)=I(a,b) Thus the invariance of the integral under the Arithmetic-Geomteric transformation is established. Using this invariance it is easy to prove the identity we started with namely 10dx1x4=π2M(1,2) The integral on the left after applying substitution x=cosθ becomes π/20dθ1+cos2θ and using 1=cos2θ+sin2θ we get π/20dθ1+cos2θ=π/20dθ2cos2θ+sin2θ=π2M(1,2)

What Next

In the next post we will study the Richard P. Brent's (discovered by Eugene Salamin at same time during 1976) famous formula for calculating π using AGM. Needless to say that this formula being based on AGM converges very rapidly and is very suitable for computer based calculation.

Print/PDF Version

8 comments :: Arithmetic-Geometric Mean of Gauss

Post a Comment

  1. In the last stage of the first proof we established that

    K(x)=π2M(1+x,1x)

    Also comparing this with the identity established in stage 1 of first proof

    1M(1+x,1x)=(11+x)(1M(1+2x1+x,12x1+x))

    we get

    K(x)=(11+x)K(2x1+x)

    This identity is called Landen’s transformation and can be proved directly (with some heavy algebraical manipulation) using the substitution

    xsinθ=sin(2ϕθ)

    in the integral defining K(x)

    K(x)=π/20dx1x2sin2θ

  2. Paramanand,
    Thank you for your clear comments on this subject, the best I've found after quite a lot of searching on the web. I am working to get a better understanding of the AGM<>elliptic integral connection, and am finding it hard going. I've gotten stuck at least 10 times on various dead ends, but with your blog I did make some progress. At the moment, however,, I'm stuck in 2 places. I don't see how you calculate the polynominal coefs in the 2nd part of gauss's 1st proof, and I can't figure out how the "t=b*sin(theta)" results in the transformed integral below it. I also tried gauss' original substitution and got completely lost on that one.
    I've ordered a couple of the books you recommended, maybe that will help. However, maybe I'm just missing some obvious (to you) techniques to get past the current stuck places.

    Thanks for your blog, --Glenn Keller

  3. @Glenn Keller
    Thanks for reading this post. The calculation of p1,p2, is difficult and Gauss did considerable algebraic manipulation to calculate pn in general. But finding first few coefficients is easy. For example the coefficient of x on LHS is 0. On RHS we have the coefficient of x as 1+4p1. This leads to 4p11=0 so that p1=1/4.

    Again for p2 we note that coefficient of x2 on LHS is p1. On RHS the coefficient of x2 is 112p1+16p2 so we get 16p22=1/4 or p2=9/64. Note that the calculation of coefficient of powers of x on RHS requires the use of binomial theorem to handle (1+x)2n+1 in the denominator.

    Regarding your second point about the substitution t=btanθ, we can see that dt=bsec2θdθ. And we have dθa2cos2θ+b2sin2θ=secθdθa2+b2tan2θ=bsec2θdθ(a2+b2tan2θ)(b2sec2θ)=bsec2θdθ(a2+b2tan2θ)(b2+b2tan2θ)=dt(a2+t2)(b2+t2) In the above substitution the interval of integration changes to [0,) for t corresponding to [0,π/2] for θ. Since the function of t is even we can change the interval to (,) and add a factor of 1/2.

    Regards,
    Paramanand

  4. Hello, Paramanand,
    Thanks for your help. I now understand the t=b*tan(theta) substitution completely, and will follow that further later. Next I need to go back and understand the binomial theorem again. It has been quite a while, but I can do that piece on my own.

    Thanks again, --Glenn Keller

  5. Hello, Paramanand,
    I was able to get through everything on this page now, thanks. With the binominal multiplying it was not too bad once I got a pattern going, although I had to be very careful about sign mistakes when getting up around (1+x)^13.

    It bothered me about the y=sqrt(2) not in the series convergence area. It took a long time to think of another way, but I think if you choose x=cos(theta) and y=1/sqrt(2) instead, you can get to the same place using:
    M(1,sqrt(2)) = M(sqrt(2),1) = M(1,1/sqrt(2)) * sqrt(2).

    I was confused by the b*tan(theta) proof final conclusion, but when I read something in Borwein's "PI & the AGM" book the penny dropped. I didn't realize that the invariance under the AGM transformation proved this. However, it is obvious now, and probably was to you all along:
    M(a,b)= M( M(a,b),M(a,b) ) == q.
    Substituting q for a & b into the eqn with the "a^2*cos^2" gives the result desired. Such a wonderfully simple proof, or so it seems now.

    Looks like it is going to take a bit to get through the 2nd kind ellipticals. The end result of the pi calc works pretty beautifully, it will take a while to understand the path to that reasonably.

    Best Regards, --Glenn Keller


  6. @Glenn Keller,
    I am glad that you took some effort to understand the calculations done in this post, especially going till (1+x)13. Given the effort you put, I think you will not have a serious difficulty in dealing with the elliptic integrals of second kind (especially the second proof is much easier to handle compared to the first proof for formula of elliptic integrals of second kind).

    Regards,
    Paramanand

  7. It'll awesome if you could show how Gauss worked out the power series. I've read quite a few papers on this area, and most authors skip that part.

  8. @Anonymous,
    If you read the comments you will find how one can compute the coefficients for the series of 1/M(1x,1+x) by hand calculation. But to calculate the general term pn you need to read the paper "Gauss, recurrence relations, and the agM" by Stacy G. Langton. Unfortunately this paper does not appear to available online for free now. It was available when I wrote this post, but I am unable to find that copy right now.

    Regards,
    Paramanand