How to factor quadratic polynomials by guessing

Given a quadratic polynomial x2 + px + q, we want to factor it, that is, we want to write is as

x2 + px + q = (x − a)(x − b).

Theory says that this is possible only if the quadratic polynomial in question has real roots, and then the constants a,b are exactly those roots (we may have a = b). This shows one way to factor, use the quadratic formula to find roots and then write the factorization (or conclude that there are no roots and therefore no factorization is possible). This way is reliable and always works, so there is nothing wrong with it.

However, some people are too lazy to mess with roots and calculations, they prefer to guess the factorization. Guessing has one big advantage: If it works, it is usually very quick and simple. The big disadvantage is that it works only rarely, that is, only if the roots exist and they are relatively small integers. From mathematical point of view this means that the guessing basically never works. However, from a student's point of view this is not so bad, since the problems we solve in school are not really representatives of "real problems", but special problems prepared by teachers. Thus it actually happens quite often that the roots are nice small integers and the guessing method really shines.

How does it work? If we multiply out the above equation, we will see what conditions must be satisfied by the unknown constants a,b (which are actually the unknown roots):

x2 + px + q = x2 − (a + b)x + (ab).

So the conditions are ab = q and a + b = −p, the first one is more important. If we hope that the roots happen to be integers, then they must together give q. In other words, if we look at all possible ways to write q as a product of two integers, we get a list of candidates for a and b. In order to make the list shorter it is worthwile to notice that we can in fact look at just half ot the whole list. Indeed, multiplication is commutative, so if we switch the values of a and b, we are in fact switching the linear terms in the decomposition, which leads to the same answer after multiplying out:

(x − a)(x − b) = (x − b)(x − a).

So we may always disregard for instance all candidates with |b| < |a|, since such couples are already included in the list in the switched form.

Example: What are the candidates for factorization of x2 + x − 2?

Solution: If there are integer roots a,b of the polynomial, then they must satisfy ab = −2. There are only two possibilities:

1. a = 1, b = −2;
2. a = −1, b = 2.

As we remarked, it is not necessary to consider the other two possibilities, a = 2, b = −1 and a = 2, b = −1.

Fine, we have our candidates, how do we find out which ones are correct? There are two ways. The correct couple must also satisfy the equation a + b = −p, so we try which one does it. Another way is not to remember this second condition, but simply try to multiply out all candidates and see which one gives the given quadratic polynomial. This sounds like a lot of work, but in fact it is easy and one can do most of it in one's head. Why? When multiplying, we are only worried about how many x's we get, since the absolute term will surely work out (because we did it that way, we used q to find candidates) and the x2 term will also fit. The only term that is open is the linear one, so one simply checks all possible decomposition for x's. Choose whichever method you prefer, we will show both.

Example: Find factorization of x2 + x − 2.

Solution: We found two candidates:

1. a = 1, b = −2;
2. a = −1, b = 2.

Method 1: The second condition is a + b = −1. We see that the first couple works, so it must be the correct one. We get the roots 1,−2 and the factorization

x2 + x − 2 = (x − 1)(x − (−2)) = (x − 1)(x + 2).

Method 2: We check how many x we get in both possible factorizations after multiplying out:

1. (x − 1)(x + 2) = ...+ x +...
2. (x + 1)(x − 2) = ...− x +...

We see that the first factorization is the correct one.

 

Sometimes there is more candidates.

Example: Find factorization of x2 + 8x + 12.

Solution: The unknown roots a,b must satisfy ab = 12. Possible decompositions of 12 are

12 = 1⋅12 = 2⋅6 = 3⋅4.

Again, we only wrote couples with the first number smaller (or equal - not here, but in general). A positive number can be obtained by multplying two positive or two negative numbers, so for each couple we actually get two candidate pairs. Thus we have:

1. a = 1, b = 12;
2. a = −1, b = −12;
3. a = 2, b = 6;
4. a = −2, b = −6;
5. a = 3, b = 4;
6. a = −3, b = −4.

To find which of these couples is correct we either check which of them satisfies a + b = −8, or we look at how many x the appropriate factorizations give:

1. (x − 1)(x − 12) = ...− 13x +...
2. (x + 1)(x + 12) = ...+ 13x +...
3. (x − 2)(x − 6) = ...− 8x +...
4. (x + 2)(x + 6) = ...+ 8x +...

And we have a winner, the correct decomposition is

x2 + 8x + 12 = (x + 2)(x + 6)

corresponding to the roots −2,−6.

 

What problems can we have? The obvious problem would be that the polynomial does not have real roots, or it does have roots but they are not nice integers.

Example: Find factorization of x2 − 2x − 10.

Solution: The unknown roots a,b must satisfy ab = −10. Possible decompositions of 10 are

10 = 1⋅10 = 2⋅5.

Again, we only wrote couples with the first number smaller (or equal - not here, but in general). A negative number can be obtained by multiplying a negative and a positive number and we have a choice which way to distribute the one sign, so again for each product we get two pairs of candidates:

1. a = 1, b = −10;
2. a = −1, b = 10;
3. a = 2, b = −5;
4. a = −2, b = 5.

It is now simple to check that no pair satisfies the condition a + b = 2, the same conclusion can be made using the multiplying out way:

1. (x − 1)(x + 10) = ...+ 9x +...
2. (x + 1)(x − 10) = ...− 9x +...
3. (x − 2)(x + 5) = ...+ 3x +...
4. (x + 2)(x − 5) = ...− 3x +...

It follows that it is not possible to factor out this quadratic polynomial using integers, so either there is no factorization at all, or it uses a,b not integers. The quadratic formula shows that the latter is the case, the roots are irrational numbers.

 

There is another possible problem. It can happen that there are integer roots and therefore a "nice" decomposition, but the list of candidates is so long that it is simply way faster to use the quadtratic formula then to check on many candidates.

Example: Find factorization of x2 − 42x + 360.

Solution: The unknown roots a,b must satisfy ab = 360. Possible decompositions of 360 are

360 = 1⋅360 = 2⋅180 = 3⋅120 = 4⋅90 = 5⋅72 = 6⋅60 = 8⋅45 = 9⋅40 = 10⋅36 = 12⋅30 = 15⋅24 = 18⋅20.

For each decomposition we have to consider two pluses or two minuses, which means that there are 24 candidates for factorization. Now the correct one might be the first one, in which case we could get it right away, but it could also be the last one or perhaps none, and I definitely would not feel like checking 24 times. It seems much easier to use the quadratic formula and find out that in this case we actually have the decomposition

x2 − 42x + 360 = (x − 12)(x − 30)

corresponding to the roots 12, 30. By the way, this would be the 19th candidate on our list.

By the way, this problems is not as bad as it seems, since we know that the desired numbers must add to 42. Most candidates are disqualified at the first sight, so it is not really necessary to check all couples but only those that, at the first sight, show a chance of making up 42 together. An experienced "guesser" would quickly scan the list of all decompositions and pick some 4 candidates for further selection. Of course, this does not really solve this problem, we were in fact being nice in this example: It is easy to write a quadratic polynomial where there would be hundreds of decompositions and even writing a short list of them for glancing at is out of the question.

 

Remark: Some people (for instance me) prefer a slight modification of the above procedure. Instead of writing the general decomposition as above, we write it as

x2 + px + q = (x + a)(x + b).

The only difference is in the signs, for some people it feels somewhat easier doing it this way. Instead of roots we thus find "minus roots", but this is not a problem.

Example: Find factorization of x2 − 5x + 4.

Solution: We want to have x2 − 5x + 4 = (x + a)(x + b). The unknown constants a,b must satisfy ab = 4. Possible decompositions of 4 are

4 = 1⋅4 = 2⋅2.

Again, we only wrote couples with the first number smaller (or equal). A positive number can be obtained by multplying two positive or two negative numbers, so for each couple we actually get two candidate pairs. Thus we have:

1. a = 1, b = 4;
2. a = −1, b = −4;
3. a = 2, b = 2;
4. a = −2, b = −2.

We now try the factorizations:

1. (x + 1)(x + 4) = ...+ 5x +...
2. (x − 1)(x − 4) = ...− 5x +...

And we have a winner, the correct decomposition is

x2 − 5x + 4 = (x − 1)(x − 4)

corresponding to the roots (beware the change of signs) 1, 4.