The number $\pi$ comes from the geometry of the circle. The odd numbers come from arithmetic. There is no apparent reason for them to meet. But they do:

$$\frac{\pi}{4}=1-\frac13+\frac15-\frac17+\frac19-\cdots$$

Add and subtract the reciprocals of the odd numbers, alternating signs, and the result, multiplied by 4, is $\pi$.

One discovery, three times

Leibniz found this formula in 1673, in Paris, while he was still learning mathematics from Huygens. He showed the result to his teacher, who was impressed and praised him. It was Leibniz’s first great discovery and what convinced him he could be a mathematician.

He was not the first. In 1671 the Scot James Gregory had already found the arctangent series, of which this is a special case. And about 250 years earlier the Indian mathematician Madhava of Sangamagrama, founder of the Kerala school, had discovered the same series. Europeans did not know these works. That is why today it is called the Madhava–Leibniz or Gregory–Leibniz series.

The proof

Let us prove the formula with today’s tools, in three steps.

1. A geometric sum. The sum $1-q+q^2-q^3+\cdots$ of a geometric progression with ratio $-q$ has a known formula. With $q=t^2$ and stopping after $N$ terms, it is exact if we include a remainder:

$$\frac{1}{1+t^2}=1-t^2+t^4-\cdots+(-1)^{N-1}t^{2N-2}+\frac{(-1)^Nt^{2N}}{1+t^2}.$$

2. Integrate both sides from 0 to 1. On the left, the area under $\dfrac{1}{1+t^2}$ between 0 and 1 is $\arctan1=\dfrac\pi4$, because the tangent of $45°$ is 1. On the right, each power $t^{2k}$ gives $\dfrac{1}{2k+1}$:

$$\frac{\pi}{4}=1-\frac13+\frac15-\cdots+\frac{(-1)^{N-1}}{2N-1}+R_N.$$

3. The remainder goes to zero. Since $1+t^2\ge1$, the remainder is bounded:

$$|R_N|\le\int_0^1t^{2N}\,dt=\frac{1}{2N+1}.$$

As $N$ grows, $\dfrac{1}{2N+1}$ goes to zero, and the sum gets as close to $\dfrac\pi4$ as we like.

Beautiful but slow

Multiplying by 4, the sum approaches $\pi$ with an error of at most $\dfrac{4}{2N+1}$. That is slow:

Terms Sum × 4 Guaranteed maximum error
1 4 1.33
2 2.667 0.8
10 3.0418 0.19
100 3.1316 0.02
1000 3.1406 0.002

With a thousand terms we are still wrong in the third decimal place. Ten correct places would need billions of terms. The series is perfect for understanding $\pi$ and terrible for computing it. The computers that now calculate trillions of digits use other, much faster formulas.

Increase the number of terms. The result alternates around π, but the error guarantee shrinks slowly.

Notice in the figure that the sums jump from one side of $\pi$ to the other: one is above, the next below. This happens in every alternating series whose terms decrease, which is why the true value always lies between two consecutive sums.

Exercise: what maximum error do we guarantee with 100 terms?

The bound is $\dfrac{4}{2\cdot100+1}=\dfrac{4}{201}\approx0.0199$. It is a guarantee; the actual error with 100 terms is about $0.01$.

Exercise: how many terms guarantee an error below 0.001 for π?

We need $\dfrac{4}{2N+1}<0.001$, that is, $2N+1>4000$. $N=2000$ terms are enough.

Sources: Leibniz biography, MacTutor · James Gregory biography, MacTutor · Madhava biography, MacTutor.


All Leibniz topics · ← Leibniz’s machine: turning sums into motion · Calculemus: the idea of calculating with reasoning →

Image credits.