Free Algebra Solver
FOIL

FOIL Calculator

Enter two binomials such as (2x − 3)(x + 4). The calculator labels the First, Outer, Inner, and Last products and adds them up.

Interpreted as: (2x - 3)(x + 4) (Expand) Ready
Examples
Solution

Worked example: (2x - 3)(x + 4)

Worked example. Edit the problem above and press Expand to solve your own.

Problem(2x - 3)(x + 4)
  1. Multiply the binomials (FOIL)

    Multiply each term in one factor by each term in the other, then collect matching powers.

    (2x)(x) = 2x²
    First
    (2x)(4) = 8x
    Outer
    (−3)(x) = −3x
    Inner
    (−3)(4) = −12
    Last
    2x² + 8x + −3x + −12
    Write all the products
    2x² + 5x − 12
    Combine like terms

    The distributive property a(b + c) = ab + ac keeps the value unchanged.

  2. Collect like terms

    Add coefficients of terms with the same power of x and write the powers in descending order.

    (2x - 3)(x + 4)
    Original expression
    2x² + 5x − 12
    Combine like terms and order by power

    Only like terms are combined, so the expression keeps the same value for every x.

Answer2x² + 5x − 12

FOIL method guide

FOIL calculator: multiply two binomials with the FOIL method

Type two binomials into the FOIL calculator above and it shows the First, Outer, Inner, and Last products before combining them. The guide explains the FOIL method and where it stops working.

What does FOIL stand for?

FOIL stands for First, Outer, Inner, Last. It is a way to multiply two binomials. You multiply the first, outer, inner, and last pairs of terms, then add the four products and combine like terms. For example, (2x − 3)(x + 4) = 2x² + 5x − 12.

How does the FOIL method work?

The FOIL method gives you a fixed order for the four products you get when two binomials multiply. Each letter names one pair of terms.

LetterPairIn (a + b)(c + d)
FFirst terms of each bracketa × c
OOuter termsa × d
IInner termsb × c
LLast terms of each bracketb × d

The outer and inner products are usually like terms, so they combine into the middle term of the answer. That is why two binomials normally give three terms.

Worked example: (2x − 3)(x + 4)

The answer is 2x² + 5x − 12. Keep the minus sign with the 3 in every product it takes part in.

First
2x × x = 2x²
Outer
2x × 4 = 8x
Inner
−3 × x = −3x
Last
−3 × 4 = −12
Add and combine
2x² + 8x − 3x − 12 = 2x² + 5x − 12

Check with x = 1: (2 − 3)(1 + 4) = −5, and 2 + 5 − 12 = −5. The values agree, so the expansion is right.

What happens when you FOIL (x + 5)(x − 5)?

You get x² − 25, because the outer and inner products cancel. This special product is called a difference of squares.

First gives x², Outer gives −5x, Inner gives +5x, and Last gives −25. The −5x and +5x add to zero. Any pair like (a + b)(a − b) gives a² − b², so (x − 3)(x + 3) is x² − 9.

Compare that with (x + 2)(x − 3), where the numbers differ. The outer and inner products are −3x and 2x, which only partly cancel, so the answer is x² − x − 6. The middle term vanishes only when the two numbers match.

How do you FOIL a squared binomial like (x − 4)²?

Write it as (x − 4)(x − 4) and FOIL as usual. The result is x² − 8x + 16.

First
x × x = x²
Outer and Inner
−4x − 4x = −8x
Last
−4 × −4 = 16

The pattern is (a − b)² = a² − 2ab + b², and (a + b)² = a² + 2ab + b². The middle term is twice the product, and the last term is always positive. Writing (x − 4)² as x² − 16 is the classic mistake here.

Why does FOIL only work for two binomials?

FOIL names exactly four products, and only a pair of two-term brackets produces four. A binomial times a trinomial produces six products, so FOIL would leave two out.

For bigger products, use the box method or distribute each term. In the box method you draw a grid with one polynomial along the top and the other down the side, then fill each cell with a product. Distributing works the same way without the grid: every term in the first bracket multiplies every term in the second.

For example, (x − 2)(x² + 2x + 4) has six products and simplifies to x³ − 8. The expand calculator handles these longer products.

How does the box method compare with FOIL?

The box method gives the same four products as FOIL, laid out in a grid. Some students find it easier because every product has its own cell, so nothing gets skipped.

For (2x − 3)(x + 4), write 2x and −3 down the side and x and 4 across the top. Each cell is the product of its row and column.

×x4
2x2x²8x
−3−3x−12

Add all four cells: 2x² + 8x − 3x − 12 = 2x² + 5x − 12. The like terms sit on a diagonal of the grid, which makes them easy to find. The grid just grows a row or column when a factor has more terms, which is why it keeps working where FOIL stops.

How do you check a FOIL answer?

Substitute a small number into both the original and your answer and compare. If the two values match, your expansion is very likely right.

Try (3x + 1)(2x + 5), which expands to 6x² + 17x + 5. At x = 1 the original is 4 × 7 = 28, and 6 + 17 + 5 = 28. Avoid testing with x = 0 alone, since it only checks the constant term.

What mistakes do students make with FOIL?

Most mistakes are sign errors in the Inner and Last steps. In (2x − 3)(x + 4), the inner product is −3x, not 3x. Circle the sign with each term before you start.

Another is forgetting to combine the Outer and Inner products at the end, leaving four terms where three belong. And with coefficients, multiply them fully: in (3x + 1)(2x + 5), First is 6x², not 5x² or 6x.

Frequently asked questions

Short answers to the questions people ask most about this topic.

What is the FOIL method in math?

It is a memory aid for multiplying two binomials. You multiply the First, Outer, Inner, and Last pairs of terms and then add the results. It is the distributive property applied twice, in a set order.

Does the order of FOIL matter?

No. Multiplication and addition don't depend on order, so any order that covers all four products gives the same answer. FOIL just keeps you from missing one.

Can you use FOIL for (x + 2)(x² + 3x + 1)?

Not directly, since the second factor has three terms. Distribute instead: multiply x and then 2 by each of the three terms, giving six products to combine.

What is (x + 3)(x − 2) using FOIL?

First x², Outer −2x, Inner 3x, Last −6. Combining gives x² + x − 6.

How do I use the multiply binomials calculator?

Type the two brackets next to each other, such as (2x - 3)(x + 4), and press the button. You'll see each FOIL product labeled, then the combined answer. Squares like (x - 4)^2 work too, as long as both brackets use the same letter.

Why does FOIL sometimes give only two terms?

When the outer and inner products cancel, the middle term disappears. This happens with a sum times a difference of the same terms, such as (x + 5)(x − 5) = x² − 25.

How do I reverse FOIL?

Reversing FOIL is factoring a trinomial. For x² + 5x + 6, look for two numbers that multiply to 6 and add to 5 (2 and 3), giving (x + 2)(x + 3).

Math keypad

Expand mode

Use the keypad below or tap the expression to use your phone keyboard.

Keyboard tips

Ctrl + Enter
Run the selected operation
^
Enter a power, such as x^2
sqrt(
Calculate an exact or simplified square root
a:b
Separate quantities in a ratio
12, 18
Separate integers in an LCM and GCD calculation
@ x =
Assign x when evaluating an expression
y =
Enter a polynomial function to graph
|
Wrap an absolute-value expression