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$.


Solution 1:

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.