Sub topic 1
Review: polynomials and factoring
Every skill in this tutorial rests on factoring. Simplifying a rational expression means cancelling common factors. Finding excluded values means finding the zeros of a denominator. Locating holes and asymptotes means reading factors off a numerator and denominator. This chapter reviews the factoring tools you need and the habits that prevent the most common errors.
Prerequisites
This chapter assumes you can:
- Add, subtract and multiply fractions.
- Add, subtract and multiply polynomials, including distributing and combining like terms.
- Solve linear and quadratic equations.
- Use function notation and plot points on the coordinate plane.
If any of these feel shaky, review them first. The sections below start from the definitions.
Polynomials in brief
A polynomial is a sum of terms of the form c·xⁿ, where c is a number and n is a whole number (0, 1, 2, ...). The degree is the largest exponent. The leading coefficient is the coefficient of that highest-degree term.
- 3x² − 5x + 1 is a polynomial of degree 2 with leading coefficient 3.
- 1/x and √x are not polynomials, because the exponents −1 and 1/2 are not whole numbers.
A polynomial is factored when it is written as a product of simpler polynomials. It is factored completely when no factor can be split further using integer coefficients. Factoring undoes multiplication: (x − 2)(x − 3) expands to x² − 5x + 6, and factoring goes the other way.
The factoring toolkit
Work through these patterns in order. Always check for a common factor first.
| Pattern | Form | Example |
|---|---|---|
| Greatest common factor | ab + ac = a(b + c) | 6x³ + 9x² = 3x²(2x + 3) |
| Difference of squares | a² − b² = (a − b)(a + b) | x² − 9 = (x − 3)(x + 3) |
| Perfect square trinomial | a² ± 2ab + b² = (a ± b)² | x² + 6x + 9 = (x + 3)² |
| Trinomial with a = 1 | x² + bx + c = (x + p)(x + q), p + q = b, pq = c | x² − 5x + 6 = (x − 2)(x − 3) |
| Sum of cubes | a³ + b³ = (a + b)(a² − ab + b²) | x³ + 8 = (x + 2)(x² − 2x + 4) |
| Difference of cubes | a³ − b³ = (a − b)(a² + ab + b²) | x³ − 8 = (x − 2)(x² + 2x + 4) |
Trinomials with a leading coefficient other than 1
For ax² + bx + c, find two numbers whose product is a·c and whose sum is b. Use them to split the middle term, then factor by grouping.
For 6x² + 7x − 3, the product ac is −18 and the sum is 7. The numbers 9 and −2 work:
6x² + 9x − 2x − 3 = 3x(2x + 3) − (2x + 3) = (2x + 3)(3x − 1)
Factoring by grouping
Four-term polynomials often factor by grouping. For x³ + 3x² − 4x − 12, group the terms in pairs:
x²(x + 3) − 4(x + 3) = (x + 3)(x² − 4) = (x + 3)(x − 2)(x + 2)
Notice the last step. The factor x² − 4 is itself a difference of squares, so you must keep going until nothing splits further.
Checking factorizations with SymPy
SymPy's factor function factors over the integers (rationals). Use it to check your hand work, not to replace it.
from sympy import symbols, factor, expand
x = symbols('x')
print(factor(x**2 - 9)) # (x - 3)*(x + 3)
print(factor(6*x**2 + 7*x - 3)) # (2*x + 3)*(3*x - 1)
print(factor(x**3 + 3*x**2 - 4*x - 12)) # (x - 2)*(x + 2)*(x + 3)
print(factor(x**3 - 8)) # (x - 2)*(x**2 + 2*x + 4)
# Expanding the result should return the original polynomial.
print(expand((2*x + 3)*(3*x - 1))) # 6*x**2 + 7*x - 3The order of factors in the printed output may differ from the comments. Multiplication is commutative, so the results are equivalent.
Edge cases and common errors
Irreducible factors. Some polynomials do not factor over the real numbers. The sum of squares x² + 4 is one. Likewise, x² + 2x + 4 from the cubes formulas has a negative discriminant (2² − 4·1·4 = −12), so it stays as it is. Do not force a split.
from sympy import symbols, factor
x = symbols('x')
print(factor(x**2 + 4)) # x**2 + 4
print(factor(x**2 + 2*x + 4)) # x**2 + 2*x + 4Opposite factors. The binomials a − b and b − a are negatives of each other: x − 5 = −(5 − x). Spotting this later will let you cancel factors that look different. It also explains why a sign error is the most common mistake when simplifying.
Forgetting the common factor. The expression 2x² − 18 is a difference of squares only after you factor out 2. The complete answer is 2(x − 3)(x + 3). Stopping at 2(x² − 9) is incomplete.
Terms versus factors. You can only cancel factors, which are things multiplied together. You cannot cancel terms, which are things added together. In (x + 3)/(x + 5), the x's are parts of sums and do not cancel. This distinction is the foundation of the next chapters.
Zeros and the zero product property
A zero (or root) of a polynomial p is a number r with p(r) = 0. The zero product property says that if a·b = 0, then a = 0 or b = 0. This links factoring to solving equations.
To solve x² − 5x + 6 = 0, factor it as (x − 2)(x − 3) = 0. Then x − 2 = 0 or x − 3 = 0, so x = 2 or x = 3.
The factor theorem states the connection in both directions: (x − r) is a factor of p(x) exactly when p(r) = 0. Later you will use this to find the zeros of a denominator, which are the values a rational expression excludes.
from sympy import symbols, solve
x = symbols('x')
p = x**2 - 5*x + 6
print(solve(p, x)) # [2, 3]
print([p.subs(x, r) for r in (2, 3)]) # [0, 0]What to carry forward
- Factor out the greatest common factor first, then apply a pattern, and repeat until nothing splits further.
- Factored form shows the zeros directly through the factor theorem.
- Cancel factors only, never terms.
- Check by expanding. If the product does not match the original, find the error before moving on.
Exercise
Factor 4x³ − 36x completely, then state the zeros of the polynomial.
Show answer
Factor out the common factor 4x: 4x(x² − 9). The remaining factor is a difference of squares, so the complete factorization is 4x(x − 3)(x + 3). The zeros are x = 0, x = 3 and x = −3.
Exercise
A student simplifies (x + 4)/(x + 7) by cancelling the x's and writes 4/7. Explain the error and find the value of x at which the two expressions differ most obviously, using x = 1.
Show answer
The x's are terms in sums, not factors, so they cannot be cancelled. At x = 1, (1 + 4)/(1 + 7) = 5/8, but the student's answer is 4/7. These are different numbers, so the simplification is wrong.
Exercise
Factor x³ + 2x² − 9x − 18 completely by grouping.
Show answer
Group as x²(x + 2) − 9(x + 2) = (x + 2)(x² − 9) = (x + 2)(x − 3)(x + 3).