If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Proof: square roots of prime numbers are irrational

Sal proves that the square root of any prime number must be an irrational number. For example, because of this proof we can quickly determine that √3, √5, √7, or √11 are irrational numbers. Created by Sal Khan.

Want to join the conversation?

  • mr pants teal style avatar for user Wrath Of Academy
    Didn't he prove even more than he set out to prove? He didn't state it explicitly, but at , p wouldn't even need to be prime to continue with the proof. Sal chose p to be one single factor, but really p could be a series of factors, where at least one of the factors is not a duplicate. Ie, in the list of factors of a^2 he has there, p could be f1 * f1 * f3. This new p isn't prime since it has three factors, and in fact even 2 of the factors are duplicated (f1 and f1), but as long as one factor is unique (f3) then we can say a must be a multiple of p and the proof continues on. Doesn't this show that the square root of a number is irrational if that number is made of anything other than pairs of duplicated factors?
    (20 votes)
    Default Khan Academy avatar avatar for user
    • piceratops ultimate style avatar for user Judy
      No, I believe the proof would break down in this case, and here's why.

      You wrote "in the list of factors of a^2 he has there, p could be f1 * f1 * f3."
      Obviously, this would mean that p is a factor of a^2.
      But in the case of your p, which isn't a prime number anymore, we wouldn't automatically know whether p is a factor of a as well.
      In your example, we'd need to know that the factors of a^2 contained f1 * f1 * f1 * f1 * f3 * f3
      i.e. we'd need to know that p^2 is a factor of a^2 to know that p is a factor of a
      Otherwise it could happen for example that the factors of a^2 are p * f3 = (f1 * f1 * f3) * f3, making a = f1 * f3
      a is still rational, but p is not among the factors of a, ergo a is not a multiple of p, and the proof doesn't work from this point on
      EDIT the proof works as long as you set your new p as only the unpaired factor (in this example, the "f3") Then we can say a is a multiple of f3, which is a prime number, so the same proof applies...
      (21 votes)
  • duskpin ultimate style avatar for user Joseph Carr
    How is p squared definitely irrational when all he did was assume that this equals that and that equals this and a over b can't be reduced?
    (3 votes)
    Default Khan Academy avatar avatar for user
    • leaf blue style avatar for user Stefen
      That is a great question whose answer is at the same time both profound and subtle.

      First - The only assumption, that is, something we do not know if it is true or not, made in this video is the proposition that square roots of prime numbers are irrational. Below I will get to the a/b thing and perhaps some of the other what-you-think-are-assumptive statements you ask about, but you didn’t say what they were. In order to get there, I need to go here first:

      Math is like a game in that it has rules. If you follow those rules you win.
      What do you win? You win a truth, which up till now, you have been calling “a correct answer” – but there is more. . .

      You already know many math rules, like keeping an equation balanced, or a negative number multiplied by another negative number results in a positive number etc. etc. . . . . There are lots of these kinds of procedural rules for playing with numbers.

      But there are other types of rules that will become more and more important as you get further into math and they have to do with the properties of numbers and consequences of results. The most amazing thing about these rules is that they, combined with other rules can lead you to a truth than no one has discovered yet, in other words, this rule based game of exploration can take you where no one has gone before – and it is that aspect which keeps us pushing the boundaries of mathematics. Many new discoveries are beautiful (fractal geometry), or useful (chaos theory), or weird (quantum mechanics) and some are even a bit disturbing (the n-body problem).

      Now, the path that leads to a truth in mathematics is called a proof. Guess what? You have been doing proofs all this time, right since you first started to add numbers up until now. For example, if you have a problem like 7x - 10 = 5x + 6, you can prove, using the rules of the game of math, that x can only be equal to 8 in order that 7x - 10 = 5x + 6 becomes a true statement. This is an example of a proof using just the procedural rules. If at each step of the way, you obey the rules, you prove (arrive at the truth) that x=8.

      The proof you are asking about in this video is a proof that uses some properties of numbers and some concepts and their consequences. This takes a bit more considered thinking – so let’s get to it.

      We are being asked to prove: when you take the square root of any prime number, the result is an irrational number. To start the proof, what do we already know in terms of rules, definitions, and properties?

      1) What is a prime number? A number, let’s call it p, is prime if it can be evenly divided (no remainder) by only 1 or itself.

      2) What is a square root? The square root of a number, say n, is a value, say k, that, when multiplied by itself, gives the number, that is, k*k=n, so k is a square root of n.

      3) What is an irrational number? An irrational number is a real number that cannot be expressed as a ratio of integers, commonly called a fraction. So if x is irrational, there are no integer values, say a and b, such that x=a/b. This property will be really important in the proof.

      4) What is reduced form? Any fraction can be converted into reduced form. EG 12/18 = 6/9 = 2/3. 2/3 is the reduced form of both 12/18 and 6/9. Consider 8/16 = 4/8 = 2/4 = 1/2 (reduced form). We know we can do this reducing process for any fraction that is not already in reduced form. This property will be really important in the proof.

      With most proofs we can proceed directly, like the 7x - 10 = 5x + 6 example. Other proofs use a different tactic, and this tactic works because each application of a rule of math will always give you a valid, or correct result – and we can use this to our advantage! Here’s how:
      A common method of proof in math and other logic systems is called “proof by contradiction” or formally “reductio ad absurdum” (reduced to absurdity). How this type of proof works is: suppose we want to prove that something is true, let’s call that something S. If we start the proof by assuming that S is instead false, and then, using the rules of the game of math (also known as mathematically correct and valid arguments) we show that we get a nonsense or contradictory result, well then, that must mean the assumption we made that S was false can’t be correct, so S must be true!! In this case, our statement S is “the square roots of prime numbers are irrational”. So our plan of attack it to assume that S is false, that is, let’s assume that “the square roots of prime numbers ARE rational”. So let’s try to prove that . . . Let’s start with the properties #1 to #4 we know about.

      Let’s pick any prime number, and let’s call it p. Now contrary to S, which states “the square roots of prime numbers are irrational”, we are assuming that S is wrong and that “the square roots of prime numbers ARE rational”. Now let’s play the game of math see what happens when we try to prove that the square roots of prime numbers are rational.

      If the square root of our prime number p is rational, that means we can say √p = a/b, where a and b are integers - recall rule/property #3.

      From rule/property #4 we know we can reduce the fraction a/b if it is not already in reduced form. Now you might say “what if a/b is not reduced?” That’s OK – we can reduce it and call it c/d. What? c/d is not reduced? OK reduce it and call it e/f. We can keep repeating this process until a/b is in reduced form. Since we know it can be done, let’s just say we have done all that and our a/b is now in reduced form.

      Given rule/property #2 if √p is the square root of p, then (√p)( √p) = p, right?
      Using the “keep an equation balanced” rule where you must do the same thing to bother sides (in this case, squaring) we have, given √p = a/b, that (√p)( √p) = (a/b)(a/b), so p=a^2/b^2.

      Now follow along with the video from . Each step is an application of a rule of math. If some of the outcomes of the rules you do not understand, you may want to review that particular subject.

      If I missed a detail you want clarified – just ask.
      Keep Studying!
      (32 votes)
  • spunky sam blue style avatar for user Muhammad Nada
    is the square root of a non prime number rational?
    (7 votes)
    Default Khan Academy avatar avatar for user
    • leaf blue style avatar for user Stefen
      That is a great question and one that is not at all difficult to decide whether it is true or false.
      In math, if you can find just one example that is counter to the claim, then the claim is invalid.

      CLAIM: the square root of a non prime number is rational
      Take 8 for example. 8 is not prime, correct. But, √8 = √4·√2 = 2·√2.
      Now the 2 in √2 is prime and therefore the square root of it IS irrational, and an irrational number times a rational number is ALWAYS irrational. Yikes! we have found one non-prime number whose square root is irrational. Therefore we MUST conclude that the claim "the square root of a non prime number is rational" is not true for all non-prime numbers.

      Now we can find examples where it is true, for example √4=2. Obviously 4 is NOT a prime and its square root, 2 IS rational - this is an example of a non-prime whose square root is rational. But since we found one non prime whose square root is not rational we cannot say for all non-prime numbers that "the square root of a non prime number is always rational."

      PS: there are infinitely many other non prime numbers whose square roots are irrational - keep studying and one day you will be able to prove it to yourself!

      Have Fun & Keep Asking Questions!
      (20 votes)
  • blobby green style avatar for user alexkim00
    at , Sal said a^2 is a multiple of p, so a is a multiple of p.
    but how about this case?:
    6^2 = 36, and 36 is a multiple of 4
    6 is not a multiple of 4.
    how does this work?
    (5 votes)
    Default Khan Academy avatar avatar for user
  • piceratops seed style avatar for user Sharon C Long
    At , shouldn't p=f2 x f2 to be a multuple of a^2?
    (7 votes)
    Default Khan Academy avatar avatar for user
  • spunky sam orange style avatar for user daP0l15hc0unt
    can you prove that the square root of any non perfect square is irrational
    (4 votes)
    Default Khan Academy avatar avatar for user
  • hopper happy style avatar for user False Memory
    I have a question regarding irrational numbers. How many irrational numbers (with a "NAME" such as Pi) can be found by finding the square root of imperfect squares starting from the smallest imperfect square to the largest imperfect square who's square root has a name?

    PS: This idea occurred to Me while watching one of Sal's earlier videos when He said that the square root of ANY imperfect square is irrational (I suppose that also means a number doesn't have to be prime in order for its square root to be irrational.)

    PSS: Does anyone know of an algorithm for finding imperfect squares for example 2,3,5,6,7,8,10,11,12,13 etc? (The reason I asked this question is because an algorithm for finding imperfect squares would be helpful for answering the first question above.)
    (4 votes)
    Default Khan Academy avatar avatar for user
    • starky ultimate style avatar for user Kevin Monisit
      I cannot think of any special number with a name that equals the square root of an imperfect square. I doubt there is many either. Pi isn't represented by the square root of an imperfect square.

      One example that ALMOST goes with what your saying would be the golden ratio, which equals

      (1 + sqrt(5))/2

      But that doesn't entirely fit your criteria of having a special name for a pure square root of an imperfect number.
      (1 vote)
  • sneak peak green style avatar for user Robert Zak
    I find proofs in mathematics hard, I managed to understand the square root of 2 => irrational proof but gosh I just can't wrap my head around this one. And I don't know why.
    (4 votes)
    Default Khan Academy avatar avatar for user
  • aqualine ultimate style avatar for user Kaleigh
    Are any prime numbers irrational?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • stelly blue style avatar for user Kim Seidel
      No. Prime numbers themselves are all whole numbers. They can be written as a ratio of 2 integers by giving them a denominator of 1. Thus, they fit the definition of rational numbers.

      Most irrational numbers you will deal with will be well known constants like "Pi" or "e"; or they will be radicals of imperfect roots like: sqrt(6); cuberoot(9); 4throot(24); etc.
      (4 votes)
  • stelly yellow style avatar for user funmise1
    I had this question in the previous video as well. Couldn't he have just done b * √(p)= a( the product of a rational and irrational). which he proved previously is a contradiction.
    (2 votes)
    Default Khan Academy avatar avatar for user

Video transcript

In a previous video, we used a proof by contradiction to show that the square root of 2 is irrational. What I want to do in this video is essentially use the same argument but do it in a more general way to show that the square root of any prime number is irrational. So let's assume that p is prime. And we're going to set this up to be a proof by contradiction. So we're going to assume that the square root of p is rational and see if this leads us to any contradiction. So if something is rational, that means that we can represent it as the ratio of two integers. And if we can represent something as the ratio of two integers, that means that we can also represent it as the ratio of two co-prime integers, or two integers that have no factors in common. Or that we can represent it as a fraction that is irreducible. So I'm assuming that this fraction that I'm writing right over here, a/b, that this right over here is an irreducible fraction. You say, well, how can I do that? Well, this being rational says I can represent the square root of p as some fraction, as some ratio of two integers. And if I can represent anything as a ratio of two integers, I can keep dividing both the numerator and the denominator by the common factors until I eventually get to an irreducible fraction. So I'm assuming that's where we are right here. So this cannot be reduced. And this is important for our proof-- cannot be reduced, which is another way of saying that a and b are co-prime, which is another way of saying that a and b share no common factors other than 1. So let's see if we can manipulate this a little bit. Let's take the square of both sides. We get p is equal to-- well, a/b, the whole thing squared, that's the same thing as a squared over b squared. We can multiply both sides by b squared, and we get b squared times p is equal to a squared. Well, what does this tell us about a squared? Well, b is an integer, so b squared must be an integer. So an integer times p is equal to a squared. Well, that means that p must be a factor of a squared. Let me write this down. So a squared is a multiple of p. Now, what does that tell us about a? Does that tell us that a must also be a multiple of p? Well, to think about that, let's think about the prime factorization of a. Let's say that a can be-- and any number-- can be rewritten as a product of primes. Or any integer, I should say. So let's write this out as a product of primes right over here. So let's say that I have my first prime factor times my second prime factor, all the way to my nth prime factor. I don't know how many prime factors a actually has. I'm just saying that a is some integer right over here. So that's the prime factorization of a. What is the prime factorization of a squared going to be? Well, a squared is just a times a. Its prime factorization is going to be f1 times f2, all the way to fn. And then that times f1 times f2 times, all the way to fn. Or I could rearrange them if I want. f1 times f1 times f2 times f2, all the way to fn times fn. Now, we know that a squared is a multiple of p. p is a prime number, so p must be one of these numbers in the prime factorization. p could be f2, or p could be f1, but p needs to be one of these numbers in the prime factorization. So p needs to be one of these factors. Well, if it's, let's say-- and I'll just pick one of these arbitrarily. Let's say that p is f2. If p is f2, then that means that p is also a factor of a. So this allows us to deduce that a is a multiple of p. Or another way of saying that is that we can represent a as being some integer times p. Now, why is that interesting? And actually, let me box this off, because we're going to reuse this part later. But how can we use this? Well, just like we did in the proof of the square root of 2 being irrational, let's now substitute this back into this equation right over here. So we get b squared times p. We have b squared times p is equal to a squared. Well, a, we're now saying we can represent that as some integer k times p. So we can rewrite that as some integer k times p. And so, let's see, if we were to multiply this out. So we get b squared times p-- and you probably see where this is going-- is equal to k squared times p squared. We can divide both sides by p, and we get b squared is equal to p times k squared. Or k squared times p. Well, the same argument that we used, if a squared is equal to b squared times p, that let us know that a squared is a multiple of p. So now we have it the other way around. b squared is equal to some integer squared, which is still going to be an integer, times p. So b squared must be a multiple of p. So this lets us know that b squared is a multiple of p. And by the logic that we applied right over here, that lets us know that b is a multiple of p. And that's our contradiction, or this establishes our contradiction that we assumed at the beginning. We assumed that a and b are co-prime, that they share no factors in common other than 1. We assumed that this cannot be reduced. But we've just established, just from this, we have deduced that is a multiple of p and b is a multiple of p. Which means that this fraction can be reduced. We can divide the numerator and the denominator by p. So that is our contradiction. We started assuming it cannot be reduced, but then we showed that, no, it must be able to be reduced. The numerator and the denominator have a common factor of p. So our contradiction is established. Square root of p cannot be rational. Square root of p is irrational. Let me just write it down. The square root of p is irrational because of the contradiction.