Sub topic 4
Factoring x^2 + bx + c
This chapter assumes you can expand a product of two binomials with FOIL or the distributive property. It also assumes you can do integer arithmetic with signs and that you know the zero product property from the previous chapters. Factoring a trinomial (a three-term polynomial) with leading coefficient 1 reverses that expansion.
Why this form comes first
A quadratic is monic when its leading coefficient a is 1, so it looks like x^2 + bx + c. Monic trinomials are the easiest to factor, and the other factoring techniques build on them. Solving by factoring only works if you can rewrite the trinomial as a product of two linear factors, so this skill carries most of the method.
The idea: run FOIL backward
Expand (x + m)(x + n):
(x + m)(x + n) = x^2 + nx + mx + mn = x^2 + (m + n)x + mn
Compare this with x^2 + bx + c. The two expressions match when:
- m + n = b (the middle coefficient is the sum of the two numbers)
- m * n = c (the constant term is their product)
So factoring x^2 + bx + c means finding two numbers whose product is c and whose sum is b. Then x^2 + bx + c = (x + m)(x + n).
Take x^2 + 5x + 6. You need a product of 6 and a sum of 5. The pairs that multiply to 6 are 1 and 6 (sum 7) or 2 and 3 (sum 5). The pair 2 and 3 works, so x^2 + 5x + 6 = (x + 2)(x + 3).
Reading the signs
You can narrow the search before listing any pairs. The sign of c tells you whether m and n share a sign, and the sign of b tells you which sign they share or which one is larger.
| Sign of c | Sign of b | What m and n look like | Example |
|---|---|---|---|
| positive | positive | both positive | x^2 + 7x + 12 = (x + 3)(x + 4) |
| positive | negative | both negative | x^2 - 7x + 12 = (x - 3)(x - 4) |
| negative | positive | opposite signs, larger one positive | x^2 + 2x - 15 = (x + 5)(x - 3) |
| negative | negative | opposite signs, larger one negative | x^2 - 2x - 15 = (x - 5)(x + 3) |
The reasons are short. A positive product needs two numbers with the same sign, and their sum then has that sign too. A negative product needs opposite signs. In that case the sum takes the sign of the number with the larger absolute value.
Worked examples
Example 1: both signs positive
Factor x^2 + 8x + 15. The product is 15 and the sum is 8. Both numbers are positive. The pairs are 1 and 15 (sum 16) or 3 and 5 (sum 8). So x^2 + 8x + 15 = (x + 3)(x + 5).
Example 2: c positive, b negative
Factor x^2 - 9x + 20. Both numbers are negative, because the product is positive and the sum is negative. The pairs are -1 and -20 (sum -21), -2 and -10 (sum -12), or -4 and -5 (sum -9). So x^2 - 9x + 20 = (x - 4)(x - 5).
Example 3: c negative
Factor x^2 - x - 12. The product is -12 and the sum is -1, so the numbers have opposite signs and the negative one is larger in size. Try 3 and -4. The product is -12 and the sum is -1. So x^2 - x - 12 = (x + 3)(x - 4).
Example 4: b = 0
Factor x^2 - 9. Write it as x^2 + 0x - 9. You need a product of -9 and a sum of 0, so the numbers are 3 and -3. This gives (x + 3)(x - 3), which is the difference of squares pattern in a later chapter.
Example 5: c = 0
Factor x^2 + 7x. The constant term is 0, so one of the numbers must be 0 and the other is 7. You get x(x + 7). This is the same as pulling out a common factor.
From factors to roots
Once the trinomial is factored, the zero product property gives the solutions of x^2 + bx + c = 0. Setting (x + m)(x + n) = 0 gives x + m = 0 or x + n = 0, so x = -m or x = -n. The roots are the negatives of the numbers you found.
For x^2 + 5x + 6 = 0, the factored form is (x + 2)(x + 3) = 0. The roots are x = -2 and x = -3.
A short program for the pair search
You can write the search as code. The function below tries each integer m from -|c| to |c|, computes n = b - m so the sum is automatically b, and tests whether the product is c. Every integer factor of a nonzero c lies in that range, so the search misses nothing. When c is 0, the value m = 0 always works.
def factor_monic(b, c):
"""Return integers (m, n) with x^2 + b*x + c = (x + m)(x + n), or None."""
for m in range(-abs(c), abs(c) + 1):
n = b - m
if m * n == c:
return m, n
return None
def term(k):
return f"(x + {k})" if k >= 0 else f"(x - {-k})"
def factored_form(b, c):
pair = factor_monic(b, c)
if pair is None:
return "not factorable over the integers"
m, n = pair
return term(m) + term(n)
print(factored_form(5, 6)) # (x + 2)(x + 3)
print(factored_form(-7, 12)) # (x - 4)(x - 3)
print(factored_form(2, -15)) # (x - 3)(x + 5)
print(factored_form(0, -9)) # (x - 3)(x + 3)
print(factored_form(3, 1)) # not factorable over the integersThe function returns the first pair it finds, so the order of the two factors can differ from what you would write by hand. Multiplication is commutative, so (x - 4)(x - 3) and (x - 3)(x - 4) are the same expression.
When no integer pair exists
Not every trinomial factors over the integers. For x^2 + 3x + 1, the only integer pairs with product 1 are 1 and 1 (sum 2) and -1 and -1 (sum -2). Neither sum is 3, so no integer factorization exists.
This does not mean the equation x^2 + 3x + 1 = 0 has no solutions. It has two real solutions, but they are irrational, so they cannot come from integer factors. Completing the square, covered in later chapters, handles these cases.
A practical test avoids a long search. Compute b^2 - 4c. If the trinomial factors over the integers, this number is a perfect square. For x^2 + 5x + 6 it is 25 - 24 = 1, which is a perfect square. For x^2 + 3x + 1 it is 9 - 4 = 5, which is not. A perfect square is necessary but you still need to find the pair. The reason for this test comes from the quadratic formula at the end of the tutorial.
Common errors
- Checking only the product. A pair like 2 and 3 for x^2 + 6x + 6 has the right product only for a different constant. Always test both the product and the sum.
- Mixing up the sign rules. If c is negative, one number is positive and one is negative. Two negative numbers can never multiply to a negative result.
- Forgetting that b can be 0 or c can be 0. Write the missing term as 0x or 0 so the pair conditions still apply.
- Writing the roots with the factor's signs. The roots are the negatives of m and n.
- Skipping the check. Expanding your answer takes a few seconds and catches sign slips.
- Applying the method when a is not 1. The sum-and-product test needs a leading coefficient of 1. If there is a common factor, pull it out first. If a is another number, use the technique for the general case.
Checking by expansion
To verify (x - 3)(x + 5) as the factoring of x^2 + 2x - 15, expand it:
(x - 3)(x + 5) = x^2 + 5x - 3x - 15 = x^2 + 2x - 15
The result matches the original, so the factorization is right. Also check the middle term against b: 5 + (-3) = 2, and the constant against c: 5 * (-3) = -15.
Exercise
Factor x^2 - 3x - 28, then use the zero product property to solve x^2 - 3x - 28 = 0.
Show answer
You need a product of -28 and a sum of -3. The numbers are 4 and -7, because 4 * (-7) = -28 and 4 + (-7) = -3. So x^2 - 3x - 28 = (x + 4)(x - 7). Setting each factor to 0 gives x = -4 and x = 7.
Exercise
Explain why x^2 + 4x + 6 cannot be factored over the integers. Use b^2 - 4c to support your answer.
Show answer
The integer pairs with product 6 are 1 and 6, 2 and 3, -1 and -6, and -2 and -3. Their sums are 7, 5, -7, and -5, and none equals 4. The test agrees: b^2 - 4c = 16 - 24 = -8, which is not a perfect square (it is negative). So no integer factorization exists.
Exercise
A student solves x^2 + 6x + 8 = 0 by writing (x + 2)(x + 4) = 0 and then states the solutions as x = 2 and x = 4. Find and fix the error.
Show answer
The factorization is correct, since 2 * 4 = 8 and 2 + 4 = 6. The error is in the last step. The factor (x + 2) = 0 gives x = -2, and (x + 4) = 0 gives x = -4. The solutions are x = -2 and x = -4. Substituting x = -2 gives 4 - 12 + 8 = 0, which confirms it.