FOIL Calculator
Calculate foilcalculator instantly with our math tool. Shows detailed work, formulas used, and multiple solution methods.
Calculator
Adjust values & calculateFormula
FOIL multiplies First (ac), Outer (ad), Inner (bc), and Last (bd) terms. The x^2 coefficient is the product of the first terms, the x coefficient is the sum of outer and inner products, and the constant is the product of the last terms.
Last reviewed: December 2025
Worked Examples
Example 1: Multiply (2x + 3)(4x + 5)
Example 2: Multiply (x - 4)(x + 7)
Background & Theory
The FOIL Calculator applies the following established principles and formulas. Mathematics rests on a hierarchy of number systems, each extending the previous. The natural numbers (1, 2, 3, ...) support counting and ordering. The integers add negative values and zero, enabling subtraction without restriction. The rational numbers, expressible as p/q where p and q are integers and q is nonzero, close the system under division. The real numbers fill the gaps left by irrationals such as the square root of 2 or pi, forming a complete ordered field. The complex numbers, written as a + bi where i is the square root of negative one, complete the algebraic closure of the reals and allow every polynomial to have a root. Prime factorization states that every integer greater than one is uniquely expressible as a product of primes, a result known as the Fundamental Theorem of Arithmetic. Computing the greatest common divisor (GCD) of two integers relies most efficiently on the Euclidean algorithm: repeatedly replace the larger number with the remainder when it is divided by the smaller, until the remainder is zero. The last nonzero remainder is the GCD. The least common multiple (LCM) follows from the identity LCM(a, b) = |a * b| / GCD(a, b). Modular arithmetic defines equivalence classes of integers that share the same remainder under division by a modulus n. Fermat's Little Theorem and Euler's Theorem arise from this structure and underpin modern cryptography. Logarithms are the inverses of exponential functions. If b raised to the power x equals y, then the logarithm base b of y equals x. The natural logarithm uses base e, approximately 2.71828. Combinatorics counts arrangements and selections. The number of ordered arrangements (permutations) of r objects from n distinct objects is nPr = n! / (n - r)!. The number of unordered selections (combinations) is nCr = n! / (r! * (n - r)!). Pascal's triangle arranges these binomial coefficients so that each entry equals the sum of the two entries directly above it. The Fibonacci sequence, defined by F(1) = 1, F(2) = 1, and F(n) = F(n-1) + F(n-2), appears throughout nature and connects deeply to the golden ratio via Binet's formula.
History
The history behind the FOIL Calculator traces back through the following developments. Mathematics as a systematic discipline traces to ancient Mesopotamia. Babylonian clay tablets dating to around 1800 BCE demonstrate knowledge of quadratic equations, Pythagorean triples, and base-60 arithmetic, suggesting a practical mathematical tradition far preceding Greek formalism. Euclid of Alexandria compiled the Elements around 300 BCE, establishing the axiomatic method that would define rigorous mathematics for over two thousand years. His work organized plane geometry, number theory, and proportion into logically chained propositions derived from a small set of postulates. The algorithm bearing his name for computing GCDs appears in Book VII and remains in use today. In the 9th century, the Persian scholar Muhammad ibn Musa Al-Khwarizmi wrote Al-Kitab al-mukhtasar fi hisab al-jabr wal-muqabala, the treatise whose title gave algebra its name. He systematized the solution of linear and quadratic equations and described procedures that operated on unknowns as objects, a conceptual leap away from purely numerical calculation. Rene Descartes introduced coordinate geometry in 1637 by uniting algebra and Euclidean geometry, allowing curves to be studied through equations. This synthesis set the stage for calculus. Isaac Newton and Gottfried Wilhelm Leibniz independently developed calculus during the 1660s and 1670s, triggering a priority dispute that lasted decades and divided British and Continental mathematicians. Carl Friedrich Gauss proved the Fundamental Theorem of Algebra in 1799, showing that every nonconstant polynomial has at least one complex root. His Disquisitiones Arithmeticae of 1801 established modern number theory. David Hilbert's formalist program at the turn of the 20th century sought to place all of mathematics on an explicit axiomatic foundation, a project that Kurt Godel's incompleteness theorems of 1931 showed to be fundamentally limited. Alan Turing's work in the 1930s on computability introduced the theoretical model of the stored-program computer and linked mathematical logic directly to the limits of algorithmic calculation. His proof that no algorithm can decide in general whether an arbitrary program will halt or run forever placed fundamental boundaries on what mathematics can mechanically determine, and it opened the discipline now known as theoretical computer science.
Frequently Asked Questions
Formula
(ax + b)(cx + d) = acx^2 + (ad + bc)x + bd
FOIL multiplies First (ac), Outer (ad), Inner (bc), and Last (bd) terms. The x^2 coefficient is the product of the first terms, the x coefficient is the sum of outer and inner products, and the constant is the product of the last terms.
Worked Examples
Example 1: Multiply (2x + 3)(4x + 5)
Problem: Use the FOIL method to expand (2x + 3)(4x + 5).
Solution: First: 2x * 4x = 8x^2\nOuter: 2x * 5 = 10x\nInner: 3 * 4x = 12x\nLast: 3 * 5 = 15\nCombine like terms: 8x^2 + 10x + 12x + 15 = 8x^2 + 22x + 15
Result: 8x^2 + 22x + 15
Example 2: Multiply (x - 4)(x + 7)
Problem: Use FOIL to expand (x - 4)(x + 7).
Solution: First: x * x = x^2\nOuter: x * 7 = 7x\nInner: -4 * x = -4x\nLast: -4 * 7 = -28\nCombine: x^2 + 7x - 4x - 28 = x^2 + 3x - 28
Result: x^2 + 3x - 28
Frequently Asked Questions
What does FOIL stand for and how does it work?
FOIL is an acronym that stands for First, Outer, Inner, Last, representing the four multiplications needed when multiplying two binomials together. When you have an expression like (ax + b)(cx + d), First means multiply the first terms of each binomial (a times c), Outer means multiply the outer terms (a times d), Inner means multiply the inner terms (b times c), and Last means multiply the last terms (b times d). After performing all four multiplications, you combine like terms to get the final trinomial result. FOIL is essentially a systematic way to apply the distributive property twice, ensuring no terms are missed during multiplication.
Is FOIL only used for binomials or can it be applied to other polynomials?
FOIL is specifically designed for multiplying two binomials (expressions with exactly two terms each). It cannot be directly applied to trinomials or larger polynomials because the acronym only accounts for four products, which is exactly how many you get from two two-term expressions. For multiplying larger polynomials, you must use the general distributive property, where every term in the first polynomial is multiplied by every term in the second polynomial. For example, multiplying a binomial by a trinomial produces six individual products, not four. However, the underlying principle behind FOIL, which is systematic distribution, extends to polynomials of any size.
How do you handle negative numbers when using FOIL?
Handling negative numbers in FOIL requires careful attention to sign rules. When a term in either binomial is negative, you must include that negative sign in the multiplication. Remember that a negative times a positive gives a negative result, and a negative times a negative gives a positive result. For example, with (x - 3)(x + 5): First gives x times x = x^2, Outer gives x times 5 = 5x, Inner gives -3 times x = -3x, and Last gives -3 times 5 = -15. Combining: x^2 + 5x - 3x - 15 = x^2 + 2x - 15. The most common mistake is forgetting to carry the negative sign through the Inner and Last multiplications.
What is the connection between FOIL and the distributive property?
FOIL is actually a specific application of the distributive property of multiplication over addition. The distributive property states that a(b + c) = ab + ac. When multiplying two binomials (a + b)(c + d), you first distribute the entire first binomial across the second: a(c + d) + b(c + d). Then you apply distribution again to each piece: ac + ad + bc + bd. These four terms correspond exactly to First (ac), Outer (ad), Inner (bc), and Last (bd). So FOIL is not a separate mathematical principle but rather a mnemonic device that helps students remember the systematic application of the distributive property to the special case of two binomials.
How do you verify FOIL results are correct?
There are several reliable methods to verify your FOIL multiplication results. The simplest approach is to substitute a specific value for x into both the original binomial product and your expanded result and check that they produce the same number. For instance, if you calculated (x + 2)(x + 3) = x^2 + 5x + 6, plug in x = 1: (3)(4) = 12 and 1 + 5 + 6 = 12, confirming correctness. Another verification method is to factor your result back into binomials and see if you recover the original expression. You can also use the reverse FOIL process, checking that the coefficients satisfy the relationships: the x^2 coefficient equals the product of the first terms, and the constant equals the product of the last terms.
What are special product patterns related to FOIL?
Several special product patterns emerge from FOIL that are worth memorizing for speed. The difference of squares pattern states that (a + b)(a - b) = a^2 - b^2, where the middle terms cancel. The perfect square trinomial patterns give (a + b)^2 = a^2 + 2ab + b^2 and (a - b)^2 = a^2 - 2ab + b^2. The sum and difference patterns also include (a + b)(a + b) where Inner and Outer combine to give the doubled middle term. Recognizing these patterns allows you to bypass the full FOIL process entirely and write the answer immediately. These patterns appear constantly in algebra, calculus, and higher mathematics, making them essential formulas to commit to memory.
References
Reviewed by Manoj Kumar, Mathematics Educator · Editorial policy