Proof that π is irrational

In the 1760s, Johann Heinrich Lambert was the first to prove that the number π is irrational, meaning it cannot be expressed as a fraction $$a/b$$, where $$a$$ and $$b$$ are both integers. In the 19th century, Charles Hermite found a proof that requires no prerequisite knowledge beyond basic calculus. Three simplifications of Hermite's proof are due to Mary Cartwright, Ivan Niven, and Nicolas Bourbaki. Another proof, which is a simplification of Lambert's proof, is due to Miklós Laczkovich. Many of these are proofs by contradiction.

In 1882, Ferdinand von Lindemann proved that $$\pi$$ is not just irrational, but transcendental as well.

Lambert's proof
In 1761, Johann Heinrich Lambert proved that $$\pi$$ is irrational by first showing that this continued fraction expansion holds:


 * $$\tan(x) = \cfrac{x}{1 - \cfrac{x^2}{3 - \cfrac{x^2}{5 - \cfrac{x^2}{7 - {}\ddots}}}}.$$

Then Lambert proved that if $$x$$ is non-zero and rational, then this expression must be irrational. Since $$\tan\tfrac\pi4 =1$$, it follows that $$\tfrac\pi4$$ is irrational, and thus $$\pi$$ is also irrational. A simplification of Lambert's proof is given below.

Hermite's proof
Written in 1873, this proof uses the characterization of $$\pi$$ as the smallest positive number whose half is a zero of the cosine function and it actually proves that $$\pi^2$$ is irrational. As in many proofs of irrationality, it is a proof by contradiction.

Consider the sequences of real functions $$A_n$$ and $$U_n$$ for $$n \in \N_0$$ defined by:


 * $$\begin{align}

A_0(x) &= \sin(x), && A_{n+1}(x) =\int_0^xyA_n(y)\,dy \\[4pt] U_0(x) &= \frac{\sin(x)}x, && U_{n+1}(x) =-\frac{U_n'(x)}x \end{align}$$

Using induction we can prove that


 * $$\begin{align}

A_n(x) &=\frac{x^{2n+1}}{(2n+1)!!}-\frac{x^{2n+3}}{2\times(2n+3)!!}+\frac{x^{2n+5}}{2\times4\times(2n+5)!!}\mp\cdots \\[4pt] U_n(x) &=\frac1{(2n+1)!!}-\frac{x^2}{2\times(2n+3)!!}+\frac{x^4}{2\times4\times(2n+5)!!}\mp\cdots \end{align}$$

and therefore we have:


 * $$U_n(x)=\frac{A_n(x)}{x^{2n+1}}.\,$$

So



\begin{align} \frac{A_{n+1}(x)}{x^{2n+3}} & =U_{n+1}(x)=-\frac{U_n'(x)}x=-\frac1x\frac {\mathrm{d}}{\mathrm{d}x}\left(\frac{A_n(x)}{x^{2n+1}}\right) \\[6pt] & = -\frac{1}{x} \left( \frac{A_n'(x) \cdot x^{2n+1} - (2n+1) x^{2n} A_n(x)}{x^{2(2n+1)}} \right ) \\[6pt] & = \frac{(2n+1)A_n(x)-xA_n'(x)}{x^{2n+3}} \end{align} $$

which is equivalent to


 * $$A_{n+1}(x)=(2n+1)A_n(x)-x^2A_{n-1}(x).\,$$

Using the definition of the sequence and employing induction we can show that


 * $$A_n(x) = P_n(x^2) \sin(x) + x Q_n(x^2) \cos(x),\,$$

where $$P_n$$ and $$Q_n$$ are polynomial functions with integer coefficients and the degree of $$P_n$$ is smaller than or equal to $$\bigl\lfloor \tfrac12n\bigr\rfloor.$$ In particular, $$A_n\bigl(\tfrac12\pi\bigr) = P_n\bigl(\tfrac14\pi^2\bigr).$$

Hermite also gave a closed expression for the function $$A_n,$$ namely


 * $$A_n(x)=\frac{x^{2n+1}}{2^n n!}\int_0^1(1-z^2)^n\cos(xz)\,\mathrm{d}z.\,$$

He did not justify this assertion, but it can be proved easily. First of all, this assertion is equivalent to


 * $$\frac{1}{2^n n!}\int_0^1(1-z^2)^n\cos(x z)\,\mathrm{d}z=\frac{A_n(x)}{x^{2n+1}}=U_n(x).$$

Proceeding by induction, take $$n = 0.$$


 * $$\int_0^1\cos(xz)\,\mathrm{d}z=\frac{\sin(x)}x=U_0(x)$$

and, for the inductive step, consider any natural number $$n.$$ If


 * $$\frac{1}{2^nn!}\int_0^1(1-z^2)^n\cos(xz)\,\mathrm{d}z=U_n(x),$$

then, using integration by parts and Leibniz's rule, one gets


 * $$\begin{align}

&\frac{1}{2^{n+1}(n+1)!} \int_0^1\left(1-z^2\right)^{n+1}\cos(xz)\,\mathrm{d}z \\ &\qquad=\frac{1}{2^{n+1}(n+1)!}\Biggl(\,\overbrace{\left.(1-z^2)^{n+1}\frac{\sin(xz)}x\right|_{z=0}^{z=1}}^{=\,0} \ +\, \int_0^12(n+1)\left(1-z^2\right)^nz \frac{\sin(xz)}x\,\mathrm{d}z\Biggr)\\[8pt] &\qquad= \frac1x\cdot\frac1{2^n n!}\int_0^1\left(1-z^2\right)^nz\sin(xz)\,\mathrm{d}z\\[8pt] &\qquad= -\frac1x\cdot\frac{\mathrm{d}}{\mathrm{d}x}\left(\frac1{2^nn!}\int_0^1(1-z^2)^n\cos(xz)\,\mathrm{d}z\right) \\[8pt] &\qquad= -\frac{U_n'(x)}x \\[4pt] &\qquad= U_{n+1}(x). \end{align}$$

If $$\tfrac14\pi^2 = p/q,$$ with $$p$$ and $$q$$ in $$\N$$, then, since the coefficients of $$P_n$$ are integers and its degree is smaller than or equal to $$\bigl\lfloor \tfrac12n\bigr\rfloor,$$ $$q^{\lfloor n/2 \rfloor}P_n\bigl(\tfrac14\pi^2\bigr)$$ is some integer $$N.$$ In other words,


 * $$N=q^{\lfloor n/2\rfloor}{A_n}\bigl(\tfrac12\pi\bigr) =q^{\lfloor n/2\rfloor}\frac{1}{2^nn!}\left(\dfrac pq \right)^{n+\frac 12}\int_0^1(1-z^2)^n \cos \left(\tfrac12\pi z \right)\,\mathrm{d}z.$$

But this number is clearly greater than $$0.$$ On the other hand, the limit of this quantity as $$n$$ goes to infinity is zero, and so, if $$n$$ is large enough, $$N < 1.$$ Thereby, a contradiction is reached.

Hermite did not present his proof as an end in itself but as an afterthought within his search for a proof of the transcendence of $$\pi.$$ He discussed the recurrence relations to motivate and to obtain a convenient integral representation. Once this integral representation is obtained, there are various ways to present a succinct and self-contained proof starting from the integral (as in Cartwright's, Bourbaki's or Niven's presentations), which Hermite could easily see (as he did in his proof of the transcendence of $$e$$ ).

Moreover, Hermite's proof is closer to Lambert's proof than it seems. In fact, $$A_n(x)$$ is the "residue" (or "remainder") of Lambert's continued fraction for $$\tan x.$$

Cartwright's proof
Harold Jeffreys wrote that this proof was set as an example in an exam at Cambridge University in 1945 by Mary Cartwright, but that she had not traced its origin. It still remains on the 4th problem sheet today for the Analysis IA course at Cambridge University.

Consider the integrals


 * $$I_n(x)=\int_{-1}^1(1 - z^2)^n\cos(xz)\,dz, $$

where $$n$$ is a non-negative integer.

Two integrations by parts give the recurrence relation


 * $$x^2I_n(x)=2n(2n-1)I_{n-1}(x)-4n(n-1)I_{n-2}(x). \qquad (n \geq 2)$$

If


 * $$J_n(x)=x^{2n+1}I_n(x),$$

then this becomes


 * $$J_n(x)=2n(2n-1)J_{n-1}(x)-4n(n-1)x^2J_{n-2}(x).$$

Furthermore, $$J_0(x) = 2 \sin x$$ and $$J_1(x) = -4x\cos x + 4\sin x.$$ Hence for all $$n \in \Z_+,$$


 * $$J_n(x)=x^{2n+1}I_n(x)=n!\bigl(P_n(x)\sin(x)+Q_n(x)\cos(x)\bigr),$$

where $$P_n(x)$$ and $$Q_n(x)$$ are polynomials of degree $$\leq n,$$ and with integer coefficients (depending on $n$).

Take $$x = \tfrac12\pi,$$ and suppose if possible that $$\tfrac12\pi = a/b$$ where $$a$$ and $$b$$ are natural numbers (i.e., assume that $$\pi$$ is rational). Then


 * $$ \frac{a^{2n+1}}{n!}I_n\bigl(\tfrac12\pi\bigr) = P_n\bigl(\tfrac12\pi\bigr)b^{2n+1}. $$

The right side is an integer. But $$0 < I_n \bigl(\tfrac12\pi\bigr) < 2$$ since the interval $$[-1,1]$$ has length $$2$$ and the function being integrated takes only values between $$0$$ and $$1.$$ On the other hand,


 * $$ \frac{a^{2n+1}}{n!} \to 0 \quad \text{ as }n \to \infty. $$

Hence, for sufficiently large $$n$$


 * $$ 0 < \frac{a^{2n+1}I_n\left(\frac\pi2\right)}{n!} < 1, $$

that is, we could find an integer between $$0$$ and $$1.$$ That is the contradiction that follows from the assumption that $$\pi$$ is rational.

This proof is similar to Hermite's proof. Indeed,


 * $$\begin{align}

J_n(x)&=x^{2n+1}\int_{-1}^1 (1 - z^2)^n \cos(xz)\,dz\\[5pt] &=2x^{2n+1}\int_0^1 (1 - z^2)^n \cos(xz)\,dz\\[5pt] &=2^{n+1}n!A_n(x). \end{align}$$

However, it is clearly simpler. This is achieved by omitting the inductive definition of the functions $$A_n$$ and taking as a starting point their expression as an integral.

Niven's proof
This proof uses the characterization of $$\pi$$ as the smallest positive zero of the sine function.

Suppose that $$\pi$$ is rational, i.e. $$\pi = a/b$$ for some integers $$a$$ and $$b$$ which may be taken without loss of generality to both be positive. Given any positive integer $$n,$$ we define the polynomial function:


 * $$ f(x) = \frac{x^n(a - bx)^n}{n!}$$

and, for each $$x \in \R$$ let


 * $$F(x) = f(x)-f''(x)+f^{(4)}(x)+\cdots+(-1)^n f^{(2n)}(x).$$

Claim 1: $$F(0) + F(\pi)$$ is an integer.

Proof: Expanding $$f$$ as a sum of monomials, the coefficient of $$x^k$$ is a number of the form $$c_k /n!$$ where $$c_k$$ is an integer, which is $$0$$ if $$k < n.$$ Therefore, $$f^{(k)}(0)$$ is $$0$$ when $$k < n$$ and it is equal to $$(k! / n!) c_k$$ if $n \leq k \leq 2n$; in each case, $$f^{(k)}(0)$$ is an integer and therefore $$F(0)$$ is an integer.

On the other hand, $$f(\pi-x) = f(x)$$ and so $$(-1)^kf^{(k)}(\pi-x) = f^{(k)}(x)$$ for each non-negative integer $$k.$$ In particular, $$(-1)^kf^{(k)}(\pi) = f^{(k)}(0).$$ Therefore, $$f^{(k)}(\pi)$$ is also an integer and so $$F(\pi)$$ is an integer (in fact, it is easy to see that $F(\pi) = F(0)$). Since $$F(0)$$ and $$F(\pi)$$ are integers, so is their sum.

Claim 2:


 * $$ \int_0^\pi f(x)\sin(x)\,dx=F(0)+F(\pi)$$

Proof: Since $$f^{(2n + 2)}$$ is the zero polynomial, we have


 * $$ F'' + F = f.$$

The derivatives of the sine and cosine function are given by sin' = cos and cos' = &minus;sin. Hence the product rule implies


 * $$ (F'\cdot\sin{} - F\cdot\cos{})' = f\cdot\sin$$

By the fundamental theorem of calculus


 * $$ \left. \int_0^\pi f(x)\sin(x)\,dx= \bigl(F'(x)\sin x - F(x)\cos x\bigr) \right|_0^\pi. $$

Since $$\sin 0 = \sin \pi = 0$$ and $$\cos 0 = - \cos \pi = 1$$ (here we use the above-mentioned characterization of $$\pi$$ as a zero of the sine function), Claim 2 follows.

Conclusion: Since $$f(x) > 0$$ and $$\sin x > 0$$ for $$0 < x < \pi$$ (because $$\pi$$ is the smallest positive zero of the sine function), Claims 1 and 2 show that $$F(0) + F(\pi)$$ is a positive integer. Since $$0 \leq x(a - bx) \leq \pi a$$ and $$0 \leq \sin x \leq 1$$ for $$0 \leq x \leq \pi,$$ we have, by the original definition of $$f,$$


 * $$\int_0^\pi f(x)\sin(x)\,dx\le\pi\frac{(\pi a)^n}{n!}$$

which is smaller than $$1$$ for large $$n,$$ hence $$F(0) + F(\pi) < 1$$ for these $$n,$$ by Claim 2. This is impossible for the positive integer $$F(0) + F(\pi).$$ This shows that the original assumption that $$\pi$$ is rational leads to a contradiction, which concludes the proof.

The above proof is a polished version, which is kept as simple as possible concerning the prerequisites, of an analysis of the formula


 * $$\int_0^\pi f(x)\sin(x)\,dx = \sum_{j=0}^n (-1)^j \left (f^{(2j)}(\pi)+f^{(2j)}(0)\right )+(-1)^{n+1}\int_0^\pi f^{(2n+2)}(x)\sin(x)\,dx,$$

which is obtained by $$2n + 2$$ integrations by parts. Claim 2 essentially establishes this formula, where the use of $$F$$ hides the iterated integration by parts. The last integral vanishes because $$f^{(2n+2)}$$ is the zero polynomial. Claim 1 shows that the remaining sum is an integer.

Niven's proof is closer to Cartwright's (and therefore Hermite's) proof than it appears at first sight. In fact,


 * $$\begin{align}

J_n(x)&=x^{2n+1}\int_{-1}^1(1-z^2)^n\cos(xz)\,dz\\ &=\int_{-1}^1\left (x^2-(xz)^2\right )^nx\cos(xz)\,dz. \end{align}$$

Therefore, the substitution $$xz = y$$ turns this integral into


 * $$\int_{-x}^x(x^2-y^2)^n\cos(y)\,dy.$$

In particular,


 * $$\begin{align}

J_n\left(\frac\pi2\right)&=\int_{-\pi/2}^{\pi/2}\left(\frac{\pi^2}4-y^2\right)^n\cos(y)\,dy\\[5pt] &=\int_0^\pi\left(\frac{\pi^2}4-\left(y-\frac\pi2\right)^2\right)^n\cos\left(y-\frac\pi2\right)\,dy\\[5pt] &=\int_0^\pi y^n(\pi-y)^n\sin(y)\,dy\\[5pt] &=\frac{n!}{b^n}\int_0^\pi f(x)\sin(x)\,dx. \end{align}$$

Another connection between the proofs lies in the fact that Hermite already mentions that if $$f$$ is a polynomial function and


 * $$F=f-f^{(2)}+f^{(4)}\mp\cdots,$$

then


 * $$\int f(x)\sin(x)\,dx=F'(x)\sin(x)-F(x)\cos(x)+C,$$

from which it follows that


 * $$\int_0^\pi f(x)\sin(x)\,dx=F(\pi)+F(0).$$

Bourbaki's proof
Bourbaki's proof is outlined as an exercise in his calculus treatise. For each natural number b and each non-negative integer $$n,$$ define


 * $$A_n(b)=b^n\int_0^\pi\frac{x^n(\pi-x)^n}{n!}\sin(x)\,dx.$$

Since $$A_n(b)$$ is the integral of a function defined on $$[0,\pi]$$ that takes the value $$0$$ at $$0$$ and $$\pi$$ and which is greater than $$0$$ otherwise, $$A_n(b) > 0.$$ Besides, for each natural number $$b,$$ $$A_n(b) < 1$$ if $$n$$ is large enough, because


 * $$ x(\pi-x) \le \left(\frac\pi2\right)^2$$

and therefore


 * $$A_n(b)\le\pi b^n \frac{1}{n!} \left(\frac\pi2\right)^{2n} = \pi \frac{(b\pi^2/4)^n}{n!}.$$

On the other hand, repeated integration by parts allows us to deduce that, if $$a$$ and $$b$$ are natural numbers such that $$\pi = a/b$$ and $$f$$ is the polynomial function from $$[0, \pi]$$ into $$\R$$ defined by


 * $$f(x)=\frac{x^n(a-bx)^n}{n!},$$

then:


 * $$\begin{align}

A_n(b) &= \int_0^\pi f(x)\sin(x)\,dx \\[5pt] &= \Big[{-f(x)\cos(x)}\Big]_{x=0}^{x=\pi} \,- \Big[{-f'(x) \sin(x)} \Big]_{x=0}^{x=\pi} + \cdots \\[5pt] &\ \qquad \pm \Big[ f^{(2n)}(x) \cos(x) \Big]_{x=0}^{x=\pi} \,\pm \int_0^\pi f^{(2n+1)}(x)\cos(x)\,dx. \end{align}$$

This last integral is $$0,$$ since $$f^{(2n+1)}$$ is the null function (because $$f$$ is a polynomial function of degree $2n$). Since each function $$f^{(k)}$$ (with $0 \leq k \leq 2n$) takes integer values at $$0$$ and $$\pi$$ and since the same thing happens with the sine and the cosine functions, this proves that $$A_n(b)$$ is an integer. Since it is also greater than $$0,$$ it must be a natural number. But it was also proved that $$A_n(b) < 1$$ if $$n$$ is large enough, thereby reaching a contradiction.

This proof is quite close to Niven's proof, the main difference between them being the way of proving that the numbers $$A_n(b)$$ are integers.

Laczkovich's proof
Miklós Laczkovich's proof is a simplification of Lambert's original proof. He considers the functions


 * $$f_k(x) = 1 - \frac{x^2}k+\frac{x^4}{2! k(k+1)}-\frac{x^6}{3! k(k+1)(k+2)} + \cdots \quad (k\notin\{0,-1,-2,\ldots\}).$$

These functions are clearly defined for any real number $$x.$$ Besides


 * $$f_{1/2}(x) = \cos(2x),$$
 * $$f_{3/2}(x) = \frac{\sin(2x)}{2x}.$$

Claim 1: The following recurrence relation holds for any real number $x$:


 * $$\frac{x^2}{k(k+1)}f_{k+2}(x)=f_{k+1}(x)-f_k(x).$$

Proof: This can be proved by comparing the coefficients of the powers of $$x.$$

Claim 2: For each real number $$x,$$


 * $$\lim_{k\to+\infty}f_k(x)=1.$$

Proof: In fact, the sequence $$x^{2n}/n!$$ is bounded (since it converges to $0$) and if $$C$$ is an upper bound and if $$k > 1,$$ then


 * $$\left|f_k(x)-1\right|\leqslant\sum_{n=1}^\infty\frac C{k^n}=C\frac{1/k}{1-1/k}=\frac C{k-1}.$$

Claim 3: If $$x \neq 0,$$ $$x^2$$ is rational, and $$ k\in\Q\smallsetminus\{0,-1,-2,\ldots\}$$ then


 * $$f_k(x)\neq0 \quad \text{ and } \quad \frac{f_{k+1}(x)}{f_k(x)}\notin\Q.$$

Proof: Otherwise, there would be a number $$y \neq 0$$ and integers $$a$$ and $$b$$ such that $$f_k(x) = ay$$ and $$f_{k+1}(x) = by.$$ To see why, take $$y = f_{k+1}(x),$$ $$a = 0,$$ and $$b = 1$$ if $f_k(x) = 0$; otherwise, choose integers $$a$$ and $$b$$ such that $$f_{k+1}(x) / f_k(x) = b/a$$ and define $$y = f_k(x)/a = f_{k+1}(x)/b.$$ In each case, $$y$$ cannot be $$0,$$ because otherwise it would follow from claim 1 that each $$f_{k+n}(x)$$ ($$n \in \N$$) would be $$0,$$ which would contradict claim 2. Now, take a natural number $$c$$ such that all three numbers $$bc/k,$$ $$ck/x^2,$$ and $$c/x^2$$ are integers and consider the sequence


 * $$g_n=\begin{cases}f_k(x) & n=0\\ \dfrac{c^n}{k(k+1)\cdots(k+n-1)}f_{k+n}(x) & n \neq 0 \end{cases}$$

Then


 * $$g_0=f_k(x)=ay\in\Z y \quad \text{ and } \quad g_1=\frac ckf_{k+1}(x)=\frac{bc}ky\in\Z y.$$

On the other hand, it follows from claim 1 that


 * $$\begin{align}

g_{n+2}&=\frac{c^{n+2}}{x^2k(k+1)\cdots(k+n-1)}\cdot\frac{x^2}{(k+n)(k+n+1)}f_{k+n+2}(x)\\[5pt] & =\frac{c^{n+2}}{x^2k(k+1)\cdots(k+n-1)}f_{k+n+1}(x)-\frac{c^{n+2}}{x^2k(k+1)\cdots(k+n-1)}f_{k+n}(x)\\[5pt] &=\frac{c(k+n)}{x^2}g_{n+1}-\frac{c^2}{x^2}g_n\\[5pt] &=\left(\frac{ck}{x^2}+\frac c{x^2}n\right)g_{n+1}-\frac{c^2}{x^2}g_n, \end{align}$$

which is a linear combination of $$g_{n+1}$$ and $$g_n$$ with integer coefficients. Therefore, each $$g_n$$ is an integer multiple of $$y.$$ Besides, it follows from claim 2 that each $$g_n$$ is greater than $$0$$ (and therefore that $g_n \geq if $$n$$ is large enough and that the sequence of all $$g_n$$ converges to $$0.$$ But a sequence of numbers greater than or equal to $$|y|$$ cannot converge to $$0.$$

Since $$f_{1/2}(\tfrac14\pi) = \cos \tfrac12\pi = 0,$$ it follows from claim 3 that $$\tfrac1{16}\pi^2$$ is irrational and therefore that $$\pi$$ is irrational.

On the other hand, since


 * $$\tan x=\frac{\sin x}{\cos x}=x\frac{f_{3/2}(x/2)}{f_{1/2}(x/2)},$$

another consequence of Claim 3 is that, if $$x \in \Q \smallsetminus \{0\},$$ then $$\tan x$$ is irrational.

Laczkovich's proof is really about the hypergeometric function. In fact, $$f_k(x) = {}_0F_1 (k - x^2)$$ and Gauss found a continued fraction expansion of the hypergeometric function using its functional equation. This allowed Laczkovich to find a new and simpler proof of the fact that the tangent function has the continued fraction expansion that Lambert had discovered.

Laczkovich's result can also be expressed in Bessel functions of the first kind $J_\nu(x)$. In fact, $$\Gamma(k)J_{k-1}(2x) = x^{k-1}f_k(x)$$ (where $$\Gamma$$ is the gamma function). So Laczkovich's result is equivalent to: If $$x \neq 0,$$ $$x^2$$ is rational, and $$k\in\Q\smallsetminus\{0,-1,-2,\ldots\}$$ then


 * $$\frac{x J_k(x)}{J_{k-1}(x)}\notin\Q.$$