Factoring Quadratics

Learning goals

  • Find two numbers with sum bb and product cc
  • Read the signs from cc first, then from bb
  • Solve by factoring and the zero-product property
  • Pull out a common factor, or a shared xx, first
  • Check by expanding the factors back
  • Call a trinomial irreducible when no integer pair fits

Factoring reverses expanding

To factor an expression is to write it as a product. A trinomial has three terms, and a monic quadratic has leading coefficient 11. For a monic trinomial, expanding tells us what to look for when we work backward.

Why factoring x2+bx+cx^2 + bx + c means finding two numbers with sum bb and product cc#

Expand (x+2)(x+5)(x + 2)(x + 5) by multiplying every term in one factor by every term in the other:

(x+2)(x+5)=x2+5x+2x+10=x2+7x+10.\begin{aligned} (x + 2)(x + 5) &= x^2 + 5x + 2x + 10 \\ &= x^2 + 7x + 10. \end{aligned}

The middle coefficient is 2+5=72 + 5 = 7, and the constant is 2⋅5=102 \cdot 5 = 10. Reading backward, the pair 22, 55 factors x2+7x+10x^2 + 7x + 10.

The same expansion works for any numbers pp and qq in place of 22 and 55:

(x+p)(x+q)=x2+qx+px+pq=x2+(p+q)x+pq.\begin{aligned} (x + p)(x + q) &= x^2 + qx + px + pq \\ &= x^2 + (p + q)x + pq. \end{aligned}

Two quadratic expressions equal for every xx must have the same coefficients. To make this the trinomial x2+bx+cx^2 + bx + c, match the middle coefficient and the constant:

p+q=bandpq=c.p + q = b \qquad \text{and} \qquad pq = c.

So find two numbers with sum bb and product cc, and write (x+p)(x+q)(x + p)(x + q). Both leading terms are xx, which is why this rule gives a squared-term coefficient of 11.

For positive lengths, the expansion also describes a rectangle. Split its width into xx and pp, and its height into xx and qq. The four pieces show where the terms come from. The algebra above also works for negative values, even though a negative value cannot be a side length.

Area model for factoring x squared plus b x plus cA rectangle of width x plus p and height x plus q is divided by one vertical and one horizontal line into four cells with areas x squared, p x, q x, and p q, whose sum is x squared plus the quantity p plus q times x plus p q.xpxqx²pxqxpqx² + (p + q)x + pq
For positive lengths, the strips have areas px and qx, giving the middle term (p + q)x. The corner has area pq, the constant term.

Finding the two numbers

We are looking for integer factors. List the integer pairs whose product is cc, then check their sums. Use the signs to narrow the list:

The cases with b=0b = 0 or c=0c = 0 also fit the method, as we will see below.

Worked example 1 Factor x2+7x+12x^2 + 7x + 12

Here b=7b = 7 and c=12c = 12. The product 1212 is positive and the sum 77 is positive, so both numbers are positive. List the positive pairs that multiply to 1212 and check which one adds to 77:

1⋅12=12(sum 13),2⋅6=12(sum 8),3⋅4=12(sum 7).\begin{aligned} 1 \cdot 12 &= 12 && (\text{sum } 13), \\ 2 \cdot 6 &= 12 && (\text{sum } 8), \\ 3 \cdot 4 &= 12 && (\text{sum } 7). \end{aligned}

The pair 33 and 44 has the sum you want, so those are pp and qq:

x2+7x+12=(x+3)(x+4).x^2 + 7x + 12 = (x + 3)(x + 4).

Check by expanding the answer back: (x+3)(x+4)=x2+4x+3x+12=x2+7x+12(x + 3)(x + 4) = x^2 + 4x + 3x + 12 = x^2 + 7x + 12, the original.

Worked example 2 Factor x2−9x+20x^2 - 9x + 20

Now b=−9b = -9 and c=20c = 20. The product 2020 is positive, so the two numbers share a sign, and the sum −9-9 is negative, so both are negative. List the negative pairs multiplying to 2020:

(−1)(−20)=20(sum −21),(−2)(−10)=20(sum −12),(−4)(−5)=20(sum −9).\begin{aligned} (-1)(-20) &= 20 && (\text{sum } -21), \\ (-2)(-10) &= 20 && (\text{sum } -12), \\ (-4)(-5) &= 20 && (\text{sum } -9). \end{aligned}

The pair −4-4 and −5-5 works, so

x2−9x+20=(x−4)(x−5).x^2 - 9x + 20 = (x - 4)(x - 5).

Expanding confirms it: (x−4)(x−5)=x2−5x−4x+20=x2−9x+20(x - 4)(x - 5) = x^2 - 5x - 4x + 20 = x^2 - 9x + 20.

Worked example 3 Factor x2+2x−15x^2 + 2x - 15, then x2−2x−15x^2 - 2x - 15

Both trinomials have c=−15c = -15, which is negative, so in each the two numbers have opposite signs. The size pairs that multiply to 1515 are 11 and 1515 or 33 and 55. Of those two pairs, only 33 and 55 can be arranged to give a sum of size 22.

For x2+2x−15x^2 + 2x - 15 the sum is +2+2, so the number farther from zero is positive: take +5+5 and −3-3, since 5+(−3)=25 + (-3) = 2 and 5⋅(−3)=−155 \cdot (-3) = -15:

x2+2x−15=(x+5)(x−3).x^2 + 2x - 15 = (x + 5)(x - 3).

For x2−2x−15x^2 - 2x - 15 the sum is −2-2, so the number farther from zero is negative: take −5-5 and +3+3, since −5+3=−2-5 + 3 = -2 and (−5)(3)=−15(-5)(3) = -15:

x2−2x−15=(x−5)(x+3).x^2 - 2x - 15 = (x - 5)(x + 3).

The same size pair {3,5}\{3,5\} handles both trinomials. Both signs reverse, keeping the product at −15-15 and changing the sum from 22 to −2-2.

The method also works when bb is 00. To factor x2−9x^2 - 9, read it as x2+0x−9x^2 + 0x - 9 and look for two numbers with sum 00 and product −9-9. Opposite numbers of the same size add to 00, and 33 and −3-3 multiply to −9-9, so x2−9=(x+3)(x−3)x^2 - 9 = (x + 3)(x - 3). A missing middle term simply means the two numbers are opposites.

Check your understanding

Factor x2+8x+15x^2 + 8x + 15.

Answer choices

Solving a quadratic by factoring

Factoring rewrites an expression as a product. To solve an equation, we look for the values that make that product zero. First rearrange the equation so one side is 00. If its other side factors, then

(x+p)(x+q)=0(x + p)(x + q) = 0

gives x+p=0x + p = 0 or x+q=0x + q = 0 by the zero-product property from the previous lesson. Thus the roots are −p-p and −q-q. For example, the entry +3+3 in a factor x+3x + 3 gives the root −3-3. Keep the factoring numbers and the roots separate.

Worked example 4 Solve x2+x−6=0x^2 + x - 6 = 0

First factor the left side. With b=1b = 1 and c=−6c = -6, the product is negative, so the two numbers have opposite signs, and they must add to 11. The pair 33 and −2-2 works, since 3+(−2)=13 + (-2) = 1 and 3⋅(−2)=−63 \cdot (-2) = -6:

x2+x−6=(x+3)(x−2)=0.x^2 + x - 6 = (x + 3)(x - 2) = 0.

By the zero-product property, set each factor to 00:

x+3=0orx−2=0,x + 3 = 0 \qquad \text{or} \qquad x - 2 = 0,

so x=−3x = -3 or x=2x = 2. You can check the answer in two ways. Substituting confirms the roots, since (−3)2+(−3)−6=9−3−6=0(-3)^2 + (-3) - 6 = 9 - 3 - 6 = 0 and 22+2−6=02^2 + 2 - 6 = 0. Expanding the factors also rebuilds the original, since (x+3)(x−2)=x2+x−6(x + 3)(x - 2) = x^2 + x - 6.

Check your understanding

Solve x2−3x−10=0x^2 - 3x - 10 = 0 by factoring.

Answer choices

Pulling out a common factor first

Before searching for a sum-and-product pair, check for a common factor. It can make the remaining trinomial simpler, or finish the factoring immediately. Here are two common cases.

The first case is a trinomial whose three coefficients share a common numerical factor, such as 2x2+6x+42x^2 + 6x + 4. Its leading coefficient is not 11, so the sum-and-product method does not apply directly. But every term is even, so factor the 22 out front first:

2x2+6x+4=2(x2+3x+2).2x^2 + 6x + 4 = 2(x^2 + 3x + 2).

Inside the parentheses the leading coefficient is back to 11. The sum-and-product method now finishes the job: two numbers with sum 33 and product 22 are 11 and 22, so

2(x2+3x+2)=2(x+1)(x+2).2(x^2 + 3x + 2) = 2(x + 1)(x + 2).

Pull out the greatest common numerical factor first. It reduces the coefficients you must work with. Here the remaining leading coefficient is 11, so the monic method applies. If it is still greater than 11, the next lesson shows what to do.

The second case is a quadratic with no constant term, like x2−5xx^2 - 5x. Here c=0c = 0, and instead of hunting for a pair you simply pull out the shared xx. The pair would be 00 and −5-5 (or 00 and bb in x2+bxx^2+bx):

x2−5x=x(x−5).x^2 - 5x = x(x - 5).

Every term contains an xx, so xx is the common factor, and a single linear factor is left. Solving x2−5x=0x^2 - 5x = 0 then gives x=0x = 0 or x=5x = 5. The root x=0x = 0 is the one most often lost: dividing both sides by xx removes it. Keep the factor instead of dividing, and you keep both roots.

Worked example 5 Solve 3x2−6x−24=03x^2 - 6x - 24 = 0

Every coefficient is a multiple of 33, so pull out the 33 first:

3x2−6x−24=3(x2−2x−8)=0.3x^2 - 6x - 24 = 3(x^2 - 2x - 8) = 0.

Now factor the monic trinomial inside. With sum −2-2 and product −8-8, the numbers are −4-4 and 22, since −4+2=−2-4 + 2 = -2 and (−4)(2)=−8(-4)(2) = -8:

3(x−4)(x+2)=0.3(x - 4)(x + 2) = 0.

The constant 33 is not 00, and a nonzero constant factor cannot make a product zero, so it adds no root; the product is zero exactly when one of the variable factors is. Setting x−4=0x - 4 = 0 or x+2=0x + 2 = 0 gives

x=4orx=−2.x = 4 \qquad \text{or} \qquad x = -2.

Check your understanding

Factor 2x2+10x+122x^2 + 10x + 12 completely.

Answer choices

When a trinomial will not factor

Not every trinomial can be factored this way. The method depends on finding two integers with the right sum and product, and sometimes no such pair exists. Take x2+x+1x^2 + x + 1. You would need two numbers that multiply to 11 and add to 11. The only integer pairs that multiply to 11 are 11 and 11, which add to 22, or −1-1 and −1-1, which add to −2-2. Neither adds to 11, so the search fails, and x2+x+1x^2 + x + 1 is irreducible over the integers: it cannot be written as a product of two linear factors with integer coefficients. For this monic quadratic, those factors would be (x+p)(x+q)(x+p)(x+q) with integers pp and qq.

Being irreducible over the integers is not the same as having no solutions at all. The equation x2+x−1=0x^2 + x - 1 = 0 is irreducible the same way, yet it still has two real solutions, just not integers. The equation x2+x+1=0x^2 + x + 1 = 0, though, has no real solution at all: later lessons on completing the square and the quadratic formula will show why. For now, if you check every factor pair of cc and none of them adds to bb, you can stop and report that the trinomial does not factor over the integers.

Check your understanding

Which quadratic expression is irreducible over the integers?

Answer choices

Common mistakes

Practice

Multiple Choice Questions (MCQ)

Progressively harder sets of questions. Each opens on its own page.

Core practice

Practice problems at the level of the course, to be worked out on paper. Hints one at a time, then the answer or the full worked solution, with your progress kept in this browser.

Core practice Work it out on paper 10 problems Start →
More practice (optional)

Extra sets, as hard as the Challenge set. Each one opens on its own page.

More resources (optional)

Other explanations of this lesson, if you want a second take.

A bit of history (optional)

Divide 2020 into two parts whose product is 9696. This puzzle appears in the Arithmetica of Diophantus, a mathematician associated with Alexandria and usually dated to about eighteen centuries ago. It is usually numbered I.27.

Diophantus began halfway between the two numbers. Half of 2020 is 1010, so the parts must sit equally far above and below 1010. Their product is 9696, which is 44 less than 102=10010^2 = 100. Since 4=224 = 2^2, the parts are 10+2=1210 + 2 = 12 and 10−2=810 - 2 = 8.

He attached a condition to the problem: the square of half the sum, minus the product, must be a square. He was seeking positive rational answers, numbers expressible as fractions. Our factoring is limited in a similar way, to integers, so a failed search for integer factors does not by itself show that a modern equation has no real roots.

The pair 1212, 88 also gives the modern factorization x2−20x+96=(x−12)(x−8)x^2 - 20x + 96 = (x - 12)(x - 8). Diophantus reached it without writing our quadratic notation.

Sources: Heath’s translation, printed page 169 (numbered I.30 in this 1885 edition) and Katz, A History of Mathematics, chapter 6, exercise 8.

Your progress

See all your progress →