Analytic proof of $\sqrt{n}$ irrationality or integrality

Basic arithmetics (uniqueness of prime factorization) tells us that, for $n\in \mathbb N$, either $\alpha:=\sqrt{n}$ is an integer or is an irrational. While designing undergraduate exams, I wondered if there was some elementary, calculus-based proof of that fact.

First I tried an approach along the lines of Niven's proof of the irrationality of $\pi$. The proof studies the family of polynomials $P_k(x):=\frac{1}{k!}(qx(p-qx))^k$ for $p,q\in \mathbb N$. Assuming $\pi=\frac{p}{q}$ leads to a contradiction, since the sequence of integrals $\int_0^{p/q}P_k(t)\sin(t)~dt$ is both positive, integral and tending to $0$. But this works out nicely because of the differential relations satisfied by sin (that come in an essential way in integrating by parts). This argument works as well for any function with nice, linear differential relations with integers coefficients (e.g. exp). Unfortunately, this is not so easy with, say, $x^2-2$. Or I missed something obvious.

In the same spirit I tried to study various sequences of integrals related to $x^2 -2$, but to no avail. Or, again, I missed something obvious :)

Another way I explored is to study $f(x):=x^\alpha$ from the point of view of functional equations. Assuming $\alpha=\frac{p}{q}$ is rational, we both have $$\cases{f\circ f(x)=x^n\\qf'(x)=pf(x)}$$ If an $f$ satisifies these constraints then, using Faà Di'Bruno formula, we can painstakingly prove the claim by observing that after differentiating $k$ times we have a relationship where $f^{(k)}$ appears alone only if $k$ is a square. One can arrange to prove that this condition is exactly the sought one: if $\alpha^2=n$ then this must be read at the $k=n$-th step.

Although the latter idea works well, it is way from being elementary! (In particular, the exam talked about something else entirely ;) ) So I ask the question here: does anybody know a more elementary analytic proof?

• Usually, that's shown using unique prime factorization, though that's heavy artillery for fighting a fly. And now, you're looking for nukes?!
– user436658
Dec 24 '17 at 10:50
• Right, global annihilation is my aim ;) I know the usual arithmetical argument, but I taught calculus this term, so I thought I'd go for something original. I didn't know it would turn out so messy ! Dec 24 '17 at 11:27
• Well, if $n\in\mathbb{N}^+$ is not a square, by Lagrange's theorem the continued fraction of $\sqrt{n}$ is eventually periodic, in particular $\sqrt{n}\not\in\mathbb{Q}$ since the elements of $\mathbb{Q}^+$ are in bijection with the finite continued fractions. For instance $$\varphi=[1;\overline{1}],\quad \sqrt{2}=[1;\overline{2}],\quad \sqrt{3}=[1;\overline{1,2}],\quad \sqrt{6}=[2;\overline{2,3}]$$ and so on. The convergents of $\varphi$ and $\sqrt{2}$ are related to Fibonacci and Pell numbers. For $e$ we have a similar situation, Dec 24 '17 at 13:56
• $e=[2;1,2,1,1,4,1,1,6,1,1,8,1,1,10,\ldots]$, and the convergents depend on the integrals $\int_{-1}^{1}P_n(x)e^x\,dx$ or on the integrals $\int_{0}^{1}x^n(1-x)^m e^{-x}\,dx$. Dec 24 '17 at 13:56
• What do you mean by "analytic proof"? Will this one, based on Bézout’s theorem, qualify as such? Dec 24 '17 at 15:08