Sub topic 3
Simplifying by factoring and cancelling
This chapter assumes you can factor polynomials (common factors, difference of squares, trinomials), solve linear and quadratic equations, and find the excluded values of a rational expression. Here you will simplify a rational expression by cancelling common factors. You will also see why the simplified form is not quite the same as the original.
What "simplified" means
A rational expression is in lowest terms when its numerator and denominator share no common factor other than 1 and -1. Simplifying means reaching lowest terms without changing the value of the expression, for every input where the original is defined.
The rule behind every step is this:
> For polynomials P, Q and R with Q ≠ 0 and R ≠ 0, (P·R)/(Q·R) = P/Q.
Cancelling divides the numerator and denominator by the same non-zero quantity R. The rule only applies to factors, meaning pieces joined by multiplication. It never applies to terms, meaning pieces joined by addition or subtraction.
The procedure
- Factor the numerator completely.
- Factor the denominator completely.
- Record the excluded values from the original denominator.
- Cancel each factor that appears in both.
- Write what remains.
Step 3 comes before step 4 because cancelling hides information. After cancellation, the factor that caused an exclusion may no longer be visible.
Worked example
Simplify (x² − 9)/(x² − 5x + 6).
Factor the numerator as a difference of squares: x² − 9 = (x − 3)(x + 3). Factor the denominator as a trinomial: x² − 5x + 6 = (x − 2)(x − 3).
The original denominator is zero at x = 2 and x = 3, so those values are excluded. Cancel the common factor (x − 3):
(x − 3)(x + 3) / ((x − 2)(x − 3)) = (x + 3)/(x − 2), for x ≠ 2, x ≠ 3.
The simplified fraction is undefined only at x = 2. It looks defined at x = 3, but the original is not. So the full statement must keep both restrictions.
from sympy import symbols, cancel
x = symbols('x')
expr = (x**2 - 9) / (x**2 - 5*x + 6)
print(cancel(expr)) # (x + 3)/(x - 2)cancel factors the numerator and denominator and removes common factors. It does not report that x = 3 was excluded. You have to track that yourself.
Cancel factors, not terms
The most common error is cancelling a piece that is not a factor of the whole numerator or denominator.
| Attempt | Why it fails |
|---|---|
| (x + 3)/(x + 5) → 3/5 | x is a term, not a factor. At x = 1 the left side is 4/6, not 3/5. |
| (x² + 4)/(x + 2) → x + 2 | x² and 4 are terms. Dividing x² by x does not cancel anything. |
| (2x + 6)/2 → 2x + 3 | Wrong: 2 must divide every term. The correct result is x + 3. |
A quick test catches these errors. Substitute a number that is allowed by the original expression into both the original and your answer. If the results differ, you made a mistake. If they agree, you have not proved correctness, but you have good evidence.
The third row shows a related mistake. When you cancel a number from a sum, factor it out first: (2x + 6)/2 = 2(x + 3)/2 = x + 3.
Opposite factors
Factors such as (x − 2) and (2 − x) look different but are negatives of each other: 2 − x = −(x − 2). Rewrite one of them, then cancel:
(x² − 4)/(2 − x) = (x − 2)(x + 2) / (−(x − 2)) = −(x + 2), for x ≠ 2.
The sign is easy to lose here. A useful habit is to factor −1 out of the denominator first, so every factor has the same form.
from sympy import symbols, cancel
x = symbols('x')
print(cancel((x**2 - 4) / (2 - x))) # -x - 2Factoring completely matters
Cancelling fails when you stop factoring too early. In (x³ − x)/(x² + x), you might see no common factor. After taking out the greatest common factor first, the structure appears:
- Numerator: x³ − x = x(x² − 1) = x(x − 1)(x + 1).
- Denominator: x² + x = x(x + 1).
Cancel x and (x + 1) to get x − 1, with x ≠ 0 and x ≠ −1.
Each cancelled factor adds an exclusion. Exclusions are collected from the original denominator, so the simplified result x − 1 hides two restrictions.
Repeated factors and exponents
When a factor appears with a power, subtract exponents:
(x − 1)³(x + 2) / ((x − 1)(x + 2)²) = (x − 1)² / (x + 2).
One copy of (x − 1) and one copy of (x + 2) cancel. What remains in the denominator is (x + 2)¹. The exclusions are x ≠ 1 and x ≠ −2.
Irreducible factors
Some quadratics do not factor over the real numbers, such as x² + 4. If an irreducible factor appears in both the numerator and denominator, cancel it. Otherwise leave it alone. Do not try to cancel x² against x from inside x² + 4.
Checking the original domain with code
The next script finds the excluded values from the original denominator and compares them with what the simplified form shows.
from sympy import symbols, fraction, solve, cancel
x = symbols('x')
expr = (x**2 - 9) / (x**2 - 5*x + 6)
num, den = fraction(expr)
simplified = cancel(expr)
_, den_simple = fraction(simplified)
print(solve(den, x)) # [2, 3] excluded in the original
print(solve(den_simple, x)) # [2] excluded in the simplified formThe two lists differ by exactly one value, x = 3. That value is where a factor cancelled, and later chapters treat it as a hole in the graph. The simplified form is equal to the original everywhere except at the values that were cancelled away.
Edge cases to watch for
- A numerator of zero. If the numerator factors to include 0 as a constant, such as 0/(x − 1), the expression equals 0 wherever it is defined. It is not "undefined".
- No factoring possible. An expression such as (x + 1)/(x² + 1) is already in lowest terms. Nothing cancels.
- Constants. Numerical common factors cancel too: (6x + 12)/(9x + 18) = 6(x + 2)/(9(x + 2)) = 2/3, for x ≠ −2. The result is a constant, but the restriction x ≠ −2 remains.
- Sign conventions. Placing the negative sign in front of the fraction, in the numerator or in the denominator, gives equal values. State a consistent form so answers can be compared.
Exercises
Exercise
Simplify (x² − x − 12)/(x² − 16) and state every excluded value.
Show answer
Factor the numerator as (x − 4)(x + 3) and the denominator as (x − 4)(x + 4). The excluded values are x = 4 and x = −4. Cancelling (x − 4) leaves (x + 3)/(x + 4), valid for x ≠ 4 and x ≠ −4.
Exercise
A student simplifies (x² + 5x)/(x + 5) to x² by cancelling the 5s. Explain the error and give the correct result.
Show answer
The 5s are terms inside sums, not factors of the whole numerator and denominator. Factoring the numerator gives x(x + 5), so (x + 5) cancels and the result is x, for x ≠ −5. A check at x = 1 gives 6/6 = 1, which matches x and not x².
Exercise
Simplify (3 − x)/(x² − 9) and state the excluded values.
Show answer
Write 3 − x = −(x − 3) and x² − 9 = (x − 3)(x + 3). Cancelling (x − 3) leaves −1/(x + 3). The excluded values are x = 3 and x = −3.