Shape an expressionLesson 09 of 48 · 7 min

Cancel with the domain in view

Simplify a rational expression while retaining its original excluded inputs.

Maths refresher: Division by zero and removable holes

A fraction requires a nonzero denominator. Cancelling a common factor preserves equality only where that factor was nonzero.

x2−1x−1=x+1for x≠1\frac{x^2-1}{x-1}=x+1\quad\text{for }x\ne1
Worked example

At x=2x=2 both expressions equal 3. At x=1x=1 the original becomes 0/0, while the polynomial equals 2.

Maths prerequisite map ↗

Cancelling a common factor can simplify a fraction. The domain is the set of inputs where the original fraction is defined. It excludes any input that makes the original denominator zero.

See the mathematics
-2-0.512.54-20246xyexcluded
-2-0.512.54-20246xyexcluded
x2−1x−1=x+1(x≠1)\frac{x^2-1}{x-1}=x+1\quad(x\ne1)
Starter reference. The open point preserves the original exclusion. The line approaches 2 at x = 1; the original fraction has no value there.

The code starts with x2−1x^2-1 divided by x−1x-1. Cancelling gives x+1x+1 for every input in the original domain. The original is undefined at x=1x=1, where the cancelled polynomial evaluates to 2.

Python keeps the original denominator and uses solveset to find where it is zero for real xx. The hole setting chooses the excluded value and the input for the two evaluation results.

Does cancellation prove that the original fraction is defined at x=1x=1?

Write a prediction (optional)

Exact symbolic investigation

Select Run Python with the code unchanged.

Tools
About Python

Python and the course packages can load while you read. Each run starts with fresh user variables; imported modules stay loaded. Stop replaces the worker. Runtime details ↗

Ctrl+Enter or ⌘+Enter runs Python.

Compare with the worked example

Executed from the published Python during the site build. Your own run appears above. Build environment ↗

Original denominator
x−1x - 1
Cancelled formula
x+1x + 1
Excluded input
{1}\left\{1\right\}
Original at 1
Undefined\mathtt{\text{Undefined}}
Cancelled formula at 1
22
Worked text output
Original denominator: x - 1
Cancelled formula: x + 1
Excluded input: {1}
Original at 1: Undefined
Cancelled formula at 1: 2

Read the starter result

Find Excluded input, Original at 1 and Cancelled formula at 1. Both formulas agree at every permitted input. Only the cancelled polynomial has a value at 1.

Edit and compare

Replace hole = 1 with hole = 2 in the editor. Select Run Python. Compare Excluded input, Original at 2 and Cancelled formula at 2. Which value does the polynomial supply, and why does the original rule still exclude that input?

Return to the editor

Scope. SymPy expressions do not automatically retain a full history of removed domain restrictions.

Try a fresh case

A transformed expression agrees with the original except at a cancelled denominator zero. What should a report include?

Choose an answer
Need a hint?
Hint 1

Inspect the denominator before cancellation.

Hint 2

Keep its zeros as exclusions.

Your notesNotes save in this browser when storage is available.