Math

FOIL Calculator

Multiply two binomials with the FOIL method and see the first, outer, inner and last terms and the expanded answer.

FreePrivateFormula explained

Your result

Did our calculator solve your problem?

Multiplying two brackets like (2x + 3)(x − 4) is one of those algebra skills that feels fiddly until it clicks, and then you wonder why it was ever hard.

FOIL is the memory trick that makes it click. This FOIL calculator takes the four numbers from your two binomials, multiplies them out and shows each of the four products, so you can see exactly where the answer comes from and check your own working.

How to use the FOIL Calculator#

  1. Enter the first bracket. Put the number in front of x as a, and the plain number as b. In (2x + 3), a is 2 and b is 3.
  2. Enter the second bracket. Do the same with c and d. In (x − 4), c is 1 and d is −4.
  3. Read the result. You get the expanded form and the four FOIL products.

What FOIL stands for#

FOIL is a way to remember the four multiplications you need when you expand (ax + b)(cx + d). Every term in the first bracket has to be multiplied by every term in the second bracket.

  • F is for First: multiply the first terms, a x and c x, to get ac x².
  • O is for Outer: multiply the outer terms, a x and d, to get ad x.
  • I is for Inner: multiply the inner terms, b and c x, to get bc x.
  • L is for Last: multiply the last terms, b and d, to get bd.
(ax + b)(cx + d) = ac x² + (ad + bc) x + bd

A worked example#

Take (2x + 3)(x − 4). Here a is 2, b is 3, c is 1 and d is −4.

  • First: 2x × x = 2x²
  • Outer: 2x × (−4) = −8x
  • Inner: 3 × x = 3x
  • Last: 3 × (−4) = −12

Add them up and combine the two x terms, −8x and 3x, into −5x. The answer is 2x² − 5x − 12.

Special products worth knowing#

A few patterns come up so often that it’s worth recognising them:

PatternExpands toExample
(a + b)²a² + 2ab + b²(x + 5)² = x² + 10x + 25
(a − b)²a² − 2ab + b²(2x − 1)² = 4x² − 4x + 1
(a + b)(a − b)a² − b²(x − 3)(x + 3) = x² − 9

In the last one, the outer and inner terms cancel, which is why it’s called the difference of two squares.

Mistakes to watch for#

  • Sign errors. A negative number in a bracket turns a product negative. Write the signs down before you multiply.
  • Forgetting to combine. The outer and inner terms both contain x, so they join into one term.
  • Squaring wrongly. (x + 5)² isn’t x² + 25. You still have to do all four products, and the middle term is 10x.
  • Using FOIL on longer brackets. FOIL is only for two binomials. For anything bigger, multiply every term in one bracket by every term in the other.

Going the other way#

Factoring is expanding in reverse. If you’re given x² − 5x − 6 and asked to factor it, you hunt for two numbers that multiply to −6 and add to −5, which are −6 and 1, giving (x − 6)(x + 1). Expanding it with FOIL is a good way to check you got it right.

A check that always works#

For (2x + 3)(x − 4), the four products are F = 2x · x = 2x², O = 2x · (−4) = −8x, I = 3 · x = 3x and L = 3 · (−4) = −12. Adding the outer and inner terms gives −5x, so the result is 2x² − 5x − 12. To check, put x = 1 in both forms: (2 + 3)(1 − 4) = −15 and 2 − 5 − 12 = −15. If the two match for a couple of values, the expansion is almost certainly right. Substituting is faster than expanding again.

Special cases#

  • Perfect square: (x + 3)² = x² + 6x + 9. The middle term is not missing, which is the most common mistake.
  • Difference of squares: (x + 5)(x − 5) = x² − 25, because the middle terms cancel.
  • Constant pairs: (x + 2)(x + 7) = x² + 9x + 14, where 9 = 2 + 7 and 14 = 2 × 7.

Going the other way is called factoring. For x² + 9x + 14, look for two numbers that multiply to 14 and add to 9. They are 2 and 7. When the leading coefficient is not 1, the same pairing is done with the product a × c.

Frequently asked questions#

First, Outer, Inner, Last. It’s the order in which you multiply the terms of two binomials.

First gives x², outer gives 3x, inner gives 2x and last gives 6. Combine to get x² + 5x + 6.

Yes. Just keep track of the signs. For (x − 4)(x + 1) you get x² + x − 4x − 4, which is x² − 3x − 4.

No. FOIL is only for two binomials. For longer expressions, multiply each term of one by each term of the other.

It’s the pattern (a + b)(a − b) = a² − b². The middle terms cancel out.

More calculators