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

Factoring using the difference of squares pattern

If we expand (a+b)(a-b) we will get a²-b². Factorization goes the other way: suppose we have an expression that is the difference of two squares, like x²-25 or 49x²-y², then we can factor is using the roots of those squares. For example, x²-25 can be factored as (x+5)(x-5). This is an extremely useful method that is used throughout math. Created by Sal Khan and Monterey Institute for Technology and Education.

Want to join the conversation?

  • blobby green style avatar for user aladin homes
    Given 20* 20 = 400, use the difference of two squares to determine 19*21.

    im stuck on this question, my thoughts are its a trick question because 19 and 21 are not perfect squares but is somone could help me that would be great :)
    (24 votes)
    Default Khan Academy avatar avatar for user
    • hopper cool style avatar for user Chuck Towle
      The difference of squares magic, math trick, or math principle, actually works even better than just when the numbers are only one away from the known square.
      20*20 = 400
      19*21 = 400-(1*1) or 20^2-1^2 = 399
      18*22 = 400-(2*2) or 20^2-2^2 = 396
      17*23 = 400-(3*3) or 20^2 - 3^2 = 391
      To find y * z, if integer x is half way between y and z you can square x and then subtract the square of (z-x)

      The "difference of two squares" can help sometimes.
      (63 votes)
  • leafers tree style avatar for user Chris Minnie
    Okay... he lost me at . I have no idea what's going on, can someone help me?
    (9 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user 1351584
      a difference of square is a binomial in which both the terms are perfect squares and they are subtracted
      a2-b2
      if you have a difference of squares expression here is how you would factor it
      a2-b2=(a+b)(a-b)
      in this case it is
      x2-49y2
      a=x
      b=7y
      x2-49y2=(x+7y)(x-7y)
      (11 votes)
  • blobby green style avatar for user Janet
    How do you factor the difference of two squares?
    (6 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user phil.714
    How would i go about factoring 2r^2+3rs-2s^2
    (4 votes)
    Default Khan Academy avatar avatar for user
    • male robot hal style avatar for user Sid
      2r^2 + 3rs - 2s^2 =
      2(r^2 + 3/2 rs - s^2) =
      2(r + 2s)(r - 1/2 s) =
      (r + 2s)(2r - s)
      ----------------------------

      Attempting to explain the second step :

      2(r^2 + 3/2 rs - s^2) =
      2(ar + bs)(cr + ds)
      ac = 1
      bd = -1
      ad + bc = 3/2

      Trying with a=1:
      ac = 1 so c=1
      so, since a=1 and c=1
      b + d = 3/2
      we already knew that bd = -1, so what numbers add up to 3/2 and multiplies to -1 ?
      trying with b=1: d=-1 and d=1/2. No go.
      trying with b=2: d=-1/2 and d=-1/2. That works.
      Now we have a=1, c=1, b=2, d=-1/2, so
      2(ar + bs)(cr + ds) =
      2(r + 2s)(r - 1/2 s) =
      (r + 2s)(2r - s)
      (7 votes)
  • male robot hal style avatar for user Avery Baker
    I can't find any way to factor the following problem:
    81p^2 − 144pq + 64q^2
    The is no number that goes into both of them and there are two variables
    please help me.
    (3 votes)
    Default Khan Academy avatar avatar for user
  • primosaur ultimate style avatar for user R. Productions
    At , wouldn't it be "x minus 7y, the whole thing squared" instead of "x squared minus 7y, the whole thing squared"? That's equal to x to the fourth minus 7y squared.
    (5 votes)
    Default Khan Academy avatar avatar for user
  • mr pants teal style avatar for user ThatSmartCookieAbby
    In the beginning of this video the narrator introduces us to an equation that is x squared-49y squared. Then he equates it to x squared-7y squared. How did he get that?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • starky ultimate style avatar for user troy0bush881
    I understand the concept, but I'm confused how I'm supposed to apply what Sal is saying in the video to my problem. Here it is=

    The rectangle below (I know, I cant copy and paste pictures) has an area of x^2 - 144 square meters and a length of x+2, What expression represents the width of the rectangle?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • piceratops ultimate style avatar for user Li Yen Huang
    What's the difference between a perfect square and not a perfect square?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • ohnoes default style avatar for user Linette Pan
      A perfect square is a number such as 9 or 25. It means that when you take the square root of the number, it simplifies out to a whole number without decimals. Basically, a perfect square is like the product of 2 times 2 or 3 times 3 or 4 times 4. A non-perfect square comes out to be any decimal or an irrational number like square root of 7 or 13
      (4 votes)
  • aqualine ultimate style avatar for user Erin Sam Joe
    Is a^2-b^2 the same as (a-b)^2. If not could you please explain why? This doubt has been troubling me for a few days. Thanks
    (1 vote)
    Default Khan Academy avatar avatar for user
    • piceratops tree style avatar for user Theresa Johnson
      If you try this with numbers it is easy to see why it does not work. It is sort of related to order of operations. Let's say a is 5 and b is 2.
      a² – b² = 5² – 2² = 25 – 4 = 21
      Now, if you subtract first...
      (a – b)² = (5 – 2)² = (3)² = 9
      You can see that since you subtracted first, you end up squaring a much smaller number, so the values are very different. Just like changing the order of operations in most problems will change the value.
      (4 votes)

Video transcript

Factor x squared minus 49y squared. So what's interesting here is that well x squared is clearly a perfect square. It's the square of x. And 49y squared is also a perfect square. It's the square of 7y. So it looks like we might have a special form here. And to remind ourselves, let's think about what happens if we take a plus b times a minus b. I'm just doing it in the general case so we can see a pattern here. So over here, this would be a times a, which would be a squared plus a times negative b, which would be negative ab plus b times a or a times b again, which would be ab. And then you have b times negative b, so it would b minus b squared. Now these middle two terms cancel out. Negative ab plus ab, they cancel out and you're left with just a squared minus b squared. And that's the exact pattern we have here. We have an a squared minus a b squared. So in this case, a is equal to x and b is equal to 7y. So we have x squared minus 7y, the whole thing squared. So we can expand this as the difference of squares, or actually this thing right over here is the difference of squares. So we expand this like this. So this will be equal to x plus 7y times x minus 7y. And once again, we're just pattern matching based on this realization right here. If I take a plus b times a minus b, I get a difference of squares. This is a difference of squares. So when I factor it, it must come out to the result of something that looks like a plus b times a minus b or x plus 7y times x minus 7y.