FOIL Calculator: Multiply Binomials Step by Step
By FindMySum · Last reviewed
A FOIL calculator expands a product of two binomials and shows the four products that make it up, then combines the like terms. FOIL stands for First, Outer, Inner, Last, a memory aid for the distributive property when both factors have two terms. This calculator also multiplies longer polynomials term by term, handles two variables such as (2x + 3y)(x − y), squares and cubes a binomial, and names the special products (perfect square, difference of squares, binomial cube) when it sees them. The worked example uses the default: (2x + 3)(x − 4).
FOIL step by step
Multiply each term of the first binomial by each term of the second, in this order:
- First: the first terms, 2x × x = 2x²
- Outer: the outside terms, 2x × (−4) = −8x
- Inner: the inside terms, 3 × x = 3x
- Last: the last terms, 3 × (−4) = −12
Add the four products: 2x² − 8x + 3x − 12. The outer and inner products are like terms, so combine them: −8x + 3x = −5x. The answer is 2x² − 5x − 12.
The order doesn't change the answer. FOIL just makes sure none of the four products is missed. The calculator lists them in a table, labelled, with the like terms combined in a second table.
Why FOIL works
FOIL is the distributive property used twice. (2x + 3)(x − 4) means 2x(x − 4) + 3(x − 4). Distributing each part gives 2x² − 8x and 3x − 12, the same four products. Thinking of it this way makes it clear what to do with a trinomial or anything longer: multiply every term of the first factor by every term of the second. For (x² + 2x − 1)(x + 3) that is 3 × 2 = 6 products:
| × | x | +3 |
|---|---|---|
| x² | x³ | 3x² |
| 2x | 2x² | 6x |
| −1 | −x | −3 |
Adding the boxes and combining like terms gives x³ + 5x² + 5x − 3. This grid is the box or area model; for two binomials its four boxes are exactly First, Outer, Inner and Last.
Special products worth recognising
Three patterns come up so often that it pays to know them by sight:
Perfect square: (a + b)² = a² + 2ab + b², and (a − b)² = a² − 2ab + b². For (3x − 5)², a = 3x and b = 5: 9x² − 30x + 25. The middle term, twice the product, is the one people forget; (3x − 5)² is not 9x² + 25.
Difference of squares (conjugates): (a + b)(a − b) = a² − b². In (5m − 9)(5m + 9) the outer product is 5m × 9 = 45m and the inner product is −9 × 5m = −45m, so they cancel, leaving 25m² − 81. Recognising the pattern lets you skip straight to the answer, and reading it backwards is how you factor x² − 49 = (x + 7)(x − 7).
Binomial cube: (a + b)³ = a³ + 3a²b + 3ab² + b³. For (x + 2)³: x³ + 3(x²)(2) + 3(x)(4) + 8 = x³ + 6x² + 12x + 8. The calculator also shows the route through the square: (x + 2)² = x² + 4x + 4, then (x² + 4x + 4)(x + 2).
Two variables, fractions and decimals
Any letter can be a variable. (2x + 3y)(x − y) gives First 2x², Outer −2xy, Inner 3xy and Last −3y²; the xy terms combine to xy, so the answer is 2x² + xy − 3y².
Fractions and decimals work too, and are kept exact. (x/2 + 1/3)(x − 1/3) = x²/2 − x/6 + x/3 − 1/9 = (1/2)x² + (1/6)x − 1/9. When you type decimals, the answer is shown in decimals: (0.5x + 1.5)(2x − 4) = x² + x − 6.
Checking an expansion
Two quick checks catch most mistakes:
- Substitute a number. Put x = 1 into both sides: (2 + 3)(1 − 4) = −15, and 2 − 5 − 12 = −15. If the two differ, something is wrong. Try a second value such as x = 2 to be sure.
- Count the terms. Two binomials give four products before combining; a trinomial times a binomial gives six. If you have fewer, a product is missing.
Expanding is also the way to check a factoring answer: if you factor 2x² − 5x − 12 as (2x + 3)(x − 4), FOIL should take you straight back.
More questions
Is FOIL still taught in schools?
Many teachers now teach the distributive property or the box (area) method first, because FOIL only works for two binomials and students who learn it as a rule can get stuck on trinomials. FOIL remains a useful check that you have all four products, and it appears in most algebra textbooks.
What is the box method for multiplying polynomials?
Draw a grid with one row for each term of one factor and one column for each term of the other. Write each product in its box, then add the boxes, combining like terms. For two binomials the four boxes are exactly the First, Outer, Inner and Last products.
What are like terms?
Terms with the same variables raised to the same powers, such as −8x and 3x, or 2xy and −5xy. Only their coefficients are added: −8x + 3x = −5x. x² and x are not like terms, so 2x² − 5x cannot be simplified further.
Why do signs cause so many mistakes in FOIL?
Each term carries its sign. In (2x + 3)(x − 4) the second term of the second factor is −4, so the outer product is 2x × (−4) = −8x, not +8x. Writing each factor with its signs attached, as + 3 and − 4, before multiplying avoids most sign errors.
Where is multiplying binomials used outside math class?
Area problems are the classic case: a garden x metres long and x − 2 metres wide, with a 1 m path around it, has an outside area of (x + 2)(x) = x² + 2x. The same expansions appear in physics formulas, compound interest over two periods and probability.
Sources
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.