Three Standard Ways to Factor a Quadratic

Last time, we looked at some non-recommended ways to factor a quadratic trinomial. Here we’ll explore several recommended methods (the basic case, trial-and-error, and ac-grouping), looking into how to do them, and why they work.

We are talking about factoring quadratic trinomials (three-term polynomials with degree 2), which can be written as \(ax^2+bx+c\). Here we want to factor “over the integers”, meaning that all the coefficients a, b, and c, are integers, and we want to write it in factored form as \((mx+p)(nx+q)\), where m, n, p, and q are integers. (Next time, we’ll see methods that work even when integers are impossible.)

The basic case: Factoring \(x^2+bx+c\)

First, there’s the case where the leading coefficient is 1. It’s the simplest, but still takes some patience when the numbers are relatively large, as in this question from 2005:

Factoring Trinomials

I'm trying to factor d^2 - 33d - 280.  The answer should be in ( )( ) form.  I don't know how to get it to equal -33 but also have the two numbers multiply to equal -280.

I've tried figuring out what two numbers add up to -33, and then tried to see if those numbers multiplied equaled 280 and all the numbers I've tried so far have not worked.

Jessica understands that in this case, we want to write \(x^2+bx+c=(x+p)(x+q)\) where, since $$(x+p)(x+q)=x^2+(p+q)x+pq,$$ the sum \(p+q\) has to equal b and the product \(pq\) has to equal c. So in factoring \(x^2-33x-280\), we need to find a pair of numbers whose sum is \(-33\), and whose product is \(-280\). But how can we do so efficiently? This is a skill we need in other methods (even slip-and-slide), so it’s a good place to start.

Hint: There are far more pairs of numbers that add to \(-33\) (in fact, infinitely many of them!), so we want to start with factors of \(-280\) instead.

I answered:

Hi, Jessica.

I start by checking the signs: since -280 is negative, the two numbers we're looking for have opposite signs. Their sum, then, can be thought of as the _difference_ of two positive numbers whose product is 280. (We'll put a negative sign on the larger of those, so that the actual sum is negative.)

If the problem were, say, \(x^2-43x{\color{Red}+}280\), we’d have a positive product, so the two numbers would have the same sign, and we’d want their sum to be \(-43\), so they’d both be negative.

Sometimes we can just see the answer using an obvious pair of numbers; but probably not here! We’ll have to be organized.

Now, if your first few guesses don't yield an answer, we can try listing all the pairs of factors of 280, in an orderly fashion.  In preparation for that, I will often find the prime factorization of the number, which will help me decide which factors to try.  I get

  280 = 2*2*2*5*7

(I did that by thinking this way: try 2 first, and 280 = 2*140; that's still even, so 140 = 2*70; again, 70 = 2*35; and 35 = 5 * 7.  Each time I divided out a prime factor, I added it to my list.)

This isn’t necessary, but when the product is large like this, it can save time by letting us ignore impossible factors.

Now I know that no factor that is a multiple of 3 will work, so I can skip all those, as well as primes larger than 7. Here is a list of factor pairs:

  1 * 280
  2 * 140
  3 ... no, multiple of 3
  4 * 70
  5 * 56
  6 ... no, multiple of 3
  7 * 40
  8 * 35
  9 ... no, multiple of 3
 10 * 28
 11 ... no, the prime 11 isn't a factor
 12 ... no, multiple of 3
 13 ... no, the prime 13 isn't a factor
 14 * 20
 15 ... no, multiple of 3
 16 ... no, 8 is the biggest power of 2 that goes in
 17 ... no, the prime 17 isn't a factor
 18 ... no, multiple of 3
 19 ... no, the prime 19 isn't a factor

We can stop here, since when we get to 20 we will be reusing pairs we already have.

Of course, we only write down the pairs that work! And we’ll usually be able to stop short …

In this list you will find the pair you need, which differ by 33.  In reality, I would have stopped when I found that one; but if you go through the entire list like this and find nothing, then you know it CAN'T be factored!

So I would have written (and thought) this:

\(1\times 280\) (difference is 279)

\(2\times 140\) (difference is 138)

\(4\times 70\) (difference is 66)

\(5\times 56\) (difference is 51)

\(7\times 40\) (difference is 33!)

Since the sum has to be negative, we make the larger number, 40, negative, and our factorization is \((d+7)(d-40)\).

In factoring \(x^2-43x+280\), we’d write this:

\(1\times 280\) (sum is 281)

\(2\times 140\) (sum is 142)

\(4\times 70\) (sum is 74)

\(5\times 56\) (sum is 61)

\(7\times 40\) (sum is 47)

\(8\times 35\) (sum is 43!)

We’d make both numbers negative (to get a negative sum), and give the answer \((x-8)(x-35)\).

Notice that the sum or difference decreases down the list; so if it goes below the goal, we can stop and say it can’t be factored. For example, if I wanted the sum to be 65, when it got down to 61 I could stop.

Here’s another piece of advice this question didn’t call for: When we’re looking for a very small difference, then the numbers we want will be near the end of the list, so we’d like to jump there rather than go through every possibility. We can do that by observing that the numbers will be very close together, that is, close to the square root of the product.

For example, suppose we are factoring \(x^2-x-702\). We want factors of 702 whose difference is 1. They will be close to the square root of 702, which is about 26.5, so we might go up and down by 1/2, and try 26 and 27, whose product is … 702! So \(x^2-x-702=(x+26)(x-27)\). If the difference were 2, we’d add and subtract 1, and so on.

But what if the leading coefficient is not 1?

Factoring \(ax^2+bx+c\) by the trial-and-error method

Consider this question is from 1998:

Factoring by Grouping

How do you factor 2r^2 + rt - 6t^2?

So far I have multiplied the ends of the equation (2r^2 and -6t^2). What do I do now?

This one has two variables, but the main ideas are the same. Looking back at this, the title (given by the student) suggests that she may have been taught the ac-grouping method (which uses grouping, and requires multiplying \((2r^2)(-6t^2)\)), but I didn’t know that method yet, and just taught what I knew at the time:

Hi, Ashley. This is about the hardest type of problem you'll see for this sort of factoring, because both squared terms have coefficients (that is, multipliers, which in your problem are 2 and -6) that are not 1. Let's go through a problem very much like yours (so you can try out what you learn on your own), and then if you need another example you can look on the Web at:

  http://mathforum.org/dr.math/problems/thorne11.14.95.html    

for a problem involving bigger and uglier numbers.

The link (updated) is to a question about \(40y^2-zy-6z^2\), which uses the trial-and-error method as I will. (Some people prefer to call this “guess-and-check“, which emphasizes that we are checking everything we try, rather than that most of our tries will fail. But others don’t like calling it guessing, when we can choose what to try very wisely!)

I wanted to keep things simple, so I made an example with numbers in the same range as Ashley’s:

Here's my problem:

   Factor 3r^2 - 7rt - 6t^2

We want to get this in the form:

   (ar + bt)(cr + dt)

which multiplies out to:

   ac*r^2 + (ad + bc)*rt + bd*t^2

With this kind, there are four numbers to choose, not just two as in the basic case; and it’s not just a sum we’re looking for. But the procedure will be similar to what we did above.

You don't have to memorize that. The important thing is that the coefficient of r^2 will be the product of a and c, and the coefficient of t^2 will be the product of b and d. So the first thing to do is to factor the 3 and the 6, and list (at least in your mind) all the products that can produce them:

         a   c
        -------
    3 =  1 * 3 or
         3 * 1

         b   d
        -------
   -6 = -1 * 6 or
        -2 * 3 or
        -3 * 2 or
        -6 * 1 or
        1 * -6 or
        2 * -3 or
        3 * -2 or
        6 * -1

(Maybe this is what you meant when you said you "multiplied the ends." There's no reason to multiply them, but factoring them is the first step.)

No, she meant exactly what she said, as we’ll see.

I don't usually make tables like this, and I don't think about a, b, c, and d; I just write down some parentheses and try filling them in:

   ( r    t)( r    t)

Now we just have to search for a set of a, b, c, and d for which (ad + bc) is -7. The way I do this is to try writing the factored expression with some choice of values and see how it looks. In this case, it doesn't really matter whether I take a and c to be 1 and 3 or 3 and 1, because that would just switch the order of the factors I end up with, so the only real decision is what to try for b and d. I usually start with something more or less balanced (2 * 3 rather than 1 * 6) just to see what will happen:

   Goal: 3r^2 - 7rt - 6t^2

         3    6
        / \  / \
       /   \/   \
      /    /\    \
   (1r   2t)(3r   3t)
     \    \ /    /
      \    6    /
       \  +/-  /
        -- 3 --
          ===
           7 ?

So since 3 is prime, I really only have one choice there, and I can confidently write the 1 and 3. (If neither coefficient is prime, I usually avoid this method!)

What I drew there represents my thinking using the familiar FOIL to multiply. I might use my fingers to point out the pairs.

The r terms give 3r^2 and the t terms give 6t^2. (We know we'll need a + and a -, but we'll leave that for later.) Try multiplying the two rt pairs: 1r * 3t = 3rt, and 2t * 3r gives 6rt. Subtracting 3 and 6 in either order won't give us -7, so this won't work. 

Let's try something else. Maybe switch the factors of 6:

         3    6
        / \  / \
       /   \/   \
      /    /\    \
   (1r   3t)(3r   2t)
     \    \ /    /
      \    9    /
       \  +/-  /
        -- 2 --
          ===
           7 ?

Now the rt terms are 1r * 2t = 2rt and 3t * 3r = 9rt. We can combine these to make -7: 2rt - 9rt. So we put a minus sign where it will multiply the 9rt term:

  (1r - 3t)(3r + 2t) = 3r^2 - 7rt - 6t^2

So we've factored it. As you can see, there's a lot of trial and error. If you don't feel like you know where you're going all the time, don't worry - we're all just feeling around when we do this. When you get enough experience, you get used to the process so it gets a little more orderly.

I’ve sometimes told my students that when I learned this method in high school, I liked the method because it took a lot of skill I could show off. Once I started teaching, I found that although I use trial and error for relatively easy problems, it’s much easier to teach the next method, which uses only skills the student will already have at this point. Once we’ve seen that, we’ll be applying both methods to Ashley’s problem for comparison.

A special case: Perfect square trinomials

By the way, in looking for explanations of this method, I found this one:

Factoring Trinomials: 9x^2 - 42x + 49

But as soon as I saw the title, I realized that Doctor Ian had missed an easy answer: When the first and last coefficients are both squares, I wonder if it might happen to be a perfect square trinomial, \((ax+b)^2=a^2x^2+2abx+b^2\). So, seeing that \(3^2=9\) and \(7^2=49\), I just do a quick check: What is \((3x-7)^2\)? Since \(2(3)(7)=42\), the answer is yes, and I have an answer. As Doctor Ian says there,

And, believe it or not, as you get more practice at this, you'll get better at instinctively avoiding the possibilities that can't make sense (in very much the same way that someone who is really good at chess doesn't even consider the kinds of dumb moves that novices have to work through).

True. But any of us can miss such shortcuts, as well.

Factoring \(ax^2+bx+c\) by the ac-Grouping method

Here is the first time I taught the ac-grouping method, as I mentioned last time, from 2002:

Finding a Single Pair of Factors

The problem is:

   34x^2 - 41x - 15

I have tried all of the factors of 34, and everything else, but I can't get the answer because the only factors of 15 are 1 and 15, and 3 and 5.

Please help!

Lauren is clearly trying the trial-and-error method, which does get hard when neither number is prime. I answered; this was two days after I’d learned the ac-grouping method in researching the slip-and-slide method, as we saw last time):

Hi, Lauren.

I would just use the quadratic formula to find the zeroes, from which I would build the factors. That's the easy way.

But there is a better way to factor this than the method you are using, one which I only learned recently. Rather than look at combinations of factors of 34 and factors of 15, just look for a pair of factors of 34*-15 = -510, whose sum is -41. You can find that easily.

We’ll use the quadratic formula next time! It is usually the best way when the numbers are really big.

I'll demonstrate the work by doing a different problem as a model. We'll factor

    21x^2 - 23x - 20

We want to factor ac = 21*-20 = -420, so that the sum of the factors is -23. (Note that the factors will have opposite signs, so their sum will be the _difference_ of two factors of +420.) We can try 42 and 10, but their difference is too big; 21 and 20 have too small a difference; but 35 and 12 are just right. Writing -23 as -35 + 12, our quadratic is
           _________
          /         \
    21x^2 - 35x + 12x - 20
    \_________/   \______/

Taking this in pairs and factoring each pair, we get

    7x(3x - 5) + 4(3x - 5)

Aha! They have a common factor, so we can combine them:

    (7x + 4)(3x - 5)

Notice that if we had reversed the order of the middle terms, it would still work:

    21x^2 + 12x - 35x - 20

    3x(7x + 4) - 5(7x + 4)

    (3x - 5)(7x + 4)

Note that, unlike the slip-and-slide methods we saw last time, every line is just a rewriting of the previous line, so we know the final result is true. The only unknown is why we would do this, which we’ll be seeing.

Looking for a single pair of factors this way is much easier than the way I learned, which is probably what you are trying to do! Have fun finishing your problem.

Let’s do Lauren’s problem this way:

$$34x^2{\color{Red}-41x}-15\\\text{product }34\cdot-15=-510\text{, sum }{\color{Red}-41}\\\underbrace{34x^2{\color{Red}-51x}}\underbrace{{\color{Red}+10x}-15}\\17x(2x-3)+5(2x-3)\\(17x+5)(2x-3)$$

That’s it! The only hard part was finding the two numbers, which we might have just seen immediately (since 51 and 10 are obvious), or by systematically considering each possible pair of factors, as in the basic method.

If we do it by trial and error, we have eight possibilities (ignoring the placement of the minus sign:

$$(2x-1)(17x+15):30-17\\(2x-3)(17x+5):10-51\color{Red}{=-41}\\(2x-5)(17x+3):6-85\\(2x-15)(17x+1):2-255\\(x-1)(34x+15):15-34\\(x-3)(34x+5):5-102\\(x-5)(34x+3):3-170\\(x-34)(17x+1):1-510$$ It happens that the second thing I tried worked, so I didn’t really have to finish the list. But that was luck. And if either number had more than four divisors, it would have been worse.

Why it works

A question in 2003 asked for an explanation:

Factoring a Trinomial

What is factoring by grouping? When factoring a trinomial, why is it necessary to write the trinomial in four terms?

  2x^3 - 5x^2 + 3x

First, we factor out x such that

  2x^3 - 5x^2 + 3x = x(2x^2 - 5x + 3)

We obtain the form ax^2 + bx + c where a = 2, b = -5, and c = 3.

Because ac = (2)(3) = 6, and b = -5, we need two integers with a product of 6 and a sum of -5. These integers are -2 and -3. Replacing -5x by -2x - 3x, we obtain a four-term polynomial

  2x^3 - 5x^2 + 3x = x(2x^2 - 5x + 3)
                   = x(2x^2 - 2x - 3x + 3)
                   = x[2x(x - 1) - 3(x - 1)]

By grouping, we have

  x[2x (x - 1) - 3(x - 1)] = x(x - 1)(2x - 3)

Jen has done good work here, demonstrating first the need to factor out a GCF, if any, and then the ac-grouping method as we just saw. There’s nothing more for me to say there. But why? It’s pretty clear why the result it gives is correct, because each line follows from the one before. But why does it always work?

I answered:

Hi, Jen.

I don't know that I would say any of this is "necessary"; there are several strategies you can use to factor, and you might just be smart enough to see the answer immediately. (I'm not!) So the question is, how does the technique you are being taught work? I explained the method here:

   Finding a Single Pair of Factors
   http://mathforum.org/library/drmath/view/53308.html

This is the answer above. I mentioned my explanations of slip-and-slide, which I thought of as closely related to this, and went on:

Actually, I think we can explain the basic method as you and I present it more easily. We have

  ax^2 + bx + c

and we find p and q so that

  pq = ac
  p + q = b

Then we rewrite the quadratic as

  ax^2 + (p + q)x + pq/a

  ax^2 + px + qx + pq/a

In Jen’s example, \(p=-2\) and \(q=-3\) so that \(pq=(-2)(-3)=6=ac\), and \(p+q=(-2)+(-3)=-5=b\). And \(c=\frac{ac}{a}=\frac{pq}{a}=\frac{6}{2}=3\).

Now we factor out ax from the first pair of terms and q from the second:

  ax(x + p/a) + q(x + p/a)

and then factor out the "x + p/a" from both terms:

  (ax + q)(x + p/a)

or, for the sake of symmetry,

  a(x + q/a)(x + p/a)

You may notice that this looks a lot like the slip-and-slide method!

Since it may not be true that both p and q are divisible by a, this may not be exactly how the answer looks using integers; but we have seen that writing b as p + q does always allow us to factor by grouping (that is, to find common factors in two pairs of consecutive terms, and then factor the result). And anything that allows us to finish off the problem so easily, while perhaps not strictly "necessary," is certainly welcome!

Here’s another way I’ve explained the ac-grouping method:

Factoring by grouping of a polynomial of four terms requires that the terms form a proportion.

For example, consider \(2x^2-6x-3x+9\), \(2x^2:-6x=-3x:9\); that is, \(\frac{2x^2}{-6x}=\frac{-3x}{9}=-\frac{1}{3}\). If we ignore the variables, which will always work out, we have \(2:-6=-3:9\), or, if you prefer, /(\frac{2}{-6}=\frac{-3}{9}\).

But such a proportion is true when the cross-products are equal, that is when \((2)(9)=(-6)(-3)\). So a quadrinomial \(ax^2+px+qx+c\) can be factored by grouping when \(a:p=q:c\), which means that \(ac=pq\). So we want to split \(bx\) into a sum \(px+qx\) where \(pq=ac\). That’s exactly what the method does.

So the ac-grouping method just means setting up a quadrinomial that we can factor by grouping.

Ashley revisited

Let’s look back at Ashley’s problem, \(2r^2+rt-6t^2\):

Using the ac-grouping method, we need a pair of numbers whose product is -12, and whose sum is 1. That is, we want factors of 12 whose difference is 1. That’s easy: 4 and 3. So the numbers are \(4\) and \(-3\), and we rewrite as \(2r^2+4rt-3rt-6t^2\). Grouping, we get \(2r(r+2t)-3t(r+2t)=(2r-3t)(r+2t)\)

If we had to use trial and error, we’d place r and 2r in one order, and consider all orders of t, 2t, 3t, and 6t.

$$(1r-1t)(2r+6t):6-2\\(1r-2t)(2r+3t):3-4\color{red}{=-1}\\(1r-3t)(2r+2t):2-6\\(1r-6t)(2r+1t):1-6$$

The second try gave us the right number with the wrong sign, so we just have to reverse the signs: $$(r+2t)(2r-3t)=2r^2-3rt+4rt-6t^2=2r^2+rt-6t^2$$

That wasn’t really too bad, because the first coefficient is prime.

Next time: what to do when these methods look too time-consuming, or when you just want to get the job done, even if the factors involve irrational or non-real coefficients.

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.