Pi and the Golden Ratio

Two of my favorite numbers are pi:

\pi = 3.14159...

and the golden ratio:

\displaystyle{ \Phi = \frac{\sqrt{5} + 1}{2} } = 1.6180339...

They’re related:

\pi = \frac{5}{\Phi} \cdot \frac{2}{\sqrt{2 + \sqrt{2 + \Phi}}} \cdot \frac{2}{\sqrt{2 + \sqrt{2 + \sqrt{2 + \Phi}}}}  \cdot \frac{2}{\sqrt{2 + \sqrt{2 + \sqrt{2 + \sqrt{2 + \Phi}}}}} \cdots

Greg Egan and I came up with this formula last weekend. It’s probably not new, and it certainly wouldn’t surprise experts, but it’s still fun coming up with a formula like this. Let me explain how we did it.

History has a fractal texture. It’s not exactly self-similar, but the closer you look at any incident, the more fine-grained detail you see. The simplified stories we learn about the history of math and physics in school are like blurry pictures of the Mandelbrot set. You can see the overall shape, but the really exciting stuff is hidden.

François Viète is a French mathematician who doesn’t show up in those simplified stories. He studied law at Poitiers, graduating in 1559. He began his career as an attorney at a quite high level, with cases involving the widow of King Francis I of France and also Mary, Queen of Scots. But his true interest was always mathematics. A friend said he could think about a single question for up to three days, his elbow on the desk, feeding himself without changing position.

Nonetheless, he was highly successful in law. By 1590 he was working for King Henry IV. The king admired his mathematical talents, and Viète soon confirmed his worth by cracking a Spanish cipher, thus allowing the French to read all the Spanish communications they were able to obtain.

In 1591, François Viète came out with an important book, introducing what is called the new algebra: a symbolic method for dealing with polynomial equations. This deserves to be much better known; it was very familiar to Descartes and others, and it was an important precursor to our modern notation and methods. For example, he emphasized care with the use of variables, and advocated denoting known quantities by consonants and unknown quantities by vowels. (Later people switched to using letters near the beginning of the alphabet for known quantities and letters near the end like x,y,z for unknowns.)

In 1593 he came out with another book, Variorum De Rebus Mathematicis Responsorum, Liber VIII. Among other things, it includes a formula for pi. In modernized notation, it looks like this:

\displaystyle{ \frac2\pi = \frac{\sqrt 2}2 \cdot \frac{\sqrt{2+\sqrt 2}}2 \cdot \frac{\sqrt{2+\sqrt{2+\sqrt 2}}}{2} \cdots}

This is remarkable! First of all, it looks cool. Second, it’s the earliest known example of an infinite product in mathematics. Third, it’s the earliest known formula for the exact value of pi. In fact, it seems to be the earliest formula representing a number as the result of an infinite process rather than of a finite calculation! So, Viète’s formula has been called the beginning of analysis. In his article “The life of pi”, Jonathan Borwein went even further and called Viète’s formula “the dawn of modern mathematics”.

How did Viète come up with his formula? I haven’t read his book, but the idea seems fairly clear. The area of the unit circle is pi. So, you can approximate pi better and better by computing the area of a square inscribed in this circle, and then an octagon, and then a 16-gon, and so on:

If you compute these areas in a clever way, you get this series of numbers:

\begin{array}{ccl} A_4 &=& 2 \\  \\ A_8 &=& 2 \cdot \frac{2}{\sqrt{2}} \\  \\ A_{16} &=& 2 \cdot \frac{2}{\sqrt{2}} \cdot \frac{2}{\sqrt{2 + \sqrt{2}}}  \\  \\ A_{32} &=& 2 \cdot \frac{2}{\sqrt{2}} \cdot \frac{2}{\sqrt{2 + \sqrt{2}}} \cdot \frac{2}{\sqrt{2 + \sqrt{2 + \sqrt{2}}}}  \end{array}

and so on, where A_n is the area of a regular n-gon inscribed in the unit circle. So, it was only a small step for Viète (though an infinite leap for mankind) to conclude that

\displaystyle{ \pi = 2 \cdot \frac{2}{\sqrt{2}} \cdot \frac{2}{\sqrt{2 + \sqrt{2}}} \cdot \frac{2}{\sqrt{2 + \sqrt{2 + \sqrt{2}}}} \cdots }

or, if square roots in a denominator make you uncomfortable:

\displaystyle{ \frac2\pi = \frac{\sqrt 2}2 \cdot \frac{\sqrt{2+\sqrt 2}}2 \cdot \frac{\sqrt{2+\sqrt{2+\sqrt 2}}}{2} \cdots}

The basic idea here would not have surprised Archimedes, who rigorously proved that

223/71 < \pi < 22/7

by approximating the circumference of a circle using a regular 96-gon. Since 96 = 2^5 \times 3, you can draw a regular 96-gon with ruler and compass by taking an equilateral triangle and bisecting its edges to get a hexagon, bisecting the edges of that to get a 12-gon, and so on up to 96. In a more modern way of thinking, you can figure out everything you need to know by starting with the angle \pi/3 and using half-angle formulas 4 times to work out the sine or cosine of \pi/96. And indeed, before Viète came along, Ludolph van Ceulen had computed pi to 35 digits using a regular polygon with 2^{62} sides! So Viète’s daring new idea was to give an exact formula for pi that involved an infinite process.

Now let’s see in detail how Viète’s formula works. Since there’s no need to start with a square, we might as well start with a regular n-gon inscribed in the circle and repeatedly bisect its sides, getting better and better approximations to pi. If we start with a pentagon, we’ll get a formula for pi that involves the golden ratio!

We have

\displaystyle{ \pi = \lim_{k \to \infty} A_k }

so we can also compute pi by starting with a regular n-gon and repeatedly doubling the number of vertices:

\displaystyle{ \pi = \lim_{k \to \infty} A_{2^k n} }

The key trick is to write A_{2^k}{n} as a ‘telescoping product’:

A_{2^k n} = A_n \cdot \frac{A_{2n}}{A_n} \cdot  \frac{A_{4n}}{A_{2n}} \cdot \frac{A_{8n}}{A_{4n}}

Thus, taking the limit as k \to \infty we get

\displaystyle{ \pi = A_n \cdot \frac{A_{2n}}{A_n} \cdot \frac{A_{4n}}{A_{2n}} \cdot \frac{A_{8n}}{A_{4n}} \cdots }

where we start with the area of the n-gon and keep ‘correcting’ it to get the area of the 2n-gon, the 4n-gon, the 8n-gon and so on.

There’s a simple formula for the area of a regular n-gon inscribed in a circle. You can chop it into 2 n right triangles, each of which has base \sin(\pi/n) and height \cos(\pi/n), and thus area n \sin(\pi/n) \cos(\pi/n):

Thus,

A_n = n \sin(\pi/n) \cos(\pi/n) = \displaystyle{\frac{n}{2} \sin(2 \pi / n)}

This lets us understand how the area changes when we double the number of vertices:

\displaystyle{ \frac{A_{n}}{A_{2n}} = \frac{\frac{n}{2} \sin(2 \pi / n)}{n \sin(\pi / n)} = \frac{n \sin( \pi / n) \cos(\pi/n)}{n \sin(\pi / n)} = \cos(\pi/n) }

This is nice and simple, but we really need a recursive formula for this quantity. Let’s define

\displaystyle{ R_n = 2\frac{A_{n}}{A_{2n}} = 2 \cos(\pi/n) }

Why the factor of 2? It simplifies our calculations slightly. We can express R_{2n} in terms of R_n using the half-angle formula for the cosine:

\displaystyle{ R_{2n} = 2 \cos(\pi/2n) = 2\sqrt{\frac{1 + \cos(\pi/n)}{2}} = \sqrt{2 + R_n} }

Now we’re ready for some fun! We have

\begin{array}{ccl} \pi &=& \displaystyle{ A_n \cdot \frac{A_{2n}}{A_n} \cdot \frac{A_{4n}}{A_{2n}} \cdot \frac{A_{8n}}{A_{4n}} \cdots }  \\ \\ & = &\displaystyle{ A_n \cdot \frac{2}{R_n} \cdot \frac{2}{R_{2n}} \cdot \frac{2}{R_{4n}} \cdots } \end{array}

so using our recursive formula R_{2n} = \sqrt{2 + R_n}, which holds for any n, we get

\pi =  \displaystyle{ A_n \cdot \frac{2}{R_n} \cdot \frac{2}{\sqrt{2 + R_n}} \cdot \frac{2}{\sqrt{2 + \sqrt{2 + R_n}}} \cdots }

I think this deserves to be called the generalized Viète formula. And indeed, if we start with a square, we get

A_4 = \displaystyle{\frac{4}{2} \sin(2 \pi / 4)} = 2

and

R_4 = 2 \cos(\pi/4) = \sqrt{2}

giving Viète’s formula:

\pi = \displaystyle{ 2 \cdot \frac{2}{\sqrt{2}} \cdot \frac{2}{\sqrt{2 + \sqrt{2}}} \cdot \frac{2}{\sqrt{2 + \sqrt{2 + \sqrt{2}}}} \cdots }

as desired!

But what if we start with a pentagon? For this it helps to remember a beautiful but slightly obscure trig fact:

\cos(\pi / 5) = \Phi/2

and a slightly less beautiful one:

\displaystyle{ \sin(2\pi / 5) = \frac{1}{2} \sqrt{2 + \Phi} }

It’s easy to prove these, and I’ll show you how later. For now, note that they imply

A_5 = \displaystyle{\frac{5}{2} \sin(2 \pi / 5)} = \frac{5}{4} \sqrt{2 + \Phi}

and

R_5 = 2 \cos(\pi/5) = \Phi

Thus, the formula

\pi =  \displaystyle{ A_5 \cdot \frac{2}{R_5} \cdot \frac{2}{\sqrt{2 + R_5}} \cdot \frac{2}{\sqrt{2 + \sqrt{2 + R_5}}} \cdots }

gives us

\pi =  \displaystyle{ \frac{5}{4} \sqrt{2 + \Phi} \cdot \frac{2}{\Phi} \cdot \frac{2}{\sqrt{2 + \Phi}} \cdot \frac{2}{\sqrt{2 + \sqrt{2 + \Phi}}} \cdots }

or, cleaning it up a bit, the formula we want:

\pi = \frac{5}{\Phi} \cdot \frac{2}{\sqrt{2 + \sqrt{2 + \Phi}}} \cdot \frac{2}{\sqrt{2 + \sqrt{2 + \sqrt{2 + \Phi}}}}  \cdot \frac{2}{\sqrt{2 + \sqrt{2 + \sqrt{2 + \sqrt{2 + \Phi}}}}} \cdots

Voilà!

There’s a lot more to say, but let me just explain the slightly obscure trigonometry facts we needed. To derive these, I find it nice to remember that a regular pentagon, and the pentagram inside it, contain lots of similar triangles:



Using the fact that all these triangles are similar, it’s easy to show that for any one, the ratio of the long side to the short side is \Phi to 1, since

\displaystyle{\Phi = 1 + \frac{1}{\Phi} }

Another important fact is that the pentagram trisects the interior angle of the regular pentagon, breaking the interior angle of 108^\circ = 3\pi/5 into 3 angles of 36^\circ = \pi/5:



Again this is easy and fun to show.

Combining these facts, we can prove that

\displaystyle{ \cos(2\pi/5) = \frac{1}{2\Phi}  }

and

\displaystyle{ \cos(\pi/5) = \frac{\Phi}{2} }

To prove the first equation, chop one of those golden triangles into two right triangles and do things you learned in high school. To prove the second, do the same things to one of the short squat isosceles triangles:

Starting from these equations and using \cos^2 \theta + \sin^2 \theta = 1, we can show

\displaystyle{ \sin(2\pi/5) = \frac{1}{2}\sqrt{2 + \Phi}}

and, just for completeness (we don’t need it here):

\displaystyle{ \sin(\pi/5) = \frac{1}{2}\sqrt{3 - \Phi}}

These require some mildly annoying calculations, where it helps to use the identity

\displaystyle{\frac{1}{\Phi^2} = 2 - \Phi }

Okay, that’s all for now! But if you want more fun, try a couple of puzzles:

Puzzle 1. We’ve gotten formulas for pi starting from a square or a regular pentagon. What formula do you get starting from an equilateral triangle?

Puzzle 2. Using the generalized Viète formula, prove Euler’s formula

\displaystyle{  \frac{\sin x}{x} = \cos\frac{x}{2} \cdot \cos\frac{x}{4} \cdot \cos\frac{x}{8} \cdots }

Conversely, use Euler’s formula to prove the generalized Viète formula.

So, one might say that the real point of Viète’s formula, and its generalized version, is not any special property of pi, but Euler’s formula.

27 Responses to Pi and the Golden Ratio

  1. […] Two of my favorite numbers are pi: and the golden ratio: They’re related: $latex pi =… – Read full story at Hacker News […]

  2. Paulo Santos says:

    Congratulations!, Very interesting presentation of ideas, these is one of most favourites too, other is Sequence Limits of Euler and Fibonacci Numbers and the golden section in nature, art, geometry, architecture, music and even for calculating pi!

  3. John Cowan says:

    \pi was sometimes called “Ludolph’s number” for a while.

  4. Alan White says:

    The Golden Ratio is often used as the numerical value for the aspect ratio (Y Axis Height/ X Axis length) when graphing functions. Doesn’t work for the cycloid and it’s variants. The aspect ratio for the cycloid, a ‘wheel function’ must be set to Y = 1 / X = pi. Failing to do so locates the inflection point of Roberval’s ‘companion curve to the cycloid’ away from the center of the bounding rectangle.

  5. jessemckeown says:

    that first \cos(x) in puzzle 2 is bothering me; it has zeros that the other side doesn’t.

  6. Mar Kac’s book “Statistical Independence in Probability, Analysis and Number Theory” starts out with Viete’s formula (essentially puzzle 2) and then uses Rademacher functions to ultimately derive the central limit theorem. It is a ripping read. Kac is also famous for his “Can you hearth shape of a drum paper?” (Answer is “no”)

  7. Serge says:

    ¿Vòila? Voilà !

  8. Greg Egan says:

    Curiously, there is another infinite product formula for \frac{\sin(x)}{x} that is also attributed to Euler:

    \displaystyle{\frac{\sin(x)}{x} = \prod_{n=1}^{\infty} \left(1-\frac{x^2}{\pi^2 n^2}\right)}

    and setting x=\frac{\pi}{2} in this one leads to the Wallis formula for \pi that JB discussed here:

    • John Baez says:

      Yes, this other infinite product formula

      \displaystyle{\frac{\sin(x)}{x} = \prod_{n=1}^{\infty} \left(1-\frac{x^2}{\pi^2 n^2}\right)}

      is more famous: the young Euler used it to show

      \displaystyle{\sum_{n=1}^\infty \frac{1}{n^2} = \frac{\pi^2}{6}}

      thus meeting Bernoulli’s challenge to the world to sum this series:

      • John Baez, The Riemann zeta function, 21 December 2003.

      Euler simply guessed this product formula by creating an ‘infinite polynomial’ with zeros at the same places as \sin x / x (though I imagine he checked his guess in various ways). Later Weierstrass came up with a nice general theory of such product expansions:

      • Wikipedia, Weierstrass factorization theorem.

      But I’ve never seen anything written about

      \displaystyle{ \frac{\sin x}{x} = \cos\frac{x}{2} \cdot \cos\frac{x}{4} \cdot \cos\frac{x}{8} \cdots }

      except in the Wikipedia article on Vieète’s formula, so I’m a bit curious about its history.

  9. Friedmann and Hagen have got Wallis formula for pi from a variational computation of the spectrum of the hydrogen atom. Check out the proof here:

    http://dx.doi.org/10.1063/1.4930800

    • John Baez says:

      I will need to go through that sometime. People keep telling me about it, but I haven’t checked out the calculation! By doing a calculation in a sufficiently complicated way you can relate it to almost anything, so the question is how elegantly they make the connection.

      • Th only step I couldn’t immediately replicate was the expectation of the Hamiltonian and I have never got back to it – the rest is correct. I must do it but it is 40 years since I did that stuff.

  10. francisco says:

    I believe it should read
    \cos(\pi/5) = \frac{\Phi}{2}
    \cos(2\pi/5) = \frac{1}{2\Phi}
    because \Phi > 1 .

  11. domenico says:

    I am thinking that it would be possible to write a pi calculus with a volume of a sphere, but the problem is with the polyhedrons that must be ever increasingly smaller (it is impossible to have more of five regular polyhedra, so that a generalization of Viete in three dimension is not possible).
    I tried to generate a general irregular polyhedra using a Bravais lattice on the sphere (for increase the faces of the polyhedron reducing the primitive vectors), with the discrete translations replaced with the versors for the rotation along the edge of the spherical triangles, and I have used the Rodrigues rotation formula to obtain the points on the sphere (with a little program), so that there are an infinite number of tessellation using an arbitrary initial spherical triangle (that generate the primitive vectors of Bravais lattice) with a vertex in the zenit, an edge along a meridian, and the other edge with an arbitrary lengths and directions (to complete the scalene triangle): the edges of the triangles have different lengths in the primitive vectors, but have the same rotations in the primitive vectors; the volumes of the polyhedron are too complex to evaluate, but it seem that it is possible to obtain the tetrahedron, the octahedron and the cube using the Bravais lattice (so that could be possible for all the regular polyhedra).

  12. That generalized formula is so good. Puzzle-1 is simple enough but but nevertheless an excuse to write my first comment here in this blog;

    3 \frac{2}{\sqrt{2+\sqrt{3}}} \frac{2}{\sqrt{2+\sqrt{2+\sqrt{3}}}} ...

    I think there is a typo in the paragraph about the area of the regular n-gon, although it is correctly stated after the pentagon depiction. It should read n.sin()… instead of 2.sin()…

    • John Baez says:

      Hi, Akira. Thanks! I haven’t actually worked out the answer to Puzzle 1, but I’ll check your answer and see if it’s right. It’s certainly pretty.

      Also thanks for catching that typo. I fixed it.

      By the way, you used double dollar signs in your LaTeX; those don’t work here, alas. You can use \displaystyle{ } to make the text in an equation taller, and

      div align=”center”< >/div<

      around the equation to center it. With those tricks your equation becomes

      \displaystyle{ 3 \frac{2}{\sqrt{2+\sqrt{3}}} \frac{2}{\sqrt{2+\sqrt{2+\sqrt{3}}}} ... }

      or, even more gloriously:

      gives

      \displaystyle{\pi = 3 \frac{2}{\sqrt{2+\sqrt{3}}} \frac{2}{\sqrt{2+\sqrt{2+\sqrt{3}}}} \cdots }

      But these extra tricks are not very important!

  13. John I read many of your Maths/physics papers and always take time for Azimuth in/email. I sent you a series of polyhedrons, one I described as a tesseract or hypercube, a 3D icosahedral/cuboid construct yielding eight tetrahedrons.

    My working background is in building science, I’m a serious amateur mathematician with an emphasis on greenhouse and climate impacts, and number theory. its sometimes a bit awkward to explain but bricks, curvature and modularities are my areas of focused interest.

    The PI : PHI golden section relationship in 3D solids is an example I find fascinating, and the maths reasoning is why I follow Azimuth to connect the environment with pure maths and physics.

    A relationship between Phi and Pi; phi brick in ball, the brick in a sphere shows a simple relationship between Pi and Phi, using the values for the diagonal D that we have just found and the surface area S.
    If we imagine the brick tightly packed into a sphere, the centre of the sphere will be half way along diagonal D.
    So the radius of the sphere will be 1 and its surface area will be 4 Pi.

    http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Fibonacci/propsOfPhi.html#phiBrick

  14. […] in order to learn something new about π, go read this lovely post by John […]

  15. Eric Astor says:

    The general formula IS lovely. I particularly like that you get the same result whether you start with an equilateral triangle (Puzzle 1) or a regular hexagon! (The triangle case just has one extra factor get cancelled out.)

    I should try to figure out whether the formula for n always agrees with the formula for kn (which it should), and why the algebra works out; it seems like it must be a beautiful pattern.

You can use Markdown or HTML in your comments. You can also use LaTeX, like this: $latex E = m c^2 $. The word 'latex' comes right after the first dollar sign, with a space after it.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s