# 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 {\pi }{4}}=1$, it follows that ${\tfrac {\pi }{4}}$ 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 \mathbb {N} _{0}$ defined by:
    ${\begin{aligned}A_{0}(x)&=\sin(x),&&A_{n+1}(x)=\int _{0}^{x}yA_{n}(y)\,dy\\[4pt]U_{0}(x)&={\frac {\sin(x)}{x}},&&U_{n+1}(x)=-{\frac {U_{n}'(x)}{x}}\end{aligned}}$
Using induction we can prove that
    ${\begin{aligned}A_{n}(x)&={\frac {x^{2n+1}}{(2n+1)!!}}-{\frac {x^{2n+3}}{2\times (2n+3)!!}}+{\frac {x^{2n+5}}{2\times 4\times (2n+5)!!}}\mp \cdots \\[4pt]U_{n}(x)&={\frac {1}{(2n+1)!!}}-{\frac {x^{2}}{2\times (2n+3)!!}}+{\frac {x^{4}}{2\times 4\times (2n+5)!!}}\mp \cdots \end{aligned}}$
and therefore we have:
    $U_{n}(x)={\frac {A_{n}(x)}{x^{2n+1}}}.\,$
So
    ${\begin{aligned}{\frac {A_{n+1}(x)}{x^{2n+3}}}&=U_{n+1}(x)=-{\frac {U_{n}'(x)}{x}}=-{\frac {1}{x}}{\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{aligned}}$
which is equivalent to
    $A_{n+1}(x)=(2n+1)A_{n}(x)-x^{2}A_{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)+xQ_{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 }{\tfrac {1}{2}}n{\bigr \rfloor }.$ In particular, $A_{n}{\bigl{\tfrac {1}{2}}\pi {\bigr )}=P_{n}{\bigl{\tfrac {1}{4}}\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(xz)\,\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^{n}n!}}\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{aligned}&{\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}^{1}2(n+1)\left(1-z^{2}\right)^{n}z{\frac {\sin(xz)}{x}}\,\mathrm {d} z{\Biggr )}\\[8pt]&\qquad ={\frac {1}{x}}\cdot {\frac {1}{2^{n}n!}}\int _{0}^{1}\left(1-z^{2}\right)^{n}z\sin(xz)\,\mathrm {d} z\\[8pt]&\qquad =-{\frac {1}{x}}\cdot {\frac {\mathrm {d} }{\mathrm {d} x}}\left({\frac {1}{2^{n}n!}}\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{aligned}}$
If ${\tfrac {1}{4}}\pi ^{2}=p/q,$ with $p$ and $q$ in $\mathbb {N}$, then, since the coefficients of $P_{n}$ are integers and its degree is smaller than or equal to ${\bigl \lfloor }{\tfrac {1}{2}}n{\bigr \rfloor },$ $q^{\lfloor n/2\rfloor }P_{n}{\bigl{\tfrac {1}{4}}\pi ^{2}{\bigr )}$ is some integer $N.$ In other words,
    $N=q^{\lfloor n/2\rfloor }{A_{n}}{\bigl{\tfrac {1}{2}}\pi {\bigr )}=q^{\lfloor n/2\rfloor }{\frac {1}{2^{n}n!}}\left({\dfrac {p}{q}}\right)^{n+{\frac {1}{2}}}\int _{0}^{1}(1-z^{2})^{n}\cos \left({\tfrac {1}{2}}\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^{2}I_{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^{2}J_{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 \mathbb {Z} _{+},$
    $J_{n}(x)=x^{2n+1}I_{n}(x)=n!{\biglP_{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={\tfrac {1}{2}}\pi ,$ and suppose if possible that ${\tfrac {1}{2}}\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{\tfrac {1}{2}}\pi {\bigr )}=P_{n}{\bigl{\tfrac {1}{2}}\pi {\bigr )}b^{2n+1}.$
The right side is an integer. But $0<I_{n}{\bigl{\tfrac {1}{2}}\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 {\pi }{2}}\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{aligned}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{aligned}}$
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 \mathbb {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)^{k}f^{(k)}(\pi -x)=f^{(k)}(x)$ for each non-negative integer $k.$ In particular, $(-1)^{k}f^{(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' = −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={\biglF'(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\leq \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{aligned}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)^{n}x\cos(xz)\,dz.\end{aligned}}$
Therefore, the substitution $xz=y$ turns this integral into
    $\int _{-x}^{x}(x^{2}-y^{2})^{n}\cos(y)\,dy.$
In particular,
    ${\begin{aligned}J_{n}\left({\frac {\pi }{2}}\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 {\pi }{2}}\right)^{2}\right)^{n}\cos \left(y-{\frac {\pi }{2}}\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{aligned}}$
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)\leq \left({\frac {\pi }{2}}\right)^{2}$
and therefore
    $A_{n}(b)\leq \pi b^{n}{\frac {1}{n!}}\left({\frac {\pi }{2}}\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 $\mathbb {R}$ defined by
    $f(x)={\frac {x^{n}(a-bx)^{n}}{n!}},$
then:
    ${\begin{aligned}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 {\Bigf^{(2n)}(x)\cos(x){\Big ]}_{x=0}^{x=\pi }\,\pm \int _{0}^{\pi }f^{(2n+1)}(x)\cos(x)\,dx.\end{aligned}}$
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 \mathbb {Q} \smallsetminus \{0,-1,-2,\ldots \}$ then
    $f_{k}(x)\neq 0\quad {\text{ and }}\quad {\frac {f_{k+1}(x)}{f_{k}(x)}}\notin \mathbb {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 \mathbb {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 \mathbb {Z} y\quad {\text{ and }}\quad g_{1}={\frac {c}{k}}f_{k+1}(x)={\frac {bc}{k}}y\in \mathbb {Z} y.$
On the other hand, it follows from claim 1 that
    ${\begin{aligned}g_{n+2}&={\frac {c^{n+2}}{x^{2}k(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^{2}k(k+1)\cdots (k+n-1)}}f_{k+n+1}(x)-{\frac {c^{n+2}}{x^{2}k(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{aligned}}$
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 |y|$) 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}({\tfrac {1}{4}}\pi )=\cos {\tfrac {1}{2}}\pi =0,$ it follows from claim 3 that ${\tfrac {1}{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 \mathbb {Q} \smallsetminus \{0\},$ then $\tan x$ is irrational.
Laczkovich's proof is really about the hypergeometric function. In fact, $f_{k}(x)=_{0}F_{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 \mathbb {Q} \smallsetminus \{0,-1,-2,\ldots \}$ then
    ${\frac {xJ_{k}(x)}{J_{k-1}(x)}}\notin \mathbb {Q} .$