Generic Rectangle Calculator

Multiply two polynomials step by step using the visual box method. See every partial product in a grid.

๐Ÿ“ Generic Rectangle Calculator

Multiply polynomials using the visual box method. Choose a mode below.

Multiply (ax + b)(cx + d)

Multiply (ax² + bx + c)(dx + e)

Expanded Form
Factored Input
x² coefficient
x coefficient
Constant term
Rectangle Grid

๐Ÿ“ What is the Generic Rectangle Method?

The generic rectangle method, also called the box method, is a visual technique for multiplying polynomials. Instead of applying the distributive property term by term in a single line, you draw a grid where one polynomial labels the rows and the other labels the columns. Every cell is then filled with the product of its row header and column header. The final expanded polynomial is found by collecting all cells that share the same power of x.

The method has direct classroom use. Middle school and high school students use it when multiplying two binomials, such as (2x + 3)(x - 4), and when multiplying a trinomial like (xยฒ + 3x + 2) by a binomial like (2x - 1). College algebra courses use it to factor quadratics by reversing the process. The generic rectangle is also used in lattice multiplication for integers and in partial-fraction decomposition in calculus, where understanding how polynomials combine helps students reverse-engineer complex rational expressions.

A common point of confusion is the difference between the generic rectangle and FOIL. FOIL is a memory device for multiplying exactly two binomials: First, Outer, Inner, Last. It lists four products and works only for that one case. The generic rectangle generalises the same idea to any polynomial sizes. When both expressions are binomials, the four cells of a 2x2 grid correspond exactly to the four FOIL terms. When one expression is a trinomial, the grid becomes 3x2 with six cells, which FOIL cannot handle. Using the generic rectangle makes the distributive property visible and eliminates the risk of missing a partial product.

This calculator builds the rectangle grid instantly from the coefficients you enter. It supports two modes: Binomial times Binomial for quadratic results, and Trinomial times Binomial for cubic results. In each mode the table shows every partial product explicitly, the expanded polynomial appears below the grid, and the individual term coefficients are listed in separate result boxes so you can check each one against your own working.

๐Ÿ“ Formula

(ax + b)(cx + d)  =  acx² + (ad + bc)x + bd
a, b = coefficients of the first binomial (ax + b)
c, d = coefficients of the second binomial (cx + d)
acx² = top-left cell of the 2×2 grid
adx = top-right cell; bcx = bottom-left cell; sum = middle coefficient
bd = bottom-right cell = constant term
Trinomial: (ax² + bx + c)(dx + e) = adx³ + (ae+bd)x² + (be+cd)x + ce
Example: (2x + 3)(x − 4): ac = 2, ad+bc = −8+3 = −5, bd = −12 → 2x² − 5x − 12

๐Ÿ“– How to Use This Calculator

Steps

1
Choose a multiplication mode: select Binomial × Binomial for two-term expressions, or Trinomial × Binomial when the first polynomial has three terms.
2
Enter the coefficients: type each coefficient into its labelled field. Use negative numbers where needed, for example enter −4 if the constant is minus four.
3
Click Multiply: the calculator fills the rectangle grid with partial products and displays the expanded polynomial below.
4
Read the grid and result: each cell shows one partial product. Like-term cells (same power of x) are summed to form each coefficient of the answer.
5
Verify with Try this example: click any Try this example link to pre-fill the inputs with a known problem and confirm the output matches your manual calculation.

๐Ÿ’ก Example Calculations

Example 1: (2x + 3)(x − 4)

Standard binomial multiplication with one negative constant

1
Set up a 2×2 grid. Rows: 2x, 3. Columns: x, −4.
2
Top-left: 2x × x = 2x². Top-right: 2x × (−4) = −8x.
3
Bottom-left: 3 × x = 3x. Bottom-right: 3 × (−4) = −12.
4
Collect x terms: −8x + 3x = −5x. Constant: −12.
Result: 2x² − 5x − 12
Try this example →

Example 2: (x + 5)(x + 5) — perfect square

Squaring a binomial: both off-diagonal cells are equal

1
Grid rows: x, 5. Columns: x, 5. Top-left: x². Bottom-right: 25.
2
Top-right: x × 5 = 5x. Bottom-left: 5 × x = 5x.
3
Collect x terms: 5x + 5x = 10x.
Result: x² + 10x + 25. Both middle cells are equal because it is (x + 5)².
Try this example →

Example 3: (3x − 2)(2x + 1)

Both leading coefficients non-one, one negative constant

1
Grid rows: 3x, −2. Columns: 2x, 1.
2
Top-left: 6x². Top-right: 3x. Bottom-left: −4x. Bottom-right: −2.
3
Collect x: 3x + (−4x) = −x.
Result: 6x² − x − 2
Try this example →

Example 4: (x² + 3x + 2)(2x − 1) — trinomial mode

3×2 grid producing a cubic polynomial

1
Switch to Trinomial × Binomial mode. Rows: x², 3x, 2. Columns: 2x, −1.
2
Row 1: 2x³, −x². Row 2: 6x², −3x. Row 3: 4x, −2.
3
Collect x²: −x² + 6x² = 5x². Collect x: −3x + 4x = x.
Result: 2x³ + 5x² + x − 2
Try this example →

โ“ Frequently Asked Questions

What is the generic rectangle method for polynomial multiplication?+
The generic rectangle (box method) is a visual algorithm for multiplying polynomials. You draw a rectangular grid, label the rows with terms of one polynomial and the columns with terms of the other, fill every cell with the product of its row and column labels, then collect all cells with the same power of x. The method organises the distributive property so that no partial product is ever skipped.
How is the generic rectangle different from FOIL?+
FOIL (First, Outer, Inner, Last) is a memory shortcut that works only for exactly two binomials, producing four products. The generic rectangle generalises to any polynomial sizes. For two binomials the four cells of the 2x2 grid match the four FOIL terms exactly. For a trinomial times a binomial you need a 3x2 grid with six cells, which FOIL cannot handle. The box method is the universal version.
How do I set up the grid for (ax + b)(cx + d)?+
Draw a 2x2 rectangle. Write ax on the left of row 1 and b on the left of row 2. Write cx above column 1 and d above column 2. Fill the top-left cell with ax times cx equals acx2, the top-right with ax times d equals adx, the bottom-left with b times cx equals bcx, and the bottom-right with b times d equals bd. Sum the two x-cells to get the middle coefficient ad plus bc.
What does the diagonal pattern in the grid mean?+
In a generic rectangle, terms on the same anti-diagonal always share the same total degree. For a 2x2 grid, the top-left has degree 2, the two off-diagonal cells each have degree 1, and the bottom-right has degree 0. Like terms are always found on the same anti-diagonal. This pattern extends to larger grids: in a 3x2 grid for trinomial times binomial, the x2 cells form a diagonal line running from top-right to centre-left.
How do negative coefficients work in the box method?+
Negative coefficients work exactly like positive ones. Enter the negative value in the coefficient field. The cell product will be negative if exactly one factor is negative and positive if both factors are negative (negative times negative equals positive). After filling all cells, collect like terms with their correct signs. There is no special rule for negatives in the box method; standard multiplication rules apply to every cell.
Can I use the generic rectangle to factor a quadratic?+
Yes. Place the x2 term in the top-left cell and the constant in the bottom-right. Find two integers whose product equals the top-left value times the bottom-right value and whose sum equals the middle (x) coefficient. Put these two integers in the off-diagonal cells as x-terms. Then read off the row and column labels. This reverse process produces the factored form and is equivalent to factoring by grouping but laid out visually.
What is a perfect square trinomial in the box method?+
A perfect square trinomial is the result of squaring a binomial: (ax + b)2. In the generic rectangle, both off-diagonal cells equal ab times x, so they are identical. The expanded form is a2x2 plus 2abx plus b2. You can recognise a perfect square from the grid when the two middle cells are equal. For example, (x + 5)2 gives grid cells x2, 5x, 5x, 25, which sums to x2 plus 10x plus 25.
Why do I add the two middle cells in a binomial multiplication?+
Both middle cells produce x-terms (degree 1). The top-right cell gives adx and the bottom-left cell gives bcx. Since they are like terms (same variable and power), they combine: adx plus bcx equals (ad plus bc)x. The final coefficient of x in the expanded polynomial is therefore ad plus bc. This is why the x coefficient in (ax + b)(cx + d) equals the sum of the cross products.
How do I expand a trinomial times a binomial using the box method?+
Draw a 3x2 grid. Label the three rows with the trinomial terms (ax2, bx, c) and the two columns with the binomial terms (dx, e). Fill all six cells: row 1 gives adx3 and aex2; row 2 gives bdx2 and bex; row 3 gives cdx and ce. Collect like terms: the x3 coefficient is ad, the x2 coefficient is ae plus bd, the x coefficient is be plus cd, and the constant is ce. The result is a cubic polynomial.
Is the generic rectangle the same as the area model?+
Yes, the terms are interchangeable. The area model name comes from the geometric interpretation: each cell represents the area of a sub-rectangle whose dimensions are the row label and column label. The total area of the large rectangle equals the sum of all the small areas, which is exactly the expanded polynomial. Both names describe the same grid-based multiplication method.
When should I use the generic rectangle instead of direct distribution?+
Use the generic rectangle when you are learning polynomial multiplication and want a visual record of every partial product. Direct distribution (writing each product as you go along a line) is faster once you are experienced, but easy to lose track of terms when the polynomials have three or more terms each. The grid format is especially helpful for trinomial times trinomial, where nine partial products must all be accounted for before any collection of like terms.