FOIL Calculator

Multiply two binomials (ax + b)(cx + d) with the FOIL method. See First, Outer, Inner, Last products, combined like terms, and the expanded polynomial.

Loading calculator…

The FOIL method

FOIL is a memory aid for multiplying two binomials — expressions with exactly two terms, like (ax+b)(ax+b) and (cx+d)(cx+d). The letters stand for the four pairs of terms to multiply, in order:

LetterTerms multipliedProduces
Firstaxcxax \cdot cxthe x2x^2 term
Outeraxdax \cdot done xx term
Innerbcxb \cdot cxanother xx term
Lastbdb \cdot dthe constant term

Adding all four products together expands the product of two binomials into a trinomial:

(ax+b)(cx+d)=acx2+(ad+bc)x+bd(ax+b)(cx+d) = ac\,x^2 + (ad+bc)\,x + bd

The Outer and Inner products are both multiples of xx, so they combine into the single middle term (ad+bc)x(ad+bc)x.

Tip: FOIL only tells you the order to multiply in — the actual arithmetic is just the distributive property, applied twice.

Worked example

Multiply (3x+2)(4x+1)(3x+2)(4x+1), so a=3a=3, b=2b=2, c=4c=4, d=1d=1.

  1. First: 3x4x=12x23x \cdot 4x = 12x^2.
  2. Outer: 3x1=3x3x \cdot 1 = 3x.
  3. Inner: 24x=8x2 \cdot 4x = 8x.
  4. Last: 21=22 \cdot 1 = 2.
  5. Combine like terms: 3x+8x=11x3x + 8x = 11x.
  6. Result: 12x2+11x+212x^2 + 11x + 2.

Worked example with a negative coefficient

Multiply (3x2)(4x+1)(3x-2)(4x+1), so a=3a=3, b=2b=-2, c=4c=4, d=1d=1.

  1. First: 3x4x=12x23x \cdot 4x = 12x^2.
  2. Outer: 3x1=3x3x \cdot 1 = 3x.
  3. Inner: 24x=8x-2 \cdot 4x = -8x.
  4. Last: 21=2-2 \cdot 1 = -2.
  5. Combine like terms: 3x+(8x)=5x3x + (-8x) = -5x.
  6. Result: 12x25x212x^2 - 5x - 2.

The sign on bb carries through the Inner and Last products, so tracking signs carefully matters as much as the multiplication itself.

When the middle term disappears

Multiply (x+3)(x3)(x+3)(x-3), so a=1a=1, b=3b=3, c=1c=1, d=3d=-3.

  1. First: xx=x2x \cdot x = x^2.
  2. Outer: x(3)=3xx \cdot (-3) = -3x.
  3. Inner: 3x=3x3 \cdot x = 3x.
  4. Last: 3(3)=93 \cdot (-3) = -9.
  5. Combine like terms: 3x+3x=0-3x + 3x = 0 — the Outer and Inner terms cancel.
  6. Result: x29x^2 - 9.

This is the difference of two squares pattern: whenever the two binomials are (p+q)(pq)(p+q)(p-q), the middle term always cancels, leaving p2q2p^2 - q^2. See the Difference of Two Squares calculator to go the other direction — recognizing and factoring that pattern.

FOIL is the reverse of factoring

FOIL expands a product of two binomials into a polynomial. Factoring does the opposite: starting from a trinomial like 12x2+11x+212x^2 + 11x + 2, it finds the two binomials — (3x+2)(3x+2) and (4x+1)(4x+1) — that multiply back to it. The two operations undo each other, which is why checking a factored answer is as simple as running it back through FOIL.

Beyond two binomials

FOIL is a shortcut that only works for two binomials. Multiplying three or more expressions, or a binomial by a trinomial, still uses the same underlying idea — the distributive property, multiplying every term of one expression by every term of the other — but there is no four-letter mnemonic for it, since the number of term-pairs grows. FOIL's four letters exist specifically because 2×2=42 \times 2 = 4 pairs is a case worth memorizing.

Solving the expanded equation

If you FOIL two binomials and set the result equal to zero, you have a quadratic equation. The Quadratic Formula calculator solves any ax2+bx+c=0ax^2+bx+c=0 for its roots — a natural next step after expanding a factored form with FOIL.

Frequently asked questions

What does FOIL stand for?
FOIL stands for First, Outer, Inner, Last — the four multiplications needed to expand (ax+b)(cx+d)(ax+b)(cx+d): the First terms (axcxax \cdot cx), the Outer terms (axdax \cdot d), the Inner terms (bcxb \cdot cx), and the Last terms (bdb \cdot d). Adding all four products expands the binomial product into a trinomial.
Why do the two middle terms combine into one?
The Outer product (adxad\,x) and the Inner product (bcxbc\,x) are both multiples of xx — "like terms" — so they add together into a single xx term: (ad+bc)x(ad+bc)x. The First product gives the x2x^2 term and the Last product gives the constant term, and neither has a like term to combine with.
Is FOIL just the distributive property?
Yes. FOIL is the distributive property applied twice: first distribute (ax+b)(ax+b) over cxcx, then distribute (ax+b)(ax+b) over dd, and add the results. FOIL is simply a memorable order (First, Outer, Inner, Last) for doing that distribution without missing a term — it only works for two binomials, while the distributive property itself works for any number of terms.
What happens when a middle or constant term is 0?
If the Outer and Inner products cancel out (ad+bc=0ad + bc = 0), the xx term disappears entirely and the result is a binomial like x29x^2 - 9 instead of a trinomial — this is exactly the pattern behind the difference of two squares. Likewise, if the Last product bdbd is 0, the constant term is dropped from the expanded polynomial.
How is FOIL the reverse of factoring?
Factoring a trinomial like x2+11x+2x^2 + 11x + 2 back into (3x+2)(4x+1)(3x+2)(4x+1) undoes exactly what FOIL does. FOIL expands a product of two binomials into a polynomial; factoring finds the two binomials that multiply back to a given polynomial — the two operations are inverses of each other.
Can FOIL handle negative or decimal coefficients?
Yes. Enter a negative coefficient with its sign, e.g. b=2b = -2 for (3x2)(3x-2), and the calculator carries that sign through every one of the four products. Decimal coefficients like a=0.5a = 0.5 work the same way, with every product computed exactly (no floating-point rounding).

Related calculators