FOIL Method Calculator
Expand the product (ax+b)(cx+d) using the FOIL method with step-by-step working. Shows First, Outer, Inner, and Last terms separately.
Did this tool work for you?
How to use this calculator
FOIL stands for First, Outer, Inner, Last — the four pairs of terms multiplied when expanding the product of two binomials.
- 1
Enter a and b for the first binomial (ax + b).
- 2
Enter c and d for the second binomial (cx + d).
- 3
The expanded polynomial is shown along with each FOIL step labelled.
- 4
To use negative terms, enter negative values for b or d (e.g., b = −3 gives x − 3).
Frequently asked questions
How do I enter a binomial such as 3x − 2?
Put the sign inside the number: a = 3 and b = −2 for 3x − 2. The form multiplies (ax + b)(cx + d), so subtraction is just a negative b or d. For (x + 3)(x − 3) enter a = 1, b = 3, c = 1, d = −3.
What does FOIL stand for, and why does it work?
First, Outer, Inner, Last: the four products ac·x², ad·x, bc·x and bd. It is the distributive law applied twice, which is why the result is acx² + (ad + bc)x + bd. The Outer and Inner terms both contain x, so they are added into one middle coefficient.
How do I enter (x + 2)(x + 5), where x has no visible coefficient?
Enter 1 for each x coefficient (a = 1, c = 1). A coefficient left at 0 removes the x term entirely, so entering a = 0 turns the first binomial into the constant b and the product becomes linear. For example a = 0, b = 2, c = 3, d = 5 gives 6x + 10.
Why can the x² term disappear from the answer?
The x² coefficient is a × c, so it is zero whenever a or c is zero. The expanded line then drops that term. If every product is zero, it prints 0.
Does it work with decimals and fractions?
Decimals work, for example a = 0.5, b = 2, c = 4, d = −3 gives 2x² + 6.5x − 6. Fractions have to be converted to decimals first, and results are rounded to six decimal places. A coefficient such as ⅓ becomes 0.333333, so the output is approximate, not exact.
What shortcuts does FOIL contain?
Three patterns appear often: (x + p)² = x² + 2px + p², (x − p)² = x² − 2px + p², and (x + p)(x − p) = x² − p². In the second case the middle term cancels: a = 1, b = 3, c = 1, d = −3 gives x² − 9 with an x coefficient of 0.
Does it multiply bigger polynomials, like a trinomial times a binomial?
No. FOIL only describes two binomials. A trinomial times a binomial needs each term of the first multiplied by each term of the second, six products in all. This form has fields for two binomials in one variable and nothing else.
Can I check my homework answer with it?
Yes. The page lists each of the four products separately, labelled FIRST, OUTER, INNER and LAST, so you can compare your own steps rather than just the final line. Note that the working lines show a coefficient of 1 as "1x²", while the final polynomial writes it as "x²".
FOIL calculator — expand (ax + b)(cx + d) step by step
The four products
To expand (ax + b)(cx + d), multiply the First terms (ax · cx = ac·x²), the Outer terms (ax · d = ad·x), the Inner terms (b · cx = bc·x) and the Last terms (b · d = bd). Combine the two x terms and you reach acx² + (ad + bc)x + bd. The calculator prints each product on its own line and then the finished polynomial.
| Step | Product | Contributes to |
|---|---|---|
| First | a × c | x² coefficient |
| Outer | a × d | x coefficient |
| Inner | b × c | x coefficient |
| Last | b × d | constant term |
Worked examples
Every result in this table was produced by running the calculator with the inputs shown.
| Product | Inputs (a, b, c, d) | Expanded |
|---|---|---|
| (2x + 3)(4x − 1) | 2, 3, 4, −1 | 8x² + 10x − 3 |
| (x + 3)(x − 3) | 1, 3, 1, −3 | x² − 9 |
| (x + 5)(x + 5) | 1, 5, 1, 5 | x² + 10x + 25 |
| (3x − 2)(−x + 4) | 3, −2, −1, 4 | −3x² + 14x − 8 |
| (0.5x + 2)(4x − 3) | 0.5, 2, 4, −3 | 2x² + 6.5x − 6 |
Reading the first example
For (2x + 3)(4x − 1) the four products are 2 × 4 = 8x², 2 × (−1) = −2x, 3 × 4 = 12x and 3 × (−1) = −3. The two x terms combine to 10x, so the answer is 8x² + 10x − 3. Because the Outer product is negative, it partly cancels the Inner one. Watching which products carry a minus sign is where hand calculations usually go wrong.
When the middle term vanishes
If the Outer and Inner products are opposites, the x coefficient is zero. That happens when the binomials differ only in the sign of the constant: (x + 3)(x − 3) = x² − 9. The calculator then shows an x coefficient of 0 and leaves the middle term out of the polynomial. Conversely, two identical binomials such as (x + 5)(x + 5) give a middle coefficient of twice the constant, here 2 × 5 = 10.
Checking by substitution
Pick any value for x and compare both sides. Taking x = 1 in (2x + 3)(4x − 1) gives 5 × 3 = 15, and 8 + 10 − 3 is also 15. If the two numbers differ, one of the signs is wrong. This works for every expansion on the page, and it is quicker than redoing the multiplication. Choosing x = 0 is also useful: the left side becomes b × d and the right side must equal the constant term.
Learn more from an authoritative source:
WikipediaGolden Ratio Calculator
Calculate all three values of a golden ratio division — short side a, long side b, and total length a+b — given any one of them. φ ≈ 1.6180339887.
Pascal's Triangle Calculator
Generate up to 20 rows of Pascal's Triangle and display the nCr (combination) values for any selected row.
Permutation & Combination Calculator
Calculate nPr (permutations) and nCr (combinations) with step-by-step factorial expansion. Supports n and r up to 20.
Fraction / Decimal / Percent Converter
Convert between fractions, decimals, and percentages in any direction. Six conversion modes in one tool.
Decimal to Fraction Calculator
Convert any decimal number to a simplified fraction in lowest terms, with step-by-step working. Handles terminating and long decimals.
Simplify Fractions Calculator
Reduce any fraction to its simplest form (lowest terms) using the GCD. Shows the GCD used and the decimal equivalent.
Results are estimates for informational purposes only and do not constitute professional financial, medical, legal, or technical advice. Read full disclaimer →