How this instrument works
FOIL (First, Outer, Inner, Last) multiplies two binomials together term by term: (x+p)(x+q) expands to x²+(p+q)x+pq, where the x coefficient is simply p plus q, and the constant term is p times q. This page runs that expansion in the FORWARD direction, from two known numbers straight to the trinomial they build.
This site's companion Factoring Trinomials calculator runs the identical relationship BACKWARD: starting from a trinomial's own a, b, and c coefficients, it uses the quadratic formula to recover the two roots that produced it. Seeing the forward direction here makes that reverse process far more intuitive — 'reverse FOIL' factoring is really just running this exact expansion in reverse, hunting for the p and q that would land on a given b and c.
A repeated value (p equal to q) always produces a perfect-square trinomial, recognizable afterward by its constant term itself being a perfect square — a useful pattern to notice once it clicks.
- Enter the first number into the p field.
- Enter the second number into the q field.
- Read x coefficient: simply p plus q.
- Read Constant term: simply p times q — together giving the full expansion x²+(x coefficient)x+(constant term).
Worked example — expanding (x+2)(x+3)
With p=2 and q=3, FOIL gives (x+2)(x+3)=x²+5x+6 — the x coefficient is 2+3=5, and the constant term is 2×3=6, matching term for term. Running this same relationship in reverse is exactly how factoring trinomials works: given x²+5x+6, hunting for two numbers that add to 5 and multiply to 6 leads straight back to 2 and 3.
With p=−3 and q=4, the expansion gives x²+x−12 — a negative p paired with a positive q produces a negative constant term, since −3×4=−12, while the x coefficient, −3+4=1, stays positive.
Questions
What does FOIL stand for?
First, Outer, Inner, Last — the four pairwise products formed when multiplying two binomials together: the first terms, the outer terms, the inner terms, and the last terms, all summed to reach the final expanded trinomial.
How does this relate to factoring a trinomial?
Factoring is FOIL run in reverse — instead of starting from two known numbers and expanding forward, factoring starts from a trinomial's b and c coefficients and searches for the p and q that would produce them, exactly the search this page's own math makes explicit.
How is this different from the Factoring Trinomials calculator on this site?
This page runs the expansion FORWARD, from two chosen numbers to the trinomial they build; that page runs it BACKWARD, from a trinomial's coefficients to its two roots via the quadratic formula, handling cases (irrational or non-integer roots) that a manual reverse-FOIL search would struggle with.
What happens when p equals q?
The result is a perfect-square trinomial — its constant term (p×q, which becomes p²) is itself a perfect square, and its x coefficient (p+q, which becomes 2p) is exactly double the repeated value.
Does the sign of p and q matter?
Yes — a negative p or q flips the sign of terms involving it in both the x coefficient and the constant term, so (x−3)(x+4) produces a genuinely different trinomial than (x+3)(x+4) would.