Polynomials and Factoring
Multiplying Polynomials and the Special Products
Multiplying polynomials by the distributive law, the FOIL bookkeeping aid, and the seven special products worth recognising instantly in both directions.
What this page covers
- Multiply any two polynomials using the distributive law
- Recognise and apply the perfect-square and difference-of-squares patterns
- Expand sums and differences of cubes, and cubes of binomials
- Use the special products backwards as factoring patterns
Everything reduces to the distributive law
There is only one rule for multiplying polynomials: a(b + c) = ab + ac, applied as many times as there are brackets. Every named technique below is that law used in a particular shape.
Worked example — monomial times binomial
The x3 multiplies both terms inside. The exponents add, because x3 · x2 is three xs multiplied by two more, giving five in total — the index law derived in The Index Laws.
Two brackets: the origin of FOIL
Treat the first bracket as a single quantity and distribute it, then distribute each of its parts.
| Letter | Stands for | Product |
|---|---|---|
| F | First terms of each bracket | ac |
| O | Outer terms | ad |
| I | Inner terms | bc |
| L | Last terms | bd |
FOIL is a bookkeeping aid for the two-binomial case only. For (x + 1)(x2 + 3x - 2) there are six products, not four, and reaching for FOIL will lose two of them. Distribute systematically instead: every term in the first bracket against every term in the second.
The perfect squares
Both come straight out of the four-product expansion, with the outer and inner products turning out to be equal:
The middle term is 2ab in both cases, up to sign. It is the term that is dropped when someone writes (a + b)2 = a2 + b2, and dropping it is wrong by a wide margin: at a = b = 1 the true value is 4 and the mistaken one is 2.
Read backwards, these are the patterns that identify a perfect square trinomial. The source lists the tests: the first and last terms are perfect squares, and the middle term is twice the product of their square roots.
| Trinomial | First term | Last term | Middle check | Factors as |
|---|---|---|---|---|
| x2 + 4x + 4 | x2 | 22 | 2 · x · 2 = 4x ✓ | (x + 2)2 |
| x2 + 6x + 9 | x2 | 32 | 2 · x · 3 = 6x ✓ | (x + 3)2 |
| x2 - 8x + 16 | x2 | 42 | 2 · x · 4 = 8x ✓ | (x - 4)2 |
| x2 + 5x + 4 | x2 | 22 | 2 · x · 2 = 4x ≠ 5x ✗ | Not a perfect square; (x + 4)(x + 1) |
The general statement, from Week 1 page 11, is (x + a)2 = x2 + 2ax + a2. Reading it right to left is exactly the manoeuvre used in Completing the Square: given x2 + 2ax, the term needed to complete the square is a2, the square of half the x coefficient.
The difference of two squares
This is the most useful single identity in elementary algebra, because it is the one that makes an unwanted term disappear. It underlies rationalising a denominator, and it is the reason a conjugate pair multiplies to something with no radical in it.
Factoring
x4 - y4 = (x2 - y2)(x2 + y2) = (x - y)(x + y)(x2 + y2). Applying it twice is often required.
Rationalising
(√5 - √3)(√5 + √3) = 5 - 3 = 2. Both radicals vanish at once.
Mental arithmetic
97 × 103 = (100 - 3)(100 + 3) = 10000 - 9 = 9991.
Complex numbers
(3 - 2i)(3 + 2i) = 9 - 4i2 = 9 + 4 = 13, because i2 = -1 flips the sign.
There is no corresponding factorisation of a sum of squares over the reals. The source notes state flatly that x2 + 9 is prime. It has no real zeros, so it cannot split into real linear factors.
Cubes
Note the sign pattern, which is easy to get backwards: the binomial carries the sign of the original expression, and the middle term of the trinomial carries the opposite sign. The trinomial factor never factors further over the reals.
Verifying the difference of cubes
This cancellation is why the trinomial has to be exactly a2 + ab + b2 and not a2 + 2ab + b2.
The coefficients 1, 3, 3, 1 are the fourth row of Pascal's triangle. In the difference case the signs alternate, starting positive.
The seven special products in one place
| Expanded | Factored | Name |
|---|---|---|
| a2 + 2ab + b2 | (a + b)2 | Perfect square |
| a2 - 2ab + b2 | (a - b)2 | Perfect square |
| a2 - b2 | (a + b)(a - b) | Difference of two squares |
| a3 - b3 | (a - b)(a2 + ab + b2) | Difference of cubes |
| a3 + b3 | (a + b)(a2 - ab + b2) | Sum of cubes |
| a3 + 3a2b + 3ab2 + b3 | (a + b)3 | Cube of a sum |
| a3 - 3a2b + 3ab2 - b3 | (a - b)3 | Cube of a difference |
These are worth recognising in both directions. Read left to right they save the work of multiplying out; read right to left they are five of the standard factoring patterns, covered in Factoring Polynomials.
Substitute a convenient number for each variable in the original and in the answer. Taking a = 2, b = 1: (2 + 1)3 = 27, and 8 + 3 · 4 · 1 + 3 · 2 · 1 + 1 = 8 + 12 + 6 + 1 = 27. Agreement at one point is not a proof, but disagreement is an instant refutation, and most sign errors are caught this way in seconds.
Longer multiplications
When either bracket has more than two terms, work systematically rather than by pattern. Multiply each term of the first by every term of the second, then collect.
Worked example — (2x + 3)(x2 - 4x + 5)
| × | x2 | -4x | +5 |
|---|---|---|---|
| 2x | 2x3 | -8x2 | 10x |
| +3 | 3x2 | -12x | 15 |
A degree-1 bracket times a degree-2 bracket must give degree 3, and it does.
At x = 1: (2 + 3)(1 - 4 + 5) = 5 × 2 = 10, and 2 - 5 - 2 + 15 = 10.
The grid is worth the extra half-minute on anything larger than two binomials. It makes a missing product visible as an empty cell rather than an invisible omission.
Common mistakes
| Mistake | Correct | Fast check |
|---|---|---|
| (a + b)2 = a2 + b2 | a2 + 2ab + b2 | a = b = 1 gives 4, not 2 |
| (a - b)2 = a2 - b2 | a2 - 2ab + b2 | a = 2, b = 1 gives 1, not 3 |
| a3 - b3 = (a - b)3 | (a - b)(a2 + ab + b2) | a = 2, b = 1: left is 7, right cube is 1 |
| Sign flipped in the cubes trinomial | Binomial and trinomial middle terms carry opposite signs | Expand and confirm four terms cancel |
| Using FOIL on a trinomial | Distribute every term against every term | Count the products: m terms times n terms gives mn |
| Trying to factor a2 + b2 | It is prime over the reals | It has no real zeros, so no real linear factors |
Frequently asked questions
Is (a + b)2 equal to a2 + b2?
No, and this is probably the single most common algebra error. (a + b)2 = a2 + 2ab + b2; the middle term is genuinely there. Testing with a = b = 1 settles it at once: the left side is 4, the mistaken right side is 2.
Does FOIL work for three terms?
No. FOIL names the four products that arise when two binomials are multiplied, so it stops being a complete description the moment either bracket has three terms. The distributive law handles any size and is what FOIL is an abbreviation of.
Why is a2 + b2 not factorable?
Over the real numbers it has no factorisation, because it has no real zeros. The source notes call x2 + 9 prime for this reason. Over the complex numbers it does factor, as (a + bi)(a - bi).
Do I have to memorise all seven special products?
The perfect squares and the difference of two squares, yes — they appear constantly, in completing the square, in rationalising denominators and in trigonometric identities. The cubes are worth recognising but can be re-derived by multiplying out when needed.
Source. Handwritten teaching notes, Week 1, page 8, with the derivation of FOIL from Week 1, page 5.
This page is an original exposition prepared for the KEVOS® knowledge library. It restates, reorganises and verifies the mathematics of the supplied teaching notes; it is not a reproduction of them. Numerical values taken from the notes are identified as source examples and are not presented as engineering standards.
