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.

What is the generic rectangle method for multiplying polynomials?

The generic rectangle (or box method) is a visual algorithm for polynomial multiplication. You draw a grid where the terms of one polynomial label the rows and the terms of the other label the columns. Each cell is filled with the product of its row and column labels. Finally, you collect like terms from all cells to produce the expanded polynomial. It organises the distributive property so no partial product is missed.

How does the generic rectangle differ from FOIL?

FOIL stands for First, Outer, Inner, Last and works only for two binomials. The generic rectangle works for any polynomial sizes: binomial times binomial, trinomial times binomial, or even larger expressions. FOIL is a memory shortcut for a single special case; the box method is the general version that scales to any degree.

What are partial products in the generic rectangle?

Each cell in the grid is one partial product: the monomial from the row header multiplied by the monomial from the column header. For (2x + 3)(x - 4), the four partial products are 2x times x equals 2x2, 2x times -4 equals -8x, 3 times x equals 3x, and 3 times -4 equals -12. Adding all four gives 2x2 - 5x - 12.

How do I handle negative coefficients in the box method?

Negative coefficients flow through naturally. Enter the negative value directly. For example, if the second binomial is (x - 4), enter d = -4. Every cell product involving -4 will be negative automatically. The final polynomial will have the correct signs after you sum each power's cells.

What does the x coefficient equal in a binomial times binomial product?

For (ax + b)(cx + d), the x coefficient equals ad + bc. This is the sum of the two middle partial products: the top-right cell (a times d) and the bottom-left cell (b times c). The x2 coefficient is ac and the constant is bd. These three formulas come directly from the generic rectangle grid.

Can the generic rectangle handle trinomials?

Yes. For (ax2 + bx + c)(dx + e), draw a 3-row by 2-column grid. The rows are labeled ax2, bx, and c; the columns are dx and e. Fill each of the six cells, then collect terms of the same power. The result is a cubic polynomial adx3 + (ae + bd)x2 + (be + cd)x + ce.

Why does the box method help students avoid errors?

The box method forces every term in the first polynomial to be multiplied by every term in the second. With FOIL or informal distribution, it is easy to miss the inner or outer products when one expression has three or more terms. The visual grid acts as a checklist: if a cell is filled, the product was computed.

How do I expand (x + 2)(x + 3) using the generic rectangle?

Draw a 2x2 grid. Label the rows x and 2, the columns x and 3. Top-left: x times x equals x2. Top-right: x times 3 equals 3x. Bottom-left: 2 times x equals 2x. Bottom-right: 2 times 3 equals 6. Collect like terms: x2 + 3x + 2x + 6 equals x2 + 5x + 6.

What is the difference between a perfect square trinomial and a general trinomial in box method?

A perfect square trinomial (ax + b)2 expands so the two off-diagonal cells are equal (both equal ab times x). The expanded form is a2x2 + 2abx + b2. A general (ax + b)(cx + d) has two different middle terms ad times x and bc times x that may or may not be equal. The box method works the same way for both.

Can the generic rectangle method be used in reverse for factoring?

Yes, factoring by the box method is the reverse process. You fill the corner cells (x2 term and constant), find two middle-row values whose product equals the corner product and whose sum equals the middle coefficient, then read off the row and column labels as the factor pair. This is the same as factoring by grouping but laid out visually.

What is the FOIL method and when should I use it instead?

FOIL (First, Outer, Inner, Last) multiplies two binomials: the first terms, the outer terms, the inner terms, and the last terms, then sums all four. Use FOIL when both expressions are single binomials and you want a quick mental calculation. Use the generic rectangle when either expression has three or more terms, when you need a visual record of each partial product, or when teaching the concept to students.