Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Prove that $\sqrt{5}$ is an irrational number. Part of the answer: Let $x^2=5$ and $x=p/q$ where $p$ and $q$ are integer numbers and $\operatorname{hcf}(p,q)=1$. $$\begin{align*} x^2&=5\\\ \left(\frac{p}{q}\right)^2&=5\\\ \frac{p^2}{q^2}&=5 & \cdot q^2 \quad \leftarrow \text{Do I have to write this: }q \neq 0\text{? I mean because it was hcf(p,q)=1}.\\\ p^2&=5q^2 \end{align*}$$ I know how it continues. Thank you for your answer.

share|cite|improve this question
Could you kindly type it up so that your question is readable? You can look up here (…) on how to typeset your post – user17762 Jul 11 '11 at 0:44
Try to use a more descriptive title. – Tyler Jul 11 '11 at 0:45
What is going on here? Two downvotes, one for the question, one for a helpful answer and an upvote for an answer that doesn't address the question? – t.b. Jul 11 '11 at 1:11
@Theo: (I remembered.) Thanks. In view of the clear assertion that he knew how to go on, I thought there was no sense in writing out the rest. (But I will add a couple of style remarks.) Anyway, I prefer the descent version of the same argument. – André Nicolas Jul 11 '11 at 1:21
@John: Yes, $\mathrm{hcf}(p,q)=1$ does not imply $q\neq 0$; note that $\mathrm{hcf}(p,0) = |p|$, so you could have $p=1$, $q=0$ and still have $\mathrm{hcf}(p,q)=1$. – Arturo Magidin Jul 13 '11 at 19:20

There is in my opinion no need to remark at this stage that $q \ne 0$, since if we had $q=0$ the earlier expression $$x=\frac{p}{q}$$ would not have made sense.

So we conclude that if $x$ were rational, there would be integers $p$ and $q$ (with $q\ne 0$, but the rest of the proof does not use this, so there is no problem if it is omitted) and $\gcd(p,q)=1$ (this is necessary) such that $$p^2=5q^2.$$ If you now continue in the usual way, the fact that $q \ne 0$ will never need to be used, since what will provide the contradiction is the $\gcd$ condition.

Added: You were in a hurry to get to your question, so perhaps rushed through the first part. It should begin something like this.

Suppose to the contrary that there exist integers $p$ and $q$ such that $\sqrt{5}=\frac{p}{q}$.

Without loss of generality we may assume that the fraction $\frac{p}{q}$ is in lowest terms, that is, that $\gcd(p,q)=1$.

The $x$ stuff is harmless but unnecessary.

share|cite|improve this answer
I did not write this: ≠0. This was in my exam and I lost point. I would like to know is it still right if you do not write ≠0 because it was hcf(p,q)=1. – John Jul 11 '11 at 1:35
@John: In principle you can have $\gcd(p,q)=1$ with $q=0$ (just pick $p=1$). About the loss of a point, my view is that after we have specified that $\gcd(p,q)=1$, whether or not $q=0$ is irrelevant to the argument. When we say that there exist integers $p$ and $q$ such that $\sqrt{5}=p/q$, of course $q\ne 0$. Now if instead we started by saying $q\sqrt{5}=p$, or something like that, then we would have to rule out $q=0$, since this equation does have the solution $p=q=0$. – André Nicolas Jul 11 '11 at 1:54

If $p^2 = 5q^2$, then $p^2$ is divisible by $5$. Since $5$ is prime that implies $p$ is divisible by $5$; hence $p^2$ is divisible $25$. So $25\cdot(\text{something}) = 5q^2$. Canceling $5$ from both sides, we get $5\cdot(\text{something}) = q^2$. Then, by the same reasoning as above, $q$ is divisible by $5$. Now $p$ and $q$ are both divisible by $5$, so we didn't really have lowest terms.

share|cite|improve this answer
I know that. My question was not how it continues. – John Jul 11 '11 at 1:23

In general, you need to assert that numbers are not zero when you divide by them. If you wait until you multiply and cancel, it's "too late," so to speak.

Since the first time you do this is by an assumption, it's clear that $q$ cannot be zero by that. If you are in an introductory proof writing class, I would point it out at that point, because it can't hurt. Otherwise, it's clear enough to omit.

It's good that you're thinking about it, though, because asserting that something is not zero before dividing is a proof step that is often forgotten.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.