Shape an expressionLesson 07 of 48 · 7 min

Expand or factor?

Choose between a sum of terms and a product of factors.

Maths refresher: The distributive law

Multiplication distributes over addition. Factoring applies that relationship in reverse.

(x−2)(x+3)=x2+x−6(x-2)(x+3)=x^2+x-6
Worked example

The two cross terms are 3x3x and −2x-2x, so the coefficient of x is 1. The constant term is -6.

Maths prerequisite map ↗

Expanding distributes products and powers into a sum. Factoring seeks a product representation. Both can represent the same polynomial, but each makes different structure visible.

See the mathematics
-4-2.25-0.51.253-7-3.250.54.258xy−32
-4-2.25-0.51.253-7-3.250.54.258xy−32
x2+x−6=(x+3)(x−2)x^2+x-6=(x+3)(x-2)
Starter reference. The two factors locate the two crossings of the horizontal axis.

A product can reveal zeros: if a product of real or complex numbers is zero, at least one factor is zero. A sum of powers is often convenient for reading coefficients or differentiating term by term. Choose the form from the task.

The example starts with a quadratic whose factors are small integers. Verify that expanding the factored result recovers the polynomial. Successful factorisation here is over rational coefficients; other domains or extensions can produce different factorizations.

Which form will make the zeros x=2x=2 and x=−3x=-3 easiest to see?

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 ↗

Polynomial
x2+x−6x^{2} + x - 6
Factored
(x−2)(x+3)\left(x - 2\right) \left(x + 3\right)
Expanded again
x2+x−6x^{2} + x - 6
Identity check
00
Worked text output
Polynomial: x**2 + x - 6
Factored: (x - 2)*(x + 3)
Expanded again: x**2 + x - 6
Identity check: 0

Read the starter result

Read Polynomial, Factored and Expanded again to check that both forms describe the same polynomial. The zero Identity check checks their exact difference.

Edit and compare

Replace polynomial = x**2+x-6 with polynomial = x**2+1. Select Run Python with factored = sp.factor(polynomial) unchanged. Then add , extension=sp.I inside that factor call and select Run Python again. Read Factored and Identity check. Which coefficient choices give new factors?

Return to the editor

Scope. A factorisation depends on the coefficient domain. A polynomial irreducible over rationals may factor over complex numbers.

Try a fresh case

You want to read the coefficient of x cubed. Which representation is usually useful?

Choose an answer
Need a hint?
Hint 1

A coefficient multiplies a power of the variable.

Hint 2

Write the expression as a sum of powers.

Your notesNotes save in this browser when storage is available.