# Prove that the square root of a positive integer is either an integer or irrational

Is my proof that the square root of a positive integer is either an integer or an irrational number correct?

The proof goes like this:

Suppose an arbitrary number n, where n is non-negative. If $\sqrt{n}$ is an integer, then $\sqrt{n}$ must be rational. Since $\sqrt{n}$ is an integer, we can conclude that n is a square number, that is for some integer a. Therefore, if n is a square number, then $\sqrt{n}$ is rational.

Suppose now that n is not a square number, we want to show that the square root of any non-square number is irrational.

We prove by contradiction. That is, we suppose that the square root of any non-square number is rational. So $\sqrt{n} = \frac{a}{b}$, where $a,b \in Z^+, b \neq 0$. We also suppose that $a \neq 0$, otherwise $\frac ab = 0$ , and n will be a square number, which is rational.

Hence $n = \frac {a^2}{b^2}$, so $nb^2 = a^2$.

Suppose $b=1$. Then $\sqrt n = a$ , which shows that n is a square number. So $b \neq 1$. Since $\sqrt n > 1$, then $a>b>1$.

By the unique factorization of integers theorem, every positive integer greater than $1$ can be expressed as the product of its primes. Therefore, we can write $a$ as a product of primes and for every prime number that exists in $a$, there will be an even number of primes in $a^2$. Similarly, we can express $b$ as a product of primes and for every prime number that exists in $b$, there will be an even number of primes in $b^2$.

However, we can also express $n$ as a product of primes. Since $n$ is not a square number, then there exist at least one prime number that has an odd number of primes. Therefore, there exists at least one prime in the product of $nb^2$ that has an odd number of primes. Since $nb^2=a^2$ , then this contradicts the fact that there is an even number of primes in $a^2$ since a number can neither be even and odd.

Therefore, this contradicts the fact that $\sqrt n$ is rational. Therefore, $\sqrt n$ must be irrational.

Is this sufficient? Or is there any parts I did not explain well?

• I think its correct and very well explained. – Shobhit Jan 30 '17 at 14:25
• It's a bit wordy, but logically you've got a solid proof, the even-ness of the powers of each prime is exactly what you're going for. – Adam Hughes Jan 30 '17 at 14:26
• The conclusion is not precise enough. Instead of "contradicts there is an even number of primes in $a^2$" we want to say that it contradicts the fact that the prime $p$ occurs to odd power in the unique factorization of $nb^2,\,$ but even power in $a^2,\,$ i.e. we are comparing the parity of the count of single prime, not the total of all primes – Number Jan 30 '17 at 14:28
• For example the argument shows that $\,\sqrt{3\cdot 5}\,$ is irrational because $\,3\,$ occurs to odd power in $\,3\cdot 5,\,$ but the total number of primes in $\,3\cdot 5\,$ is even. – Number Jan 30 '17 at 14:37
• On a side note, this result is known as Theaetetus' Theorem, and it's proven in Euclid's Elements here: aleph0.clarku.edu/~djoyce/elements/bookX/propX9.html "[S]quares which do not have to one another the ratio which a square number has to a square number also do not have their sides commensurable in length either." – Keshav Srinivasan Jan 30 '17 at 14:41

Your proof is very good and stated well. I think it can be made shorter and tighter with a little less exposition of the obvious. However, I would prefer students to err on the side of more rather than less so I can't chide you for being thorough. But if you want a critique:

"Suppose an arbitrary number n, where n is non-negative. If $\sqrt{n}$ is an integer, then $\sqrt{n}$ must be rational. Since $\sqrt{n}$ is an integer, we can conclude that n is a square number, that is for some integer a. Therefore, if n is a square number, then $\sqrt{n}$ is rational."

Suppose now that n is not a square number, we want to show that the square root of any non-square number is irrational.

This can all be said more simply and to argue that if $\sqrt{n}$ is an integer we can conclude $\sqrt{n}$ is rational or that $n$ is therefore a perfect square, is a little heavy handed. Those are definitions and go without saying. However, it shows good insight and understanding to be aware one can assume things and all claims need justification so I can't really call this "wrong".

But it'd be enough to say. "If $n$ is a perfect square then $\sqrt{n}$ is a an integer and therefore rational, so it suffices to prove that if $n$ is not a perfect square, then $\sqrt{n}$ is irrational.

We prove by contradiction. That is, we suppose that the square root of any non-square number is rational. So $\sqrt{n}$=ab , where a,b∈Z+,b≠0. We also suppose that a≠0, otherwise ab=0, and n will be a square number, which is rational.

Terminologistically, to say "$n$ is a square number" is to mean $n$ is the square of an integer. If $n = (\frac ab)^2$ we don't usually refer to $n$ as a square (although it is "a square of a rational") We'd never call $13$ a square because $13 = (\sqrt{13})^2$.

Also you don't make the usual specification that $a$ and $b$ have no common factors. As it turns out you didn't need to but it is a standard.

Suppose b=1 . Then $\sqrt{n}$=a , which shows that n is a square number. So b≠1. Since $\sqrt{n}$>1, then a>b>1

This was redundant as $b=1 \implies$ $a/b$ is an integer and we are assuming that $n$ is not a perfect square.

.

By the unique factorization of integers theorem, every positive integer greater than 1 can be expressed as the product of its primes. Therefore, we can write a as a product of primes and for every prime number that exists in a, there will be an even number of primes in a2. Similarly, we can express b as a product of primes and for every prime number that exists in b, there will be an even number of primes in b2

Bill Dubuque in the comments noted what you meant to say was "each prime factor will be raised to any even power".

.

However, we can also express n as a product of primes. Since n is not a square number, then there exist at least one prime number that has an odd number of primes. Therefore, there exists at least one prime in the product of nb2 that has an odd number of primes. Since nb2=a2 , then this contradicts the fact that there is an even number of primes in a2 since a number can neither be even and odd.

Ditto:

Overall I think your proof is very good.

But I should point out there is a simpler one:

Assume $n = \frac {a^2}{b^2}$ where $a,b$ are positive integers with no common factors (other than 1). If $p$ is a prime factor of $b$ and $n$ is an integer, it follows that $p$ is a prime factor of $a^2$ and therefore of $a$. But that contradicts $a$ and $b$ having no common factors. So $b$ can not have any prime factors. But the only positive integer without prime factors is $1$ so $b = 1$ and $n= a^2$ so $\sqrt{n} = a$. So either for any integer either $n$ is a perfect square with an integer square root, or $n$ does not have a rational square root.

And a slight caveat: I'm assuming that your class or text is assuming that all real numbers have square roots (and therefore if there is not rational square root the square root must be irrational). It's worth pointing out, that it is a result of real analysis that speaking of a square root actually makes any sense and that we can claim every positive real number actually does have same square root value. But that's probably beyond the range of this exercise.

But if I want to be completely accurate, you (and I) have actually only proven that positive integer $n$ either has an integer square root or it has no rational square root at all. Which is the same thing as saying if positive integer $n$ has a square root, the root is either integer or irrational. But we have not actually proven that positive integer $n$ actually has any square root at all.

• Thank you for the critique! It definitely helped me a lot! – Icycarus Jan 31 '17 at 11:00
• Can you explain or state a case where we cannot find the square root of a positive integer $n$ (as you state in the last line)? – Astrobleme Apr 15 '17 at 12:56
• I didn't say there are positive integers without square roots. (There aren't.) I said we haven''t proven that the square root of any integer exists. And we haven't. To prove that we have to prove that $K = \{q \in \mathbb Q| q^2 < n\}$ is not empty, and bounded above and that if $z = \sup K$ then $z^2 - n$. All we have proven so far is that either there is an integer so that $m^2 = n$ or there is no rational $q$ so that $q^2 = n$. We have not proven that there is an irrational $z$ so that $z^2 = n$. – fleablood Apr 15 '17 at 15:54
• Proving that the square root of 17 isn't rational isn't the same thing as proving the square root of 17 is irrational, in the same way as proving the easter bunny is not aquatic is not the same thing as proving the easter bunny is land dwelling. – fleablood Apr 15 '17 at 15:58
• Square roots must exist because i) the real numbers are a continuum. (which the rationals are not) and because $z^2$ is continuous and increasing and unbounded on positive reals. So if $w^2 < n$ (and there is always such a w) and $y^2 > n$ (and there is always such a y) then $0 < w < y$ and there has to be a $z$ so that $w < z < y$ and $z^2 = n$. But we haven't proven that at all. Indeed, we haven't even discussed what irrational numbers are. Saying irrational numbers are numbers that aren't rational. Is like saying fairies are people that are not animals. – fleablood Apr 15 '17 at 16:08

We know that $\sqrt{4} = 2$ and $\sqrt{2} = 1.414...$ are rational and irrational respectively, so all we have to do is to show that if $n\in \mathbb{Z+}$ such that $\sqrt{n} = \dfrac{a}{b}$ where $a$ and $b$ are positive integers and the expression $\dfrac{a}{b}$ is in its simplest form then $\sqrt{n}$ is integral. Squaring both sides of the expression we get that $n = \dfrac{a^2}{b^2}$ since $a$ and $b$ have no common factors other than $1$ then $a^2 = n$ and $b^2 = 1$ therefore $b = 1$ hence $\sqrt{n}$ if rational it's an integer.

• How is that a critique of the OP's proof? – fleablood Jan 30 '17 at 18:51
• The problem lies in the first paragraph, the op argues that if $\sqrt{n}$ is an integer then it is rational which is very true but the op does not show that all the rational square roots to be integers in fact the op shows that the square roots are either rational or irrational which is obvious. Moreover the op in the second paragraph assumes that $n$ is not a square number which does not make sense as all integers have square roots but this roots are integral or irrational. – Tom Carter Jan 30 '17 at 20:27
• The op shows (correctly) that the square root of a non square is irrational. There is no need to show that rational roots are integers. Assuming n is not square makes perfect sense and the case for square n's has been covered. Your objections are not valid. Meanwhile you post is just ... weird. What do $\sqrt 4$ and $\sqrt 2$ have to do with anything. And your statement $n = a^2/b^2$ implies $a^2 = n$ and $b^2 =1$ is said without justification when the justification is the entire point. And you are merely pointing out an easier proof. Which is not a valid critique. – fleablood Jan 30 '17 at 22:57
• The purpose for showing that $\sqrt{4}$ and $\sqrt{2}$ are rational and irrational respectively was to show just that there are rational and irrational square roots so the only exercise left was to show that the rational roots are always integers. Secondly I already pointed out that in $\dfrac{a}{b}$ , $a$ and $b$have no common factors and therefore their squares will certainly have no common but we are equating this square $n$ which might as well be written as $\dfrac{n}{1}$ that's where my conclusion where $b = 1$ and $a = \sqrt{n}$ arises from. – Tom Carter Jan 31 '17 at 6:31
• I believe if you reread the op's post you especially the areas I pointed out you will understand where my problem arises but as you said before I was only simplifying the post and corrected the few areas which I thought needed to be repaired. – Tom Carter Jan 31 '17 at 6:34