Last updated: July 31, 2026
FOIL Calculator
Creators
Dharmendra SinghReviewers

Creators
Dharmendra SinghReviewers
Creators
Dharmendra SinghReviewers

Creators
Dharmendra SinghReviewers
Formula
(ax + b)(cx + d) = (ac)x² + (ad + bc)x + bd
Where:
- a=a coefficient
- b=b constant
- c=c coefficient
- d=d constant
Worked Examples
Positive coefficients
Expand (2x+3)(4x+5).
- 1First: 2x·4x = 8x²
- 2Outer+Inner: 2x·5 + 3·4x = 22x
- 3Last: 3·5 = 15
Mixed signs
Expand (x-7)(3x+2).
- 1ac = 3
- 2ad+bc = 2 + (-21) = -19
- 3bd = -14
Decimal coefficients
Expand (0.5x+1.2)(2x-4).
- 1ac = 1
- 2ad+bc = -2 + 2.4 = 0.4
- 3bd = -4.8
Introduction
FOIL is a structured way to multiply two binomials and collect like terms into a quadratic expression.
Formula and Method
FOIL Calculator applies (ax + b)(cx + d) = (ac)x² + (ad + bc)x + bd and returns deterministic outputs from validated inputs.
Validate each required input
Apply the stated formula
Round numeric outputs where needed
Return safe defaults when validation fails
Input Fields
Use these keys exactly as defined in calculation.ts.
- 1
a: a coefficient
- 2
b: b constant
- 3
c: c coefficient
- 4
d: d constant
Output Fields
These values map directly to calculation.ts return keys.
- 1
coefficientX2: Coefficient of x² term after expansion
- 2
coefficientX: Coefficient of x term after expansion
- 3
constant: Constant term after expansion
Validation Rules
All four coefficients must be finite numbers.
Finite numeric values are required
Domain restrictions are enforced before solving
Invalid input returns default-safe outputs
Check examples to confirm expected behavior
How to Use This Calculator
Enter inputs, run the calculation, and read the primary output first.
Enter all required values
Click calculate
Review primary output first
Use supporting outputs for interpretation
Practical Uses
This calculator is useful for study, verification, and fast applied math checks.
Algebra expansion checks
Factoring verification
Quadratic construction
Classroom step demonstration
FAQs
What does the FOIL Calculator compute?
It computes x² Coefficient and supporting outputs from your inputs.
Which inputs are required?
Required inputs are: a coefficient, b constant, c coefficient, d constant.
How are invalid inputs handled?
When validation fails, the calculator returns safe default values and does not attempt invalid math.
Are results rounded?
Yes. Numeric outputs are rounded inside calculation.ts (typically to 6 decimal places).
Can I use negative or decimal values?
Yes. Integers and decimals are supported, including negative values.
How should I verify my answer?
Use the worked examples and compare each output key with your manual steps.