Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Polynomial Multiplication


FOIL, generalized. Multiply each term of the left polynomial by each term of the right — that's the grid. Group cells with the same power of x into like-term buckets, then sum each bucket.
Pick an example or build your own
Left polynomial — P(x)
x2 − 3x + 2
x
x
x
Right polynomial — Q(x)
2x + 5
x
x
0 / 6 cells
P(x) · Q(x) — pairwise products and collection
Left has 3 terms, right has 2 terms. Distributing gives 3 × 2 = 6 pairwise products. Each cell's exponent is the sum of its row and column exponents — that's how products group into like-term buckets.
Six cells and no acronym: every left term meets every right term once, and the degree of the result is the sum of the degrees. Learn more about this product · All presets
2x5
x22x35x2
−3x−6x2−15x
24x10
x3 termsexp = 3
(empty)
sum: 0
x2 termsexp = 2
(empty)
sum: 0
x termsexp = 1
(empty)
sum: 0
constantsexp = 0
(empty)
sum: 0
Result (pending)
P(x) · Q(x) = ?







Key Terms

Polynomial multiplication — the operation of multiplying two polynomials P(x)P(x) and Q(x)Q(x), producing a new polynomial whose degree is the sum of the degrees of PP and QQ.

Distributive property — the rule a(b+c)=ab+aca(b + c) = ab + ac, applied repeatedly to multiply each term of one polynomial by each term of the other.

FOIL — the mnemonic for multiplying two binomials: First, Outer, Inner, Last. A special case of distribution that produces exactly four pairwise products.

Grid method (box method) — a tabular visualization of polynomial multiplication. The terms of PP label the rows, the terms of QQ label the columns, and each cell holds the product of its row and column terms. Generalizes FOIL to any number of terms.

Like terms — terms that share the same power of xx. After distributing, like terms are grouped and their coefficients summed.

Degree of a product — equals the degree of PP plus the degree of QQ. A trinomial times a binomial yields a polynomial of degree (2 + 1) = 3, for example.

Getting Started

The tool opens with the polynomial pair (x23x+2)(2x+5)(x^2 - 3x + 2)(2x + 5) loaded by default. The layout is split into two cards side by side:

• A left card with preset buttons, two polynomial editors for P(x)P(x) and Q(x)Q(x), and animation controls.

• A right card showing the multiplication grid, the like-term buckets below it, and the final result box.

To explore:

• Click any preset to load a curated example.

• Edit the coefficients and exponents directly in the term rows.

• Add or remove terms with the + add term button and the small × per row.

• Press Step ▶ to fill one grid cell at a time, or Auto-expand to play through all cells continuously.

The status badge at the bottom of the left card tracks progress as k/Nk / N cells filled, where NN is the total number of pairwise products to compute.

Entering the Polynomials

Two polynomial editors sit in the left card, one for P(x)P(x) and one for Q(x)Q(x). Each editor has three parts:

• A live display at the top showing the polynomial in standard form, with terms sorted by descending exponent and signs handled correctly.

• A list of term rows, one per term. Each row has a coefficient input (any integer or decimal between −9999 and 9999), the literal xx, an exponent input (an integer between 0 and 12), and a remove button.

• An + add term button to append another term, up to a maximum of 6 terms per polynomial.

A few mechanics worth knowing:

• Editing any input updates the grid and result instantly. There is no apply button.

• The remove button is disabled when only one term remains — every polynomial must have at least one term.

• Total grid size is capped at 36 cells. A 6×6 product is the largest configuration; anything larger triggers a validation error.

• Coefficients of zero are dropped from the grid silently. All zeros in a polynomial produces a validation error.

Presets

Five preset products demonstrate different sizes and structures:

(x+2)(x+3)(x + 2)(x + 3)the canonical FOIL: binomial times binomial, a 2×22 \times 2 grid with four cells.

(2x1)(x+4)(2x - 1)(x + 4) — binomial times binomial with a negative coefficient, useful for seeing sign handling.

(x23x+2)(2x+5)(x^2 - 3x + 2)(2x + 5)trinomial times binomial, a 3×23 \times 2 grid with six cells. The default load.

(x+1)(x2x+1)(x + 1)(x^2 - x + 1) — binomial times trinomial, a 2×32 \times 3 grid. Note the famous result: this product equals x3+1x^3 + 1the sum of cubes.

(2x2+x3)(x22x+1)(2x^2 + x - 3)(x^2 - 2x + 1)trinomial times trinomial, a 3×33 \times 3 grid with nine cells. The most complex preset.

Click any preset to load it; the editors, grid, buckets, and result all refresh immediately.

The Canonical FOIL

(x+2)(x+3)(x + 2)(x + 3), frozen with all four cells delivered: a 2×22 \times 2 grid whose cells read x2x^2, 3x3x, 2x2x, 66, three like-term buckets, and the result x2+5x+6x^2 + 5x + 6.
(x + 2)(x + 3), all four cells deliveredx3x3x22x6LIKE-TERM BUCKETSx² terms 1sum: x²x terms 3 + 2sum: 5xconstants 6sum: 6P(x) · Q(x) = x² + 5x + 6
(x + 2)(x + 3), frozen at completion

FOIL as territory rather than tour: four cells, and the two middle ones merging in the amber bucket to 5x.

This is the product every algebra student meets first, and the grid explains the FOIL acronym better than the acronym does: First, Outer, Inner, Last are simply the four cells of a 2×22 \times 2 grid, visited in row-major order. The mnemonic is a tour route; the grid is the territory.

The frozen buckets show the one interesting event: the two middle cells 3x3x and 2x2x land in the same amber bucket and merge to 5x5x. Every like-term collection in every larger product is this event repeated — which is why the tool colors cells by exponent rather than by position.

Sign Handling

(2x1)(x+4)(2x - 1)(x + 4), frozen at completion: four cells again, but one row carries the negative term, and the bucket arithmetic must subtract — the xx bucket collects 81=78 - 1 = 7.
(2x − 1)(x + 4), all four cells deliveredx42x2x²8x−1−x−4LIKE-TERM BUCKETSx² terms 2sum: 2x²x terms 8 − 1sum: 7xconstants− 4sum: −4P(x) · Q(x) = 2x² + 7x − 4
(2x − 1)(x + 4), frozen at completion

Signs decided cell by cell: the bottom row carries the minuses, and the x bucket adds 8 − 1 = 7.

Negative coefficients are where hand multiplication usually goes wrong, and the grid localizes the danger: each cell's sign is decided once, at the cell, by the ordinary rule of signs (14=4-1 \cdot 4 = -4), and the buckets then merely add signed numbers. Two error-prone operations become two separate, simpler ones.

The frozen frame keeps the evidence visible: the bottom row's cells carry the minus signs of the 1-1 term, and the bucket contributions show +8+8 and 1-1 arriving as separate deliveries before summing to the final 7x7x. The result: 2x2+7x42x^2 + 7x - 4.

Trinomial Times Binomial

The default load: (x23x+2)(2x+5)(x^2 - 3x + 2)(2x + 5), frozen with all six cells delivered in a 3×23 \times 2 grid, four buckets, and the result 2x3x211x+102x^3 - x^2 - 11x + 10.
(x² − 3x + 2)(2x + 5), all six cells delivered2x52x³5x²−3x−6x²−15x24x10LIKE-TERM BUCKETSx³ terms 2sum: 2x³x² terms 5 − 6sum: −x²x terms− 15 + 4sum: −11xconstants 10sum: 10P(x) · Q(x) = 2x³ − x² − 11x + 10
(x² − 3x + 2)(2x + 5), frozen at completion

Six cells, four buckets, no acronym — the grid principle scaling where FOIL cannot.

Six cells is where FOIL-the-mnemonic dies — there is no acronym for 3×23 \times 2 — and the grid principle takes over undamaged: every term of the left meets every term of the right, once. The cell count is always the product of the term counts, so the bookkeeping scales multiplicatively while the rule stays constant.

The four buckets illustrate the other scaling law: the result's degree is the sum of the factors' degrees (2+1=32 + 1 = 3), and every exponent from 33 down to 00 is hit. Both middle buckets require genuine arithmetic (56=15 - 6 = -1 for x2x^2; 15+4=11-15 + 4 = -11 for xx) — collection is no longer optional the way it nearly is in the FOIL frame.

The Sum of Cubes

(x+1)(x2x+1)(x + 1)(x^2 - x + 1), frozen at completion — and the buckets steal the show: the x2x^2 bucket collects 1+1=0-1 + 1 = 0, the xx bucket collects 11=01 - 1 = 0, and the result collapses to x3+1x^3 + 1.
(x + 1)(x² − x + 1), all six cells delivered−x1x−x²x1−x1LIKE-TERM BUCKETSx³ terms 1sum: x³x² terms− 1 + 1sum: 0x terms 1 − 1sum: 0constants 1sum: 1P(x) · Q(x) = x³ + 1
(x + 1)(x² − x + 1), frozen at completion

Four of six cells annihilate: both middle buckets sum to zero, and x³ + 1 emerges — the sum-of-cubes identity, verified.

This preset freezes a factoring identity being verified in public: (x+1)(x2x+1)=x3+1(x+1)(x^2 - x + 1) = x^3 + 1, the sum-of-cubes pattern. Six cells are delivered, but four of them exist only to annihilate each other — the frozen buckets display the cancellation as visibly empty sums rather than as algebraic sleight of hand.

Cancellation is the phenomenon that makes special products special: the second factor is engineered so its cross-terms exactly oppose the first factor's contributions. Seen in the grid, the identity stops being a formula to memorize and becomes a pattern of paired cells — the same mechanism behind the difference of squares and the telescoping products of higher factoring identities.

Trinomial Times Trinomial

The heavyweight: (2x2+x3)(x22x+1)(2x^2 + x - 3)(x^2 - 2x + 1), frozen with all nine cells delivered, five buckets from x4x^4 down to the constants, and the result 2x43x33x2+7x32x^4 - 3x^3 - 3x^2 + 7x - 3.
(2x² + x − 3)(x² − 2x + 1), all nine cells delivered−2x12x²2x⁴−4x³2x²x−2x²x−3−3x²6x−3LIKE-TERM BUCKETSx⁴ terms 2sum: 2x⁴x³ terms− 4 + 1sum: −3x³x² terms 2 − 2 − 3sum: −3x²x terms 1 + 6sum: 7xconstants− 3sum: −3P(x) · Q(x) = 2x⁴ − 3x³ − 3x² + 7x − 3
(2x² + x − 3)(x² − 2x + 1), frozen at completion

Nine cells, five buckets, and equal exponents striping the anti-diagonals — convolution made visible.

Nine cells is roughly the practical limit of by-hand multiplication, and the frozen frame shows why the grid remains calm where vertical multiplication gets crowded: every product has a pre-assigned cell, every cell a pre-assigned bucket, and nothing depends on keeping running totals in your head. The x2x^2 bucket alone collects three contributions (223=32 - 2 - 3 = -3) — the kind of triple merge that produces most hand-calculation errors.

The five colors of the frozen grid also make a structural point: cells of equal exponent lie along the grid's anti-diagonals. That diagonal striping is not a coincidence of this preset — it is the convolution structure of polynomial multiplication, the same pattern that makes long multiplication of numbers carry along diagonals.

The Multiplication Grid

The right-card grid is the visual centerpiece. Each row corresponds to one term of P(x)P(x) (sorted by descending exponent); each column corresponds to one term of Q(x)Q(x) (also sorted). The cell at row ii, column jj holds the product of those two terms.

The fundamental rule: each cell's exponent equals the sum of its row exponent and its column exponent. So x2x=x3x^2 \cdot x = x^3, xx=x2x \cdot x = x^2, x1=xx \cdot 1 = x, and so on. Cells with the same total exponent share a color, drawn from a palette that distinguishes constants, xx, x2x^2, x3x^3, and higher powers at a glance.

Cells fill in left-to-right, top-to-bottom as the animation runs. Three visual states:

Empty cells — outlined in light gray, showing the product symbolically without color.

Hot cell — the cell just delivered. Briefly scaled up with a blue glow ring for about 360 ms.

Collected cells — fully colored according to their exponent. Cells with the same color belong to the same like-term bucket below.

The Like-Term Buckets

Below the grid sits a row of buckets, one per distinct exponent that appears in any product. Each bucket collects all the cells that produce the same power of xx.

A bucket displays three things:

• A header naming the like-term group: constants, x terms, *x² terms*, *x³ terms*, and so on, with the exponent value shown on the right.

• A contributions row listing the signed coefficients delivered to this bucket so far, in the order they arrived (for example, *− 6 + 2*).

• A sum line showing the running total: the combined coefficient times the appropriate power of xx.

Each time a cell delivers, the matching bucket briefly highlights to show where the contribution went. By the time all cells fill, each bucket holds the final coefficient for that power of xx. Reading the buckets from highest exponent to lowest reconstructs the product polynomial term by term.

Animation Controls

Three buttons drive the animation at the bottom of the left card:

Step ▶ — deliver one grid cell. Useful for walking through the multiplication slowly and reading off each product as it lands.

Auto-expand / ⏸ Pause / Replay — the primary play button. Starts continuous play at about 480 ms per cell; pauses if already playing; restarts from the beginning if all cells are already delivered.

↺ Reset — clear the grid and buckets, return to step 0, without changing the polynomials.

Two pieces of feedback help track progress:

• The status text on the right of the control bar reads k/Nk / N cells, where NN is the total cell count for the current grid.

• If the polynomials are invalid (no non-zero terms, too many terms, grid too big), a red error message replaces the status and the action buttons disable.

Any edit to the polynomials, or selecting a different preset, automatically stops play and resets the animation.

The Final Result

Below the buckets, a blue gradient Result box shows the final product P(x)Q(x)P(x) \cdot Q(x) as a fully simplified polynomial. The box is faded with the label *Result (pending)* while cells are still being delivered, and activates at full opacity once every cell is filled.

The polynomial in the box comes from combining the bucket sums:

• Read each bucket's sum (its coefficient).

• Pair each coefficient with its bucket's power of xx.

• Sort by descending exponent and write out with signs.

The result is the canonical form of the product. For a quick check on small examples like the default (x23x+2)(2x+5)=2x3x211x+10(x^2 - 3x + 2)(2x + 5) = 2x^3 - x^2 - 11x + 10, you can verify by FOIL-style hand calculation. For larger products like the 3×3 trinomial-times-trinomial case, the tool does the bookkeeping so you can focus on the structure.

What Is Polynomial Multiplication

Polynomial multiplication is the operation that takes two polynomials P(x)P(x) and Q(x)Q(x) and returns their product P(x)Q(x)P(x) \cdot Q(x), another polynomial. The recipe comes directly from the distributive property: multiply every term of PP by every term of QQ, then collect like terms.

If PP has mm terms and QQ has nn terms, distribution produces mnm \cdot n individual products. Some of those products land on the same power of xx, so the final result usually has fewer than mnm \cdot n terms after collection. The degree of the product equals the degree of PP plus the degree of QQ.

The most common manual technique for two binomials is FOIL (First, Outer, Inner, Last) — but FOIL is just a labelled walkthrough of the four products in a 2×22 \times 2 distribution. The grid method generalizes this to any size: an m×nm \times n rectangular table where each cell holds one pairwise product.

For more on polynomial operations, see the polynomial multiplication section in the algebra theory pages.

FOIL Generalized

FOIL stands for First, Outer, Inner, Last and labels the four products that appear when multiplying two binomials (a+b)(c+d)(a + b)(c + d):

First: aca \cdot c

Outer: ada \cdot d

Inner: bcb \cdot c

Last: bdb \cdot d

The product is ac+ad+bc+bdac + ad + bc + bd. The grid method makes the structure visible: a 2×22 \times 2 table with a,ba, b down the side and c,dc, d across the top. Each of the four cells contains one of the four FOIL products.

The grid generalizes effortlessly to longer polynomials. A trinomial times a binomial fills a 3×23 \times 2 grid with six products. A trinomial times a trinomial fills a 3×33 \times 3 grid with nine. The same rule applies in every cell: multiply the coefficients, add the exponents.

After the grid fills, the like-term collection step groups cells whose exponents match and sums their coefficients. This is where the product polynomial usually simplifies — a 3×3=93 \times 3 = 9-cell product typically collapses to 55 terms (degrees 00 through 44) once like terms combine.