### Three Phases of Continued Fraction Theory

#### Posted by John Baez

I don’t know much about continued fractions yet, so it’s too early to be describing historical phases of work on the subject, but I can’t resist doing it. I’ll talk about three:

- The Greeks
- Euler
- Gauss

I won’t talk about general theories of continued fractions, like their connection to Pell’s equation, Calkin–Wilf trees and rational tangles, or the line of work from Gauss to Khinchin and beyond on the statistical properties of the continued fractions of ‘typical’ numbers, or the work of Pavlovic and Pratt on a characterization of $[0,\infty)$ as the terminal coalgebra of some endofunctor on the category of totally ordered sets, which uses continued fractions. Indeed, I *will not even mention* these things, fascinating though they are. Instead, I’ll only talk about continued fractions that can be evaluated to give famous numbers or functions.

## The Greeks

The Greeks were fascinated by anthyphairesis, a technique that includes Euclid’s algorithm for finding the greatest common divisor of two natural numbers — an algorithm that predates Euclid — and which combined with a bit of geometry easily leads to results such as this:

$\frac{\sqrt{5} + 1}{2} = 1 + \frac{1}{1 + \frac{1}{1 + \frac{1}{1 + \frac{1}{1 + \frac{1}{1 + \frac{1}{1 + \frac{1}{1 + \frac{1}{1 + \frac{1}{1 + \frac{1}{1 + \frac{1}{1 + \ddots}}}}}}}}}}}$

and this:

$\sqrt{2} = 1 + \frac{1}{2 + \frac{1}{2 + \frac{1}{2 + \frac{1}{2 + \frac{1}{2 + \frac{1}{2 + \frac{1}{2 + \frac{1}{2 + \frac{1}{2 + \frac{1}{2 + \frac{1}{2 + \ddots}}}}}}}}}}}$

By thinking about these things, one can see that any number whose ‘regular’ continued fraction expansion with 1’s in all the numerators goes on forever must be irrational. It’s not clear whether the Greeks ever used this to prove the irrationality of these numbers.

Much later, in 1770, Lagrange showed that a number is the solution of a quadratic equation with rational coefficients if and only if its continued fraction expansion with all 1’s in the numerators is eventually periodic. This still has an ancient Greek feel to me. Here’s a nice example:

$\sqrt{3} = 1 + \frac{1}{1 + \frac{1}{2 + \frac{1}{1 + \frac{1}{2 + \frac{1}{1 + \frac{1}{2 + \frac{1}{1 + \frac{1}{2 + \frac{1}{1 + \frac{1}{2 + \frac{1}{1 + \ddots}}}}}}}}}}}$

The square root of 3 is also called Theodorus’ constant because it was proved irrational by Theodosius of Cyene, a Libyan Greek mathematician, sometime in the 5th century BC.

## Euler

Leonhard Euler wrote his first work on continued fractions, *De fractionibus continuis dissertatio* in 1737. Here’s an English translation:

- Leonhard Euler, An essay on continued fractions, trans. Myra F. Wyman and Bostwick F. Wyman,
*Mathematical Systems Theory***18**(1985), 295–328.

I’ve read a bit of scholarship about this paper, and it seems he got into continued fractions by trying to solve some differential equations called Riccati equations. These are the next thing after first-order *linear* ordinary differential equations — they look like this:

$\frac{d y}{d x} = f(x) y^2 + g(x) y + h(x)$

If you do a change of variables here, applying a fractional linear transformation to $y$, you get another Riccati equation! For this reason, it turns out, you can solve Riccati equations using continued fractions.

But the *visible* goal of Euler’s paper is rather different: it leads up to the first proof that the number $e$ is irrational, by showing

$e = 2 + \frac{1}{1 + \frac{1}{2 + \frac{1}{1 + \frac{1}{1 + \frac{1}{4 + \frac{1}{1 + \frac{1}{1 + \frac{1}{6 + \frac{1}{1 + \frac{1}{1 + \frac{1}{8 + \ddots}}}}}}}}}}}$

This fraction has a rocky start, but then it follows a regular pattern. Since it’s not periodic, $e$ cannot be the solution of a quadratic equation with rational coefficients. Thus, neither $e$ nor $e^2$ is rational!

In 1739 Euler wrote *De fractionibus continuis observationes* in 1739, which has a nice English translation:

- Leonhard Euler, Observations on continued fractions, trans. Alexander Aycock.

Among other features, this paper derives the formula

$\ln 2 = \frac{1}{1 + \frac{1^2}{1 + \frac{3^2}{1 + \frac{5^2}{1 + \frac{7^2}{1 + \frac{9^2}{1 + \frac{11^2}{1 + \frac{13^2}{1 + \frac{15^2}{1 + \frac{17^2}{1 + \frac{19^2}{1 + \ddots}}}}}}}}}}}$

and one I explained in a previous post

$\frac{\pi}{4} = \frac{1}{1 + \frac{1^2}{2 + \frac{3^2}{2 + \frac{5^2}{2 + \frac{7^2}{2 + \frac{8^2}{2 +\frac{9^2}{2 +\frac{10^2}{2 +\ddots}}}}}}}}$

He gave these formulas to illustrate a general method for turning infinite series into continued fractions, which he further propounded in his *Introductio in analysin infinitorum* in 1748. It’s called Euler’s continued fraction formula, and here it is:

$a_0 + a_0a_1 + a_0a_1a_2 + \cdots + a_0a_1a_2\cdots a_n =$ $\frac{a_0}{1 - \frac{a_1}{1 + a_1 - \frac{a_2}{1 + a_2 - \frac{\ddots}{\ddots \frac{a_{n-1}}{1 + a_{n-1} - \frac{a_n}{1 + a_n}}}}}}\,$

Applying this to the familiar series

$\ln 2 = \frac{1}{1} - \frac{1}{2} + \frac{1}{3} - \frac{1}{4} + \frac{1}{5} - \frac{1}{6} + \frac{1}{7} - \frac{1}{8} + \frac{1}{9} - \frac{1}{10} + \cdots$

and

$\frac{\pi}{4} = \frac{1}{1} - \frac{1}{3} + \frac{1}{5} - \frac{1}{7} + \frac{1}{9} - \frac{1}{11} + \frac{1}{13} - \frac{1}{15} + \cdots$

we get the continued fractions shown above! It’s also really easy to use this method to get a different continued fraction for $e$:

$e = \frac{1}{1 - \frac{1}{2 - \frac{1}{3 - \frac{1}{4 - \frac{1}{5 - \frac{1}{6 - \frac{1}{7 - \frac{1}{8 - \frac{1}{9 - \frac{1}{10 - \frac{1}{11 - \ddots}}}}}}}}}}}$

But in all these cases we actually get much more: we get continued fraction expansions for the functions $\ln z$, $\arctan z$ and $e^z$ — and making the right choice of $z$ we get our formulas for $\ln 2$, $4/\pi$ and $e$, respectively. Indeed Euler’s formula gives nice continued fractions for *all* functions with simple Taylor series, as explained here.

Euler does much, much more! For example, besides showing

$\ln 2 = \int_0^1 \frac{d x}{1 + x^2} = \frac{1}{1 + \frac{1^2}{1 + \frac{2^2}{1 + \frac{3^2}{1 + \frac{4^2}{1 + \frac{5^2}{1 + \frac{6^2}{1 + \frac{7^2}{1 + \frac{8^2}{1 + \frac{9^2}{1 + \frac{10^2}{1 + \ddots}}}}}}}}}}}$

he shows that similarly

$\int_0^1 \frac{d x}{1 + x^n} = \frac{1}{1 + \frac{1^2}{n + \frac{(n+1)^2}{n + \frac{(2n+1)^2}{n + \frac{(3n+1)^2}{n + \frac{(4n+1)^2}{n + \frac{(5n+1)^2}{n + \frac{(6n+1)^2}{n + \frac{(7n+1)^2}{n + \frac{(8n+1)^2}{n + \frac{9(n+1)^2}{n + \ddots}}}}}}}}}}}$

And so on.

## Gauss

In 1813 Gauss introduced ordinary hypergeometric functions in his paper *Disquisitiones generales circa seriem infinitam $1 + \tfrac {\alpha \beta} {1 \cdot \gamma} x + \tfrac {\alpha (\alpha+1) \beta (\beta+1)} {1 \cdot 2 \cdot \gamma (\gamma+1)}x x + \text{etc.}$*. These are functions of one complex variable $z$ that also depends on 3 parameters called $a,b,c$, so they’re written

${}_2F_1(a,b;c;z)$

I find these functions pretty intimidating, but apparently they have a nice explanation. Suppose you’re studying flat connections on a holomorphic $\mathbb{C}^2$ bundle over the Riemann sphere with 3 points removed. And suppose you’re looking for flat sections of such a bundle. Then you want ordinary hypergeometric functions! That’s what they are! For a tiny bit more detail, go here.

Anyway, these functions have Taylor series that aren’t too bad:

${}_2F_1(a,b;c;z) = 1 + \frac{a b}{c\,1!}z + \frac{a(a+1)b(b+1)}{c(c+1)\,2!}z^2 + \frac{a(a+1)(a+2)b(b+1)(b+2)}{c(c+1)(c+2)\,3!}z^3 + \cdots.$

And Gauss worked out their continued fraction expansion:

$\frac{{}_2F_1(a+1,b;c+1;z)}{c{}_2F_1(a,b;c;z)} = \frac{1}{c + \frac{(a-c)b z}{(c+1) + \frac{(b-c-1)(a+1) z}{(c+2) + \frac{(a-c-1)(b+1) z}{(c+3) + \frac{(b-c-2)(a+2) z}{(c+4) + {}\ddots}}}}}$

This looks almost like something you could do using Euler’s continued fraction expansion together with a bit of extra algebraic fiddling — I should try it sometime.

Ordinary hypergeometric functions have a bunch of more familiar ‘elementary’ functions as special cases, so we can get some nice examples of continued fractions out of Gauss’ work. But some of these arise already from Euler’s continued fraction expansion without needing to think about hypergeometric functions. Here’s one that seems to require the hypergeometric function technology — I’m not completely sure:

$\tanh z = \frac{z}{1 + \frac{z^2}{3 + \frac{z^2}{5 + \frac{z^2}{7 +\frac{z^2}{9 +\frac{z^2}{11 +\frac{z^2}{13 + {}\ddots}}}}}}}$

But I guess the main application of Gauss’ work is not to elementary functions!

Interestingly it seems Euler beat Gauss to some of these ideas, like the formula above.

## Conclusion

My conclusion is that I should read Euler’s Observations on continued fractions before moving ahead. It’s packed with delights. These are also helpful:

Rosanna Cretney, The origins of Euler’s early work on continued fractions,

*Historia Mathematica***41**(2014), 139–156.Christopher Baltus, Notes on Euler’s continued fractions.

Claude Brezinski,

*History of Continued Fractions and Padé Approximants*, Springer, 2012.

## Michael Weiss

About whether the Greeks used anthyphairesis to prove irrationality, B. L. Van der Walden speculated about this in his classic work

Science Awakening(pp.141–145). His conjectures are based on Plato’s dialogTheaetetus, our main source of information about the pre-Euclidean theory of irrationals. Specifically this passage:van der Waerden’s theory is that Theodorus was using the criterion for incommensurability which later appeared in Euclid as Prop 2, Bk X: in modern terms, the non-termination of the continued fraction. This works all the way up to and including $\sqrt{17}$ without too much rending of togas, but for $\sqrt{19}$ it’s a pain. As van der Waerden puts it, “it requires a sequence of 6 proportions…each of which has to be proved by means of the calculation of areas. This makes it quite understandable why Theodorus closed his explanation with $\sqrt{17}$.”

Not an iron-clad argument, but the best we have, afaik.