Skip to content

FOIL Calculator: Multiply Binomials Step by Step

Expand (ax + b)(cx + d) with the FOIL method, step by step, plus trinomial × binomial with the box method.

Your details

Product

Any single letter: x, y, a, t… Coefficients accept integers, decimals and fractions such as 2/3.

Results update as you type

Product

6x² + 7x − 20

Before combining like terms
6x² + 15x − 8x − 20
First (F)
6x²
Outer (O)
15x
Inner (I)
−8x
Last (L)
−20
Middle term (O + I)
7x

Step-by-step solution
  1. (3x − 4)(2x + 5)
  2. First: (3x)(2x) = 6x²
  3. Outer: (3x)(5) = 15x
  4. Inner: (−4)(2x) = −8x
  5. Last: (−4)(5) = −20
  6. Combine like terms: 6x² + 15x − 8x − 20 = 6x² + 7x − 20

Box method: each cell is a row term times a column term

Multiplying two binomials such as (3x−4)(2x+5)(3x - 4)(2x + 5) is one of the first skills in algebra, and the FOIL method is the classic way to remember it. FOIL stands for First, Outer, Inner, Last: the four products you get when every term of the first bracket meets every term of the second. This FOIL calculator writes out each of those four products, shows the expression before like terms are combined, and gives the final simplified polynomial.

It works with any coefficients — negative numbers, decimals and fractions such as 23\tfrac{2}{3} are kept exact, never rounded — and with any variable letter, so (2y+1)(y−7)(2y + 1)(y - 7) or (5t−3)(t+2)(5t - 3)(t + 2) are just as easy. Switch to the second mode to multiply a trinomial by a binomial, (px2+qx+r)(cx+d)(px^2 + qx + r)(cx + d): FOIL no longer applies directly, so the calculator uses the distributive property and lays the six partial products out in a box method grid.

Use it to check homework, to see where a sign went wrong, or to prepare for the reverse operation, factoring, which the factoring trinomials calculator handles.

How to use this calculator

  1. Choose the product: two binomials, or a trinomial times a binomial.
  2. Type the coefficients. For (3x−4)(2x+5)(3x - 4)(2x + 5) enter a=3a = 3, b=−4b = -4, c=2c = 2, d=5d = 5. A missing term has coefficient 0; (x+6)(x + 6) means a=1a = 1.
  3. Change the variable letter if your problem uses yy, tt or another letter.
  4. Read the product at the top. The F, O, I and L terms appear below it, with the middle term O+IO + I that a quick mental FOIL needs.
  5. Open the steps and the box table to copy the full working.

The formula

For two binomials the distributive property, applied twice, gives four products:

(ax+b)(cx+d)=acx2⏟First+adx⏟Outer+bcx⏟Inner+bd⏟Last=acx2+(ad+bc)x+bd(ax + b)(cx + d) = \underbrace{acx^2}_{\text{First}} + \underbrace{adx}_{\text{Outer}} + \underbrace{bcx}_{\text{Inner}} + \underbrace{bd}_{\text{Last}} = acx^2 + (ad + bc)x + bd

The Outer and Inner products are both first-degree terms, so they always combine into the single middle term (ad+bc)x(ad + bc)x.

For a trinomial times a binomial, every one of the three terms multiplies both terms of the binomial — six products:

(px2+qx+r)(cx+d)=pcx3+(pd+qc)x2+(qd+rc)x+rd(px^2 + qx + r)(cx + d) = pcx^3 + (pd + qc)x^2 + (qd + rc)x + rd

The box method is the same calculation drawn as a grid: one factor's terms label the rows, the other's label the columns, and each cell holds their product.

Worked example

FOIL. Expand (3x−4)(2x+5)(3x - 4)(2x + 5):

  • First: 3x⋅2x=6x23x \cdot 2x = 6x^2
  • Outer: 3x⋅5=15x3x \cdot 5 = 15x
  • Inner: −4⋅2x=−8x-4 \cdot 2x = -8x
  • Last: −4⋅5=−20-4 \cdot 5 = -20
6x2+15x−8x−20=6x2+7x−206x^2 + 15x - 8x - 20 = 6x^2 + 7x - 20

Trinomial × binomial. (x2+2x−3)(x+4)(x^2 + 2x - 3)(x + 4) gives the six products x3+4x2+2x2+8x−3x−12x^3 + 4x^2 + 2x^2 + 8x - 3x - 12, which simplify to x3+6x2+5x−12x^3 + 6x^2 + 5x - 12.

With a fraction. (12x+3)(4x−2)=2x2+11x−6(\tfrac{1}{2}x + 3)(4x - 2) = 2x^2 + 11x - 6.

Special products worth recognising

Two patterns appear so often that it pays to know them by heart, because the FOIL middle term either doubles or vanishes:

Pattern Result Example
Square of a sum (a+b)2=a2+2ab+b2(a + b)^2 = a^2 + 2ab + b^2 (x+5)2=x2+10x+25(x + 5)^2 = x^2 + 10x + 25
Difference of squares (a+b)(a−b)=a2−b2(a + b)(a - b) = a^2 - b^2 (2x+3)(2x−3)=4x2−9(2x + 3)(2x - 3) = 4x^2 - 9

In the difference of squares the Outer and Inner terms are opposites and cancel, which is why there is no middle term. A frequent mistake is writing (x+5)2=x2+25(x + 5)^2 = x^2 + 25: FOIL shows the missing 10x10x at once.

FOIL, distribution and the box method

FOIL is a memory aid, not a separate rule: it is the distributive property used twice. That is why it only names four products and only works for two binomials. For longer factors, multiply each term of the first factor by each term of the second and add — the box method keeps that bookkeeping tidy and makes it hard to forget a product. For products of any size, the polynomial calculator multiplies whole polynomials.

Frequently asked questions

What does FOIL stand for?

First, Outer, Inner, Last. In (a + b)(c + d) you multiply the first terms (a·c), the outer terms (a·d), the inner terms (b·c) and the last terms (b·d), then add the four products.

Does the order of FOIL matter?

No. Multiplication and addition are commutative, so any order gives the same answer as long as all four products are included. FOIL is simply an order that makes it hard to miss one.

Can I use FOIL for a trinomial?

Not directly: FOIL only covers 2 × 2 = 4 products. A trinomial times a binomial has 6 products. Use the second mode, which distributes each term and shows the box method grid.

How do I FOIL with fractions or negative numbers?

Type them as they are: −4, 0.5 or 2/3. Keep the sign with each term — in (3x − 4)(2x + 5) the inner product is (−4)(2x) = −8x. The calculator works with exact fractions, so 1/3 never turns into 0.333.

Can I use a variable other than x?

Yes. Enter any single letter in the variable field, for example y or t. The result and every step are written with that letter.

Sources

Last updated:

More Math calculators

People also use