# If $\sqrt{n}$ is not an integer, are there any rational numbers $x$ such that $x^2 = n$? [duplicate]

I have a feeling this has something to do with prime numbers, but I'm totally lost. I'm not sure how to write the proof that proves (or disproves) the following: "Let $n$ be an integer. If $\sqrt{n}$ is not an integer, then there is no rational number $x$ such that $x^2 = n$."

• No. The argument is pretty much the same as the case $n=2$. Commented Sep 9, 2015 at 3:35
• Are you requiring that $n$ be a natural number or integer? Or can $n$ be any rational number? This sort of information should be included the first time the question is posted. Commented Sep 9, 2015 at 3:39
• The statement simply requests that I prove or disprove that there is "no rational number x such that x^2 = n" Commented Sep 9, 2015 at 3:41
• I think we can assume $n$ is an integer based on the fact that the statement is plain wrong otherwise, as @turkeyhundt pointed out.
– lynn
Commented Sep 9, 2015 at 3:43

Proof by Contradiction: Let's assume $x$ is rational but not an integer when defined as $x=p/q=\sqrt n$ where $p,q,n$ are integers and $q\ne0$.

$p$ and $q$ can be expressed as products of non-negative integral powers $(p_1,p_2,...,p_n)$ and $(q_1,q_2,...,q_n)$ of prime factors $(a_0, a_1, ... , a_n)$ where $a_n$ is the largest of all the prime factors of $p$ and $q$

$$p=a_0^{p_0}a_1^{p_1}a_2^{p_2}...a_n^{p_n}$$ $$q=a_0^{q_0}a_1^{q_1}a_2^{q_2}...a_n^{q_n}$$

Since, $x$ is not an integer, $q$ does not divide $p$. Hence, $$\exists a_i. q_i>p_i ......... (1)$$

Now, $n=x^2=p^2/q^2$ is an integer. But, $$p^2=a_0^{2p_0}a_1^{2p_1}a_2^{2p_2}...a_n^{2p_n}$$ $$q^2=a_0^{2q_0}a_1^{2q_1}a_2^{2q_2}...a_n^{2q_n}$$

And, from $(1)$, we deduce that $$\exists a_i, 2q_i>2p_i$$

This implies that $q^2$ does not divide $p^2$ which, in turn, implies that $n$ is not an integer. This is a contradiction.

Therefore, the assumption is false and $x$ has to be an integer whenever it is rational. In other words, if $x=\sqrt n$ is not an integer then, it cannot be rational.

Note: With regards to the question "Are there any rational numbers $x$ such that $x^2=n$?", it is easy to prove that for every natural number $n$, there exists a unique real number $x$ such that $x^2=n$. And this unique number is proven to be irrational by the above proof.

• Requesting downvoters to add a comment explaining why they think this answer is not acceptable. Commented Sep 9, 2015 at 6:38

Let $n$ be a number such that $\sqrt{n}$ is not an integer. If the equation $x^2-n=0$ has rational roots, the roots are integers. Then $\sqrt{n}$ is an irrational number.

• This uses the rational root theorem, which isn't too difficult and applies quite elegantly here, but is still maybe a bit overkill :)
– lynn
Commented Sep 9, 2015 at 3:42
• I think the original question is equivalent to asking to prove that if "x2−n=0 has rational roots, the roots are integers". Hence this answer does not fit the requirement Commented Sep 9, 2015 at 5:42