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.
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)$ — the canonical FOIL: binomial times binomial, a 2×22 \times 2 grid with four cells.

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

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

$(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 + 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 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.

Related Concepts

Distributive property — the algebraic law a(b+c)=ab+aca(b + c) = ab + ac. Polynomial multiplication is repeated distribution.

Polynomial addition and subtraction — combine like terms across two polynomials. The companion operations to multiplication.

Polynomial division — long division or synthetic division. The inverse operation of multiplication.

Binomial theorem — gives the expansion of (a+b)n(a + b)^n directly using binomial coefficients. A shortcut when one of the polynomials is a power.

Completing the square — uses controlled polynomial manipulation to rewrite a quadratic in vertex form.

Special products — recognizable patterns like (a+b)2=a2+2ab+b2(a + b)^2 = a^2 + 2ab + b^2, (ab)2=a22ab+b2(a - b)^2 = a^2 - 2ab + b^2, and (a+b)(ab)=a2b2(a + b)(a - b) = a^2 - b^2. Worth memorizing because they appear constantly.

Algebra calculator — for symbolic manipulation beyond what fits in a 36-cell grid, see the dedicated polynomial multiplication calculator in the algebra calculators section.