## August 31, 2020

### Chasing the Tail of the Gaussian (Part 1)

#### Posted by John Baez

I recently finished reading Robert Kanigel’s biography of Ramanujan, The Man Who Knew Infinity. I enjoyed it a lot and wanted to learn a bit more about what Ramanujan actually did, so I’ve started reading Hardy’s book Ramanujan: Twelve Lectures on Subjects Suggested By His Life and Work. And I decided it would be good to think about one of the simplest formulas in Ramanujan’s first letter to Hardy.

It was a good idea, because I now believe all these formulas, which look like impressive yet mute monuments, are actually crystallized summaries of long and interesting stories — full of twists, turns and digressions.

The number $\pi$ is a bit bigger than 3; the number $e$ is a bit less. So you should want to take their average and get another number close to 3. Our story starts with the geometric mean

$\sqrt{\pi e} = 2.92228236532 \dots$

You may think it’s pointless to ruminate on this number. But in 1914, Ramanujan posed this puzzle in The Journal of the Indian Mathematical Society:

Prove that

$\left(\frac{1}{1} + \frac{1}{1 \cdot 3} + \frac{1}{1 \cdot 3 \cdot 5} + \cdots\right) \; + \; \frac{1}{1 + \frac{1}{1 + \frac{2}{1 + \frac{3}{1 + \frac{4}{1 + \frac{5}{1 + \ddots}}}}}} = \sqrt{\frac{\pi e}{2}}$

My first reaction to this formula was a mixture of awe, terror, and disgust. Awe because it’s surprising and beautiful. Terror because I imagine it being on some final exam that mathematicians take before we’re allowed into the pearly gates. And disgust, because mathematics is supposed to make sense, and this doesn’t.

Getting past those initial reactions, note that on the left we have two of our favorite constants combined in a multiplicative way, while on the right we have two impressive expressions added to each other. So it’s hard to know where to start… but the expression

$\frac{1}{1} + \frac{1}{1 \cdot 3} + \frac{1}{1 \cdot 3 \cdot 5} + \cdots$

reminds me of a Taylor series, and I know more about those than continued fractions, so let’s start there.

There’s a power series

$f(x) = \frac{x}{1} + \frac{x^3}{1 \cdot 3} + \frac{x^5}{1 \cdot 3 \cdot 5} + \cdots$

What function is this? If we knew, then we’d have a formula for

$f(1) = \frac{1}{1} + \frac{1}{1 \cdot 3} + \frac{1}{1 \cdot 3 \cdot 5} + \cdots$

So let’s try to figure it out. We could try to guess a function that has this Taylor series, but another approach is to note that

$f'(x) = 1 + \frac{x^2}{1} + \frac{x^4}{1 \cdot 3} + \cdots$

looks a lot like $f(x)$. In fact

$f'(x) = 1 + x f(x) \qquad and \qquad f(0) = 0$

So let’s solve this differential equation! We need to use an integrating factor: we need to write $f$ as some function $u$ times a function that gets multiplied by $x$ when you differentiate it. The function $e^{x^2/2}$ has that property:

$\frac{d}{d x} e^{x^2/2} = x \, e^{x^2/2}$

so if we write our mystery function $f$ as

$f(x) = e^{x^2/2} u(x)$

then our differential equation becomes

$\frac{d}{d x} \left( e^{x^2/2} \, u(x) \right) = 1 + x\, e^{x^2/2}\, u(x) \qquad and \qquad u(0) = 0$

or in other words

$e^{x^2/2} \, u'(x) = 1 \qquad and \qquad u(0) = 0$

so

$u(x) = \int_0^x e^{-t^2/2} \, d t$

Hey! It’s the integral of a Gaussian! This is important in probability theory. So we’re not just messing around with insane formulas: we’re doing math that’s connected to something useful.

A famous fact is that you can’t do the integral of a Gaussian using elementary functions — but a lot is known about it: up to various fudge factors our integral is basically the error function. Anyway, we get

$f(x) = e^{x^2/2} \int_0^x e^{-t^2/2} \, d t$

so now we get

$f(1) = e^{1/2} \int_0^1 e^{-t^2/2} \, d t$

and thus

$\frac{1}{1} + \frac{1}{1 \cdot 3} + \frac{1}{1 \cdot 3 \cdot 5} + \cdots = \sqrt{e} \int_0^1 e^{-t^2/2} \, d t$

We’ve evaluated our infinite series! And you’ll notice the square root of $e$ is showing up, which is nice. But not the square root of $\pi$.

Where does this leave us? We were trying to show

$\sqrt{\frac{\pi e}{2}} = \left(\frac{1}{1} + \frac{1}{1 \cdot 3} + \frac{1}{1 \cdot 3 \cdot 5} + \cdots\right) \; + \; \frac{1}{1 + \frac{1}{1 + \frac{2}{1 + \frac{3}{1 + \frac{4}{1 + \frac{5}{1 + \ddots}}}}}}$

and now we know the first big expression at right. So we just need to show

$\sqrt{\frac{\pi e}{2}} = \sqrt{e} \int_0^1 e^{-t^2/2} \, d t \; + \; \frac{1}{1 + \frac{1}{1 + \frac{2}{1 + \frac{3}{1 + \frac{4}{1 + \frac{5}{1 + \ddots}}}}}}$

It’s very tempting to divide by $\sqrt{e}$, so let’s do that, and solve for the continued fraction:

$\frac{e^{-1/2}}{1 + \frac{1}{1 + \frac{2}{1 + \frac{3}{1 + \frac{4}{1 + \frac{5}{1 + \ddots}}}}}} = \sqrt{\frac{\pi}{2}} - \int_0^1 e^{-t^2/2} \, d t$

So this is the equation we need to show.

Now what? It gets a bit harder now. But it helps to remember the integral of a Gaussian from $-\infty$ to $\infty$. When I was in high school, I read this anecdote:

Lord Kelvin wrote $\int_{-\infty}^{\infty} e^{-x^2} \, d x = \sqrt{\pi}$ on the blackboard, and then said “A mathematician is one to whom that is as obvious as that twice two makes four is to you”.

It’s a somewhat obnoxious thing to say — maybe to a group of students? — but since I wanted to be a mathematician, I made sure I knew how how to do this integral!

Note that the square root of $\pi$ shows up in Kelvin’s integral, and we know that number appears in our problem here. So that’s a good sign. But these days I prefer to remember this:

$\int_{-\infty}^{\infty} e^{-t^2/2} \, d t = \sqrt{2\pi}$

because $2\pi$ is more fundamental than $\pi$, and $x^2/2$ is more fundamental than $x^2$ in many contexts, like the harmonic oscillator in physics (because when you differentiate it you get $x$), or probability theory (because $e^{-t^2/2}$ gives the Gaussian of variance $1$ when you normalize it). So it’s easy for me to notice that

$\int_{0}^{\infty} e^{-t^2/2} \, d t = \sqrt{\frac{\pi}{2}}$

And this is a number you’ve just seen! — right before I said “So this is the equation we need to show.”

If we plug this formula into that equation, we get this:

$\frac{e^{-1/2}}{1 + \frac{1}{1 + \frac{2}{1 + \frac{3}{1 + \frac{4}{1 + \frac{5}{1 + \ddots}}}}}} = \int_0^\infty e^{-t^2/2} \, d t - \int_0^1 e^{-t^2/2} \, d t$

or in other words this:

$\frac{e^{-1/2}}{1 + \frac{1}{1 + \frac{2}{1 + \frac{3}{1 + \frac{4}{1 + \frac{5}{1 + \ddots}}}}}} = \int_1^\infty e^{-t^2/2} \, d t$

or if you prefer, this:

$\frac{1}{1 + \frac{1}{1 + \frac{2}{1 + \frac{3}{1 + \frac{4}{1 + \frac{5}{1 + \ddots}}}}}} = e^{1/2} \int_1^\infty e^{-t^2/2} \, d t$

So this is what we need to show.

We’ve peeled off the soft outer layer of the problem, using just elementary techniques. Now it gets harder, but also more interesting. At this point it really pays to prove something more general, namely

$\frac{1}{x + \frac{1}{x + \frac{2}{x + \frac{3}{x + \frac{4}{x + \frac{5}{x + \ddots}}}}}} = e^{x^2/2} \int_x^\infty e^{-t^2/2} \, d t$

In fact a formula essentially like this is the eighth one listed by Hardy in his first lecture on Ramanujan, where he’s discussing a few of the many formulas in the first letter he received from Ramanujan. Hardy said it “seemed vaguely familiar” when he first saw it, adding that “actually it is classical; it is a formula of Laplace first proved properly by Jacobi”. So, it was not one of really novel ones that wowed Hardy… which is why I’m talking about it: I’m not ready to tackle Ramanujan’s serious work.

I can guess why Laplace and Jacobi cared about this formula. Now we’re not just dealing with a single continued fraction that equals a specific number: we’re dealing with a continued fraction formula for the tail of a Gaussian in general!

That is, if IQs were distributed according to some Gaussian distribution of known mean and standard deviation, you might ask “what’s the probability that someone has an IQ over 200?” And you could use a formula like

$\frac{1}{\sqrt{2 \pi}} \int_x^\infty e^{-t^2/2} \, d t = \frac{e^{-x^2/2}}{\sqrt{2 \pi}} \cdot \frac{1}{x + \frac{1}{x + \frac{2}{x + \frac{3}{x + \frac{4}{x + \frac{5}{x + \ddots}}}}}}$

to estimate this answer. Here I’ve got a Gaussian of standard deviation 1, and I’ve normalized it so we’re getting the probability that it takes a value $\ge x$.

I will not try to go further today; next time I’ll try to say more about the formula

$\frac{1}{x + \frac{1}{x + \frac{2}{x + \frac{3}{x + \frac{4}{x + \frac{5}{x + \ddots}}}}}} = e^{x^2/2} \int_x^\infty e^{-t^2/2} \, d t$

A few final remarks:

1) I haven’t seen the papers by Laplace and Jacobi. If anyone can help me track them down, I’d appreciate it.

2) I just learned that Ramanujan’s first letter had at least 11 pages of formulas, at least two of which are now lost.

3) I got a lot of help from this blog article:

which in turn is largely based on this:

So if you want to ‘cheat’ and read ahead, you can take a look at these. I may wind up needing your help.

(For Part 2, go here.)

Posted at August 31, 2020 9:35 PM UTC

TrackBack URL for this Entry:   https://golem.ph.utexas.edu/cgi-bin/MT-3.0/dxy-tb.fcgi/3247

### Re: Chasing the Tail of the Gaussian (Part 1)

I think these might be what you are looking for:

• P. S. Laplace, Traité de Mécanique Céleste vol IV, Livre X.i§5, direct link to page 493 in the Bowditch translation.

• C. G. J. Jacobi, De fractione continua, in quam integrale $\int_x^\infty e^{-x x} d x$ evolvere licet, Journal für die reine und angewandte Mathematik 12 (1834) 346–347, Göttinger Digitalisierungzentrum,

Though they are not in the precisely same form as you give.

Posted by: David Roberts on September 1, 2020 6:31 AM | Permalink | Reply to this

### Re: Chasing the Tail of the Gaussian (Part 1)

Thanks, David — this is great! It seems Laplace was in the middle of estimating the refraction of light due to the Earth’s atmosphere. He seems to be applying some method of solving first-order linear ordinary differential equations using continued fractions, which he developed starting in equation 2289 of an earlier volume. It will take me a while to find that equation and figure out what’s he doing. It seems to involve writing differential equations as difference equations using infinitesimals.

I hadn’t realized the Traité de Mécanique Céleste was so huge—the section you pointed me to starts around equation 8359 in volume 10. Laplace is much more of a monster than I’d imagined.

Posted by: John Baez on September 1, 2020 8:07 PM | Permalink | Reply to this

### Re: Chasing the Tail of the Gaussian (Part 1)

Ah, but Jacobi’s paper is much clearer, even though it’s in Latin while the Laplace you pointed me to was translated into English!

Posted by: John Baez on September 1, 2020 8:08 PM | Permalink | Reply to this

### Re: Chasing the Tail of the Gaussian (Part 1)

I just caught a typo in that paper by Jacobi. I was really confused until I realized equation 7 should not be

$y_n = y_{n+1} + (n+1)y_{n+1}$

It should be

$y_n = y_{n+1} + q(n+1)y_{n+1}$

Now it seems to work.

Posted by: John Baez on September 1, 2020 11:44 PM | Permalink | Reply to this

### Re: Chasing the Tail of the Gaussian (Part 1)

By the way, Ramanujan’s original challenge was Question #541 in The Journal of the Indian Mathematical Society, volume VI, number 2, April 1914, page 79.

Amitabha Sen kindly provided a copy:

Posted by: John Baez on September 1, 2020 9:15 PM | Permalink | Reply to this

Post a New Comment