# Proof by cases: if $n$ is a positive integer and $\sqrt{n}$ isn't an integer, then $\sqrt{n}$ is irrational.

There are multiple posts about this proof already (example), but none of them attempt to prove the statement using cases (from my knowledge). I'm not sure if this method is possible as I can't seem to prove the last case.

My (rough) work is below:

Assume that $$\sqrt{n}$$ is rational. Let $$\sqrt{n} = \frac{a}{b}$$ for some $$a,b\in Z^+, b\neq0$$ be a ratio of integers in their most reduced form. We know that both $$a$$ and $$b$$ cannot both be even, as that would simplify the fraction further.

It follows that $$n=\frac{a^2}{b^2}$$, therefore $$a^2=nb^2$$,

Case 1: $$a$$ even, $$b$$ odd

Let $$a=2c$$. It follows that $$(2c)^2=4c^2=nb^2$$, which leads to a contradiction that $$b$$ is even.

Case 2: $$a$$ odd, $$b$$ even

Let $$b=2d$$. It follows that $$a^2=n(2d)^2=4nd^2$$, which leads to a contradiction that $$a$$ is even.

Case 3: $$a$$ odd, $$b$$ odd

I have tried approaching this in three ways:

Method 1: Let $$a=2x+1$$. It follows that $$(2x+1)^2=4x^2+4x+1=nb^2$$.

Method 1: Let $$b=2y+1$$. It follows that $$a^2=n(2y+1)^2 =n(4y^2+4y+1)$$.

Method 3: Let $$a=2x+1, b=2y+1$$. It follows that $$(2x+1)^2=4x^2+4x+1=n(2y+1)^2 =n(4y^2+4y+1)$$.

I can't find a contradiction in any of these statements. What am I doing wrong? Thanks!

• Apparently this started as a proof for the case $n=2$. Aug 14, 2020 at 23:47
• Sorry - that was a typo. I meant $a^2=nb^2$.
– w00t
Aug 14, 2020 at 23:48
• Case 1 is wrong. Aug 14, 2020 at 23:50
• More specifically, if $n$ is even your argument is not always true for case 1. Aug 14, 2020 at 23:51
• I don't understand why the question has a downvote. The OP has shown his attempts. This discourages the OP.
– user798113
Aug 15, 2020 at 0:05

The even/odd thing for the case $$n=2$$ is specific to $$2$$. For the general case, you want to consider a prime $$p$$ such that occurs to an odd power in the prime factorization of $$n$$ (and thus this will depend on the Fundamental Theorem of Arithmetic). You then consider the highest powers of $$p$$ that divide $$a$$ and $$b$$.