The square root of a prime number is irrational

If $p$ is a prime number, then $\sqrt{p}$ is irrational.

I know that this question has been asked but I just want to make sure that my method is clear. My method is as follows:

Let us assume that the square root of the prime number $p$ is rational. Hence we can write $\sqrt{p} = \frac{a}{b}$. (In their lowest form.) Then $p = \frac{a^2}{b^2}$, and so $p b^2 = a^2$.

Hence $p$ divides $a^2$, so $p$ divides $a$. Substitute $a$ by $pk$. Find out that $p$ divides $b$. Hence this is a contradiction as they should be relatively prime, i.e., gcd$(a,b)=1$.

• Depending on who you are writing the proof for, I might replace "Hence $p$ divides $a$" by "So that $p$ divides $a^2$ and hence also divides $a$". (There is a definite step in the logic that maybe ought to highlighted). – Old John Oct 18 '14 at 8:54
• ^Agreed. Made the necessary change. – Alexander. Oct 18 '14 at 9:19
• The number of prime factors of $a^2$ is even whereas the number of prime factors of $p\cdot b^2$ obviously is odd. – Michael Hoppe Oct 18 '14 at 9:43
• @MichaelHoppe ... which follows by existence and uniqueness of prime factorizations, i.e. FTA = Fundamental Theorem of Arithmetic. When first learning these topics, it is essential to explicitly justify such claims (because they general fail in slightly general number systems, e.g. rings of quadratic integers of form $\,a + b\sqrt d).\ \$ – Bill Dubuque Jun 24 '17 at 16:08

Alternatively you could use the rational root theorem in assuming a rational root for $x^2 - p = 0$ and showing that it can't be.