Multiplying Polynomials

Imagine two small groups of people arriving at a party. Everyone in the first group must shake hands with everyone in the second group — no exceptions, no one left out. If three people meet two people, that's 3 \times 2 = 6 handshakes, every single time.

That is the whole of polynomial multiplication. You already know how to expand single brackets like 3(x + 4) — one term greeting everything inside one bracket. To multiply two brackets, every term of the first bracket multiplies every term of the second, and then you collect like terms. Nothing more. Every rule, mnemonic and method on this page is just a way of making sure no handshake gets missed.

For two binomials (two terms each) such as (2x + 5)(5x - 6), that's 2 \times 2 = 4 handshakes — often remembered as FOIL (First, Outer, Inner, Last):

(2x + 5)(5x - 6) = \underbrace{10x^2}_{\text{First}} \underbrace{- 12x}_{\text{Outer}} + \underbrace{25x}_{\text{Inner}} \underbrace{- 30}_{\text{Last}}

Then combine the two middle terms (-12x + 25x = 13x):

(2x + 5)(5x - 6) = 10x^2 + 13x - 30

Watch the four handshakes happen one at a time, laid out as a grid:

The result is a quadratic: the highest power is x^2, because an x from each factor multiplied together gives x \cdot x = x^2.

One warning about FOIL before we go further: it only names the four handshakes of a two-term times two-term product. The moment a bracket has three terms, FOIL runs out of letters — but the handshake rule never does. So learn the rule, not the acronym.

The grid method: the party planner

With four handshakes you can just about keep track in your head. But multiply a binomial by a trinomial — say (x + 2)(x^2 + 3x + 1) — and there are 2 \times 3 = 6 products to write down. This is where people start dropping terms. The grid method is the fix: it's a seating plan for the party. Put the terms of one bracket along the top, the terms of the other down the side, and each cell of the grid is exactly one handshake. When every cell is full, every product has been made — it is impossible to miss one.

Reading the six cells out and grouping the like terms:

x^3 + \underbrace{3x^2 + 2x^2}_{5x^2} + \underbrace{x + 6x}_{7x} + 2 (x + 2)(x^2 + 3x + 1) = x^3 + 5x^2 + 7x + 2

Notice how the like terms line up along the grid's diagonals — that's not a coincidence. Each diagonal collects the products whose powers of x match, the same way the columns of long multiplication collect digits with the same place value. (More on that surprising connection below.)

The grid also has a geometric soul. When every term is positive, it is literally a picture of area: a rectangle x + 3 wide and x + 4 tall splits into four smaller rectangles of areas x^2, 4x, 3x and 12 — total x^2 + 7x + 12. The ancient Greeks multiplied exactly this way, with actual rectangles drawn in sand. Once minus signs join in, the "areas" go negative and the picture becomes bookkeeping — but the grid keeps working perfectly.

The same product, line by line

The grid isn't compulsory — some people prefer systematic distribution, where each term of the first bracket takes the whole second bracket in turn, one line per term. Here is the very same product again:

\begin{aligned} (x + 2)(x^2 + 3x + 1) &= x(x^2 + 3x + 1) + 2(x^2 + 3x + 1) \\ &= x^3 + 3x^2 + x \\ &\quad + 2x^2 + 6x + 2 \\ &= x^3 + 5x^2 + 7x + 2 \end{aligned}

Same six handshakes, same answer — the grid just arranges them in a table while the line-by-line method stacks them in rows. Pick whichever you find harder to make mistakes in. A good habit either way: count your raw products before collecting. Two terms times three terms must give six products; if you've written five, someone at the party got snubbed, and it's far easier to spot now than after you've collected everything.

Predict before you multiply

Strong algebraists cheat: before doing a single handshake, they already know the shape of the answer. Two facts make this possible. The highest-power term of the product can only come from one place — the highest-power term of each bracket shaking hands. And the constant term can only come from the two constants shaking hands. Everything else lands in between.

For non-zero polynomials P and Q:

Try it on (3x^2 - x + 4)(2x^3 + 5x). Without expanding anything: the degree is 2 + 3 = 5, and the leading term is 3x^2 \cdot 2x^3 = 6x^5. There are 3 \times 2 = 6 raw products coming. Now, if your full expansion ever comes out with degree 6, or a leading coefficient that isn't 6, you know you've made an error before checking a single middle term. Prediction is your free proofreader.

A tougher one, signs and all

Let's put the whole toolkit to work on (2x - 3)(x^2 - x + 4). Predict first: the degree will be 1 + 2 = 3, the leading term 2x \cdot x^2 = 2x^3, the constant term (-3) \times 4 = -12, and there will be exactly 2 \times 3 = 6 raw products. Now the handshakes — each term carries its sign with it:

\begin{aligned} (2x - 3)(x^2 - x + 4) &= 2x(x^2 - x + 4) - 3(x^2 - x + 4) \\ &= 2x^3 - 2x^2 + 8x \\ &\quad - 3x^2 + 3x - 12 \\ &= 2x^3 - 5x^2 + 11x - 12 \end{aligned}

Six products, tick. Degree 3 with leading coefficient 2, tick. Constant -12, tick. Note the two handshakes that trip people: (-3) \times (-x) = +3x (two minuses make a plus), and 2x \times (-x) = -2x^2 (the minus survives even though both terms have an x). The signs did all their travelling inside the products, so the final collection is just arithmetic.

Three brackets? Do two, then the third

What about (x + 1)(x + 2)(x + 3)? Don't panic and don't invent a three-way handshake — multiplication is happy to go one pair at a time. Expand any two brackets first:

(x + 1)(x + 2) = x^2 + 3x + 2

then multiply the result by the remaining bracket (a trinomial times a binomial — six handshakes, grid or lines, your choice):

\begin{aligned} (x^2 + 3x + 2)(x + 3) &= x^3 + 3x^2 \\ &\quad + 3x^2 + 9x \\ &\quad + 2x + 6 \\ &= x^3 + 6x^2 + 11x + 6 \end{aligned}

And now run the predictions as a check: the degree should be 1 + 1 + 1 = 3 — it is. The constant term should be 1 \cdot 2 \cdot 3 = 6 — it is. (A bonus pattern worth noticing: the x^2 coefficient is 1 + 2 + 3 = 6, the sum of the three numbers. That's a first glimpse of a deep result about roots and coefficients you'll meet properly later.)

Almost every lost mark in bracket expansion is one of these three:

Work out 23 \times 141 by long multiplication. Now expand (2t + 3)(t^2 + 4t + 1):

(2t + 3)(t^2 + 4t + 1) = 2t^3 + 11t^2 + 14t + 3

Set t = 10 and read it out: 2000 + 1100 + 140 + 3 = 3243 — which is exactly 23 \times 141. That's because 23 = 2t + 3 and 141 = t^2 + 4t + 1 when t = 10: a number in base ten is just a polynomial with t = 10 plugged in. Long multiplication's columns are the grid's diagonals; "carrying the 1" is what happens when a coefficient like 11 or 14 overflows its place-value slot. Polynomials are place value unchained — no carrying, because a coefficient of 11 is perfectly welcome to stay 11.

This connection has teeth. In 1960 the great Russian mathematician Kolmogorov lectured that multiplying two n-digit numbers must always take about n^2 little products — all those handshakes, and surely no way around them. A 23-year-old student named Anatoly Karatsuba went away and, within a week, found a trick that computes a two-term product using only three multiplications instead of four, then applies itself over and over. Kolmogorov was delighted to be wrong, and Karatsuba's algorithm still helps computers multiply enormous numbers today — a speed-up discovered by treating numbers as the polynomials they secretly are.

See it explained