π is irrational

We have already proved that e is irrational (see the example in this post!)
The fact that \pi is irrational, i.e. there are no integers a,b such that \displaystyle \pi=\frac{a}{b}, was discovered a couple of hundreds of years ago and there are several proofs of this result; I like Ivan Niven’s proof better and that’s what I’m going to explain here.

Throughout this post, f^{(k)}(a) is the k-th derivative of a function f(x) at x=a.

Problem 1. Let P(x) be a polynomial of degree 2n. Show that

\displaystyle \int_0^{\pi} P(x) \sin x \ dx = \sum_{k=0}^n (-1)^k(P^{(2k)}(0)+P^{(2k)}(\pi)).

Solution. The proof is by induction over n. If n=0, then P(x)=p is a constant and so \displaystyle \int_0^{\pi} P(x) \sin x \ dx=p\int_0^{\pi} \sin x \ dx = 2p=P(0)+P(\pi).
Now suppose the equality in the problem holds for polynomials of degree 2n and let P(x) be a polynomial of degree 2n+2. Then using integration by parts with P(x)=u and \sin x \ dx = dv gives

\displaystyle \int_0^{\pi} P(x) \sin x \ dx = P(0)+P(\pi)+\int_0^{\pi}P'(x)\cos x \ dx. \ \ \ \ \ \ \ \ \ \ \ \ \ (1)

Now, in (1), we use integration by parts again, this time with P(x)=u and \cos x \ dx = dv to get

\displaystyle \int_0^{\pi} P(x) \sin x \ dx = P(0)+P(\pi)-(P'(0)+P'(\pi)) + \int_0^{\pi} P''(x) \sin x \ dx. \ \ \ \ \ \ \ \ \ \ \ \ (2)

But since P''(x) is a polynomial of degree 2n, we can use our induction hypothesis to write \displaystyle \int_0^{\pi} P''(x) \sin x \ dx= \sum_{k=0}^n (-1)^k(P^{(2k+2)}(0)+P^{(2k+2)}(\pi)) and so (2) becomes

\displaystyle \begin{aligned} \int_0^{\pi} P(x) \sin x \ dx = P(0)+P(\pi)-(P'(0)+P'(\pi)) + \sum_{k=0}^n (-1)^k(P^{(2k+2)}(0)+P^{(2k+2)}(\pi)) \\ = \sum_{k=0}^{n+1} (-1)^k(P^{(2k)}(0)+P^{(2k)}(\pi)). \ \Box \end{aligned}

Problem 2. Let n,a,b be integers with n \ge 1 and b \ne 0. Let \displaystyle c:=\frac{a}{b} and

\displaystyle P(x):=\frac{x^n(a-bx)^n}{n!}.

Show that P^{(k)}(0) and P^{(k)}(c) are integers for all k \ge 0.

Solution. Since P(x) is a polynomial of degree 2n, we have P^{(k)}(x)=0 for all x and k > 2n and so there is nothing to prove for k > 2n.
Now, since P(x) is a polynomial of degree 2n, we have

\displaystyle P(x)=\sum_{k=0}^{2n} \frac{P^{(k)}(0)}{k!}x^k. \ \ \ \ \ \ \ \ \ \ \ \ \ (1)

On the other hand, using the binomial theorem, it is clear that

\displaystyle P(x)=\frac{x^n(a-bx)^n}{n!}=\sum_{k=n}^{2n}\frac{p_k}{n!}x^k, \ \ \ \ \ \ \ \ \ \ \ \ \ \ (2)

where p_k are some integers.
So (1) and (2) together give P^{(k)}(0)=0 for 0 \le k \le n-1 and \displaystyle P^{(k)}(0)=\frac{k!}{n!}p_k for n \le k \le 2n. Thus, since \displaystyle \frac{k!}{n!} is an integer for k \ge n, we have proved that P^{(k)}(0) is an integer for all k \ge 0.
Finally, since P(c-x)=P(x), we have (-1)^kP^{(k)}(c-x)=P^{(k)}(x) for all k \ge 0 and thus (-1)^kP^{(k)}(0)=P^{(k)}(c). So P^{(k)}(c) is an integer because we have already proved that P^{(k)}(0) is an integer. \Box

Problem 3. Show that \pi is irrational.

Solution (Ivan Niven). Suppose, to the contrary, that \pi is rational and put \displaystyle \pi=\frac{a}{b}, where a,b > 0 are integers. Let n \ge 1 be an integer and put

\displaystyle P(x):=\frac{x^n(a-bx)^n}{n!}.

Then by Problem 1 and 2, \displaystyle \int_0^{\pi} P(x) \sin x \ dx must be an integer. But we are now going to prove that if n is large enough, then \displaystyle \int_0^{\pi} P(x) \sin x \ dx is not an integer and this contradiction proves that our assumption that \pi is rational is false.
First note that, on the interval [0,\pi], we have

\displaystyle 0 \le P(x)\sin x \le P(x) =\frac{b^nx^n(\pi - x)^n}{n!} \le \frac{b^n \pi^{2n}}{n!}=\frac{(b \pi^2)^n}{n!}

and thus

\displaystyle 0 < \int_0^{\pi} P(x)\sin x \ dx \le \frac{(b \pi^2)^n}{n!} \pi. \ \ \ \ \ \ \ \ \ \ (*)

(Note that \displaystyle \int_0^{\pi} P(x)\sin x \ dx \ne 0 because P(x) \sin x is not identically zero on [0, \pi]).
But for every real number r, we have \displaystyle \lim_{n\to\infty} \frac{r^n}{n!}=0 because the series \displaystyle \sum_{n=0}^{\infty} \frac{r^n}{n!} is convergent (to e^r). So \displaystyle \lim_{n\to\infty} \frac{(b \pi^2)^n}{n!} \pi=0. Hence, if n is large enough, we will have \displaystyle \frac{(b \pi^2)^n}{n!} \pi  < 1 and thus, by (*),

\displaystyle 0 < \int_0^{\pi} P(x)\sin x \ dx < 1.

Therefore \displaystyle \int_0^{\pi} P(x)\sin x \ dx is not an integer if n is large enough. \Box

Remark. Another way to say that a real number t is irrational is to say that t is not the root of a polynomial of degree one with integer coefficients. If t is not a root of any polynomial with integer coefficients, then t is called transcendental. Clearly every transcendental number is irrational. It is known that both e and \pi are in fact transcendental.

Exercise 1. Let P(x) be a polynomial of degree 2n+1. Show that

\displaystyle \int_0^{\pi} P(x) \sin x \ dx = \sum_{k=0}^n (-1)^k(P^{(2k)}(0)+P^{(2k)}(\pi)).

Exercise 2. Show that the inequality (*) in the solution of Problem 3 can be improved by proving that \displaystyle \int_0^{\pi} P(x)\sin x \ dx \le \frac{(b \pi^2)^n}{4^n n!} \pi.