FOIL Calculator
Result
Expanded form
- First
- 1.000000
- Outer
- 3.000000
- Inner
- 2.000000
- Last
- 6.000000
A FOIL calculator multiplies two binomials and prints the expanded quadratic that the four products add up to. FOIL is the order to work in: First, Outer, Inner, Last — the two leading terms, the two outside terms, the two inside terms, and the two constants. Each of those four products is listed by name beside the finished expansion, so (x + 2)(x + 3) reads as 1, 3, 2 and 6, and then as x² + 5x + 6 in expanded form. Negative coefficients are treated the same way: when the middle two products partly cancel, the expansion shows it, and a term that works out to zero is dropped rather than printed with a zero coefficient. Fractional coefficients stay fractions, so the answer remains exact.
Four coefficients and the expansion they produce
| a | b | c | d | Expansion |
|---|---|---|---|---|
| 1 | 1 | 1 | 1 | x² + 2x + 1 |
| 1 | 2 | 1 | 3 | x² + 5x + 6 |
| 1 | -2 | 1 | -3 | x² - 5x + 6 |
| 1 | 2 | 1 | -3 | x² - x - 6 |
| 1 | -1 | 1 | 1 | x² - 1 |
| 2 | 1 | 3 | 4 | 6x² + 11x + 4 |
| 1 | 5 | 1 | -5 | x² - 25 |
| 1 | 3 | 1 | 0 | x² + 3x |
| 1 | 0 | 1 | 7 | x² + 7x |
| -1 | 2 | 1 | 3 | -x² - x + 6 |
| 2 | -3 | 4 | 1 | 8x² - 10x - 3 |
| 1 | 10 | 1 | -10 | x² - 100 |
Each row takes the four coefficients of (ax + b)(cx + d) and shows the quadratic they multiply out to. The rows are chosen to cover the sign combinations rather than to be arbitrary, because the signs are what the four named products cannot tell you on their own: the third row has two negative constants and still ends on a positive term, the fourth has one of each and prints a negative middle term with its coefficient of 1 left off, and the fifth cancels its middle term entirely. The eighth row shows a missing last term and the ninth a missing inner product, both dropped rather than printed with a zero. The tenth has a negative leading coefficient written as a bare minus. The first four columns are whole numbers and the last is notation, so the table is identical in all ten languages the site serves.
Formula
(ax + b)(cx + d) = acx² + (ad + bc)x + bd F = ac O = ad I = bc L = bd
- a, c
- The two coefficients of x, one from each binomial. Neither may be zero: a binomial with a zero x term is a constant, and multiplying by it is not this method. The product of the two is the first term of the expansion, which is why the leading coefficient of the answer is ac and not simply a or c.
- b, d
- The two constants. They may be zero, negative or fractional, and they decide two of the four products: the outer pair ad and the inner pair bc add together to give the middle term, while their product bd is the constant at the end. Both being negative is what makes the last term positive again.
- F, O, I, L
- The four products, in the order the method names them: first (ac), outer (ad), inner (bc), last (bd). The middle term of the expansion is the sum of the outer and inner products, which is the only step in FOIL where two numbers combine rather than simply being written down.
- x
- The variable the two binomials are written in. It carries no value here — the answer is an expression rather than a number, which is why the main reading is text and not a numeric column.
Use this to multiply two binomials by hand and check the result step by step. The reverse direction — taking an expanded quadratic and writing it as a product — is factoring, and the completing-the-square page starts from the same expression from the other end.
Worked examples
(x + 2)(x + 3)
- First: x × x = x², so the first product is 1
- Outer: x × 3 = 3x, the outer product is 3
- Inner: 2 × x = 2x, the inner product is 2
- Last: 2 × 3 = 6
- Outer and inner combine into the middle term: 3x + 2x = 5x
- The expansion is x² + 5x + 6
The standard case, and the one where the four products are all positive and all distinct. The middle term comes from adding the outer and inner products, which is the step readers most often skip — having both numbers printed beside the answer is what makes that step checkable.
When neither x coefficient is 1
- First: 2x × 3x = 6x², so the leading coefficient is 6
- Outer: 2x × 4 = 8x
- Inner: 1 × 3x = 3x
- Last: 1 × 4 = 4
- Middle term: 8x + 3x = 11x
- The expansion is 6x² + 11x + 4
The leading coefficient is a product rather than a single number, so it cannot be read off either binomial. Nothing else about the method changes: the middle term is still the sum of the outer and inner products, and it is the only place where two of the four numbers merge.
A difference of two squares
- First: x × x = x²
- Outer: x × (−5) = −5x
- Inner: 5 × x = 5x
- Last: 5 × (−5) = −25
- The outer and inner products are −5x and +5x, which cancel exactly
- With no middle term left, the expansion is x² − 25
The case that proves the middle term is a sum and not a product. The four named products are all non-zero, yet the expansion has only two terms — because the two that would form the middle term are equal and opposite. A page that printed the four products without adding them would look like it had lost a term.
Limitations
The coefficient of x in each binomial must be non-zero. With either of them zero there is no x term to pair up, the expression is a constant times a binomial, and the first step of the method produces nothing — so the input is refused by name instead. All four coefficients are limited to a magnitude of one million, because the outer and inner products are added before being rounded and the largest intermediates grow past what a reader can check by eye. Fractional results are printed as fractions when the denominator is at most one thousand and divides evenly, and as six decimals otherwise, so (x + 1/2)(x + 3) prints a half rather than a point five. This page multiplies; it does not factor. Going from an expanded quadratic back to its two binomials is the reverse problem, and the page does not attempt it.
Frequently asked questions
- What does FOIL stand for?
- First, Outer, Inner, Last. It names four pairs of terms taken from the two binomials in that order: the two leading terms, the two on the outside of the written product, the two on the inside, and the two constants. Multiplying the four pairs and adding them gives the expanded quadratic.
- Why do the outer and inner products get added?
- Because both of them produce an x term, and like terms combine. Nothing in FOIL is optional: the four products are the complete list of pairs, and the result is their sum. The outer and inner terms are the only two that can merge, which is why the expansion of two binomials has three terms rather than four.
- Does FOIL work with negative coefficients?
- Yes, and the sign travels with the term it belongs to. In (x + 5)(x − 5) the outer product is −5x and the inner product is +5x; they cancel, so the middle term disappears entirely and only two terms are left. Both constants negative is a different case: it makes the final product positive again.
- Can the x coefficient be zero?
- Not on this page. A binomial whose x coefficient is zero is really just a constant, and multiplying by it is ordinary arithmetic rather than this method — the first step would produce nothing to write down. The input is refused and named rather than silently treated as a constant.
- Why is a term sometimes missing from the answer?
- Because its coefficient worked out to zero. When the outer and inner products cancel, there is no x term at all, and the expansion is written x² − 25 rather than x² + 0x − 25. Dropping the empty term is the convention the printer uses everywhere on this page; the four named products still show what happened to it.
- Why are fractional answers printed as fractions?
- Because a fraction stays exact while a decimal is only one of its spellings. (x + 1/2)(x + 3) has an x coefficient of 7/2, and printing that as 3.5 would be right here but would drift as soon as the next step multiplied it. The printed form uses a fraction whenever the denominator divides evenly and is at most one thousand, and falls back on six decimals only when it must.
References
- Quadratic Equation — the equation whose left-hand side the expansion produces, and the standard form the coefficients feed into — Wolfram MathWorld (United States)
- Completing the Square — the same quadratic expression taken the other way, from expanded form into a squared bracket — Wolfram MathWorld (United States)
- Parabola — the curve an expanded quadratic draws, and the reason its coefficients are worth getting right — Wolfram MathWorld (United States)