acalculator

How do I FOIL binomials?

Type two binomials in brackets, such as (2x − 18)(3x + 3). The FOIL calculator shows the first, outer, inner and last products, adds them, and combines like terms into the final product.

Your numbers

Product
6x^2 - 48x - 54

(2x - 18)(3x + 3) = 6x^2 - 48x - 54.

First
6x²
Outer
6x
Inner
−54x
Last
−54
FOIL steps
First: 2x × 3x = 6x²; Outer: 2x × 3 = 6x; Inner: (−18) × 3x = −54x; Last: (−18) × 3 = −54; Add: 6x² + 6x − 54x − 54; Combine like terms: 6x² − 48x − 54

Product: 6x^2 - 48x - 54. (2x - 18)(3x + 3) = 6x^2 - 48x - 54.

How does FOIL work here?

How to calculate

Multiplies two binomials by the FOIL method: the first, outer, inner and last products, their sum, and the answer with like terms combined, in exact fractions.

Example with the default inputs (Two binomials (2x - 18)(3x + 3)): (2x - 18)(3x + 3) = 6x^2 - 48x - 54.

Method: (a + b)(c + d) = ac + ad + bc + bd: First ac, Outer ad, Inner bc, Last bd; then like terms are combined in exact fractions.

  • Each bracket holds exactly two unlike terms. Coefficients are exact fractions: 0.5 is 1/2.
  • The first and last term of each bracket are taken in the order typed.

Machine-readable copies: Markdown, JSON.

Worked examples

Each example is checked against the calculator on every build.

  1. Two binomials (2x - 18)(3x + 3) gives Product 6x^2 - 48x - 54, First 6x², Outer 6x, Inner −54x, Last −54, FOIL steps First: 2x × 3x = 6x²; Outer: 2x × 3 = 6x; Inner: (−18) × 3x = −54x; Last: (−18) × 3 = −54; Add: 6x² + 6x − 54x − 54; Combine like terms: 6x² − 48x − 54.Source: OpenStax, Algebra and Trigonometry 2e, §1.4 Polynomials, Example 5 ((2x − 18)(3x + 3) = 6x² − 48x − 54), https://openstax.org/books/algebra-and-trigonometry-2e/pages/1-4-polynomials
  2. Two binomials (9x + 4)(9x - 4) gives Product 81x^2 - 16, Outer −36x, Inner 36x.Source: OpenStax, Algebra and Trigonometry 2e, §1.4 Polynomials, Example 7 ((9x + 4)(9x − 4) = 81x² − 16), https://openstax.org/books/algebra-and-trigonometry-2e/pages/1-4-polynomials
  3. Two binomials (3x - 8)(3x - 8) gives Product 9x^2 - 48x + 64.Source: OpenStax, Algebra and Trigonometry 2e, §1.4 Polynomials, Example 6 ((3x − 8)² = 9x² − 48x + 64), https://openstax.org/books/algebra-and-trigonometry-2e/pages/1-4-polynomials
  4. Two binomials (x + 2y)(0.5x - y) gives Product x^2/2 - 2y^2, First x²/2, Outer −x y, Inner x y, Last −2y².

How it works

For two binomials (a + b)(c + d), with a and c the first terms of each bracket and b and d the last:

  • First = a × c
  • Outer = a × d
  • Inner = b × c
  • Last = b × d
  • Product = First + Outer + Inner + Last, with like terms combined.

Input. One expression: two brackets side by side, such as (2x − 18)(3x + 3). Each bracket must hold exactly two terms that are not like terms after it is simplified (x + x is one term, 2x, and is refused). A term may hold a number, letters a to z except e, whole powers (x^2), and products (3xy). The first and last term of each bracket are the terms in the order typed. Anything else (one bracket, three brackets, a sum outside the brackets) gets a message instead of an answer.

Exact arithmetic. Every coefficient is an exact fraction: 0.5 is 1/2, so 0.5x × x is x²/2. Like terms (the same letters to the same powers) are added exactly.

Output format. The product is written with the highest total power first, then letters in alphabetical order, then the number. A fraction is written after the letters (x^2/2). The four parts are written the same way, with powers as superscripts and true minus signs (−54x). In the steps a negative, fractional or multi-factor term is put in brackets, powers show as superscripts, and minus signs are true minus signs.

Worked examples by hand

(2x − 18)(3x + 3) (OpenStax Example 5). First 2x × 3x = 6x²; Outer 2x × 3 = 6x; Inner −18 × 3x = −54x; Last −18 × 3 = −54. Add: 6x² + 6x − 54x − 54 = 6x² − 48x − 54.

(9x + 4)(9x − 4) (OpenStax Example 7). First 81x², Outer −36x, Inner 36x, Last −16. The middle terms cancel: 81x² − 16.

(3x − 8)(3x − 8) (OpenStax Example 6). 9x² − 24x − 24x + 64 = 9x² − 48x + 64.

(x + 2y)(0.5x − y). First x × x/2 = x²/2; Outer x × (−y) = −xy; Inner 2y × x/2 = xy; Last 2y × (−y) = −2y². The middle terms cancel: x²/2 − 2y².

Other questions people ask

What does FOIL stand for?

First, Outer, Inner, Last. To multiply (a + b)(c + d), multiply the first terms (ac), the outer terms (ad), the inner terms (bc) and the last terms (bd), then add the four products.

Is FOIL the same as the distributive property?

Yes. FOIL is the distributive property used twice: (a + b)(c + d) = a(c + d) + b(c + d) = ac + ad + bc + bd. It only names the four products in an order that is easy to remember.

Can I use FOIL for a binomial times a trinomial?

No. FOIL covers two terms times two terms, which gives four products. For longer brackets, multiply every term of one bracket by every term of the other (the distributive property calculator does this).

Why do the outer and inner terms often combine?

When both binomials are in the same letter, the outer and inner products are like terms. In (2x − 18)(3x + 3) they are 6x and −54x, which add to −48x.

What happens with (a + b)(a − b)?

The outer and inner products cancel, so the answer is a difference of squares: (9x + 4)(9x − 4) = 81x² − 16.

How do I square a binomial with FOIL?

Write the binomial twice: (3x − 8)² = (3x − 8)(3x − 8) = 9x² − 24x − 24x + 64 = 9x² − 48x + 64.