# Let $n$ be a positive integer Prove that if $\sqrt {n}$ is a rational number then it is actually an integer.

Actually, it is obvious. But, I could not prove. Can you hint?

• Hint: use (or prove) the rational root theorem for $x^2 - n = 0$.
– dxiv
Oct 10 '16 at 0:52
• Proof trying. if $\sqrt {n}$ is rational number then we can write $\sqrt {n}=\dfrac {a} {b}$ (as n is a positive integer) for $a\in\mathbb{Z}$ and $0\neq b\in \mathbb{Z}$. Then, $n =\dfrac {a^{2}} {b^{2}}=\left( \dfrac {a} {b}\right) ^{2}$. So....
– user295645
Oct 10 '16 at 0:58
• So... What should I do for continuity?
– user295645
Oct 10 '16 at 1:08
• Actullay, (for continuity) so, we know $n$ is positive integer (by the assumption), i.e., it is a integer. i.e., $n=\dfrac {a^{2}} {b^{2}}=\left( \dfrac {a} {b}\right) ^{2}$ is a integer, i.e., $\sqrt {n}=\dfrac {a} {b}$ integer. i.e., $\sqrt {n}$ is actually an integer. We are done, are not we?
– user295645
Oct 10 '16 at 1:13
• @JosephWood Do we need to have $b / a$?
– user295645
Oct 10 '16 at 1:16

Assume $\sqrt{n} \in \mathbb{Q}$ where $n \in \mathbb{Z}$.

This means we can write $\sqrt{n}$ as a fraction. That is,

$$\sqrt{n}= \frac{a}{b}$$

where $\space a,b \in \mathbb{Z}$. From this, we can square both sides and rearrange to obtain the following:

$$n = \bigl(\frac{a}{b}\bigr)^{2} = \frac{a^{2}}{b^{2}} \implies b^{2}n = a^{2}$$

This is the definition of divisibility. That is:

$$b^{2} | a^{2}$$

By the fundamental theorem of arithmetic, we must have the following:

$$b | a$$

See this post for more information. This means that there exist an integer, say $m$, such that $bm = a$ which gives us:

$$\frac{a}{b} = \frac{bm}{b} = m \in \mathbb{Z}$$

Thus, $\sqrt{n} = \frac{a}{b} = m \in \mathbb{Z} \space\space \square$.

Here is a generalisation, you can take $k = 2$. Assume that $\sqrt[k]n = p/q$ where $p, q$ are nonzero coprime integers. If $nq^k = p^k$, $p^k$ must divide $n$ (that's a consequence of fundamental theorem of arithmetic). So $n = n' p^k$, $n'$ is again an integer and $n' q^k = 1$, so $n' = 1$ and $\sqrt[k] n = p$.

Set $n=p_1^{e_1}\cdots p_n^{e_n}$. If each $e_j$ is even then the claim holds. Otherwise there is at lease one odd $e_j$. Suppose WLOG that the odd $e_j's$ are $e_1,\ldots,e_k,\ k\leq n$. Then $\sqrt n=m\sqrt{p_1\cdots p_k}$ for some $m\in\mathbb{N}$ and it is enough to show that $\sqrt{p_1\cdots p_k}$ is irrational; if $\sqrt{p_1\cdots p_k}=\frac{a}{b}$ for some $a,b\in\mathbb{N}$, then $p_1\cdots p_n b^2=a^2$, which is a contradiction (with the fundamental theorem of arithmetic) since the power of $p_1$ is odd in the LHS but even in the RHS.

If $$A\subseteq B$$ where $$B$$ is a finite set, then $$A$$ is a finite set and $$|A| \le |B|$$.

• Welcome to MSE. What has that to do with the question? Oct 4 '20 at 8:59