Composite Function Simplifier
Substitute, expand, and simplify composite functions (f ∘ g)(x) = f(g(x)) and (g ∘ f)(x) = g(f(x)) into canonical polynomial form with step-by-step FOIL expansions.
Composition Target
Choose which composite expression to expand & simplify
Step-by-Step Algebraic Expansion & Simplification
Rigorous algebraic stepsEquivalence Test (Check Simplification)
Test any xVerify that the simplified expression yields the exact same numerical output as the unsimplified raw composition:
Simplified Composite Function Curve
x ∈ [-4, 4]How to Simplify a Composite Function f(g(x))
To simplify a composite function, replace every occurrence of the variable x in f(x) with the complete formula for g(x), wrapping g(x) in parentheses. Then, expand any polynomial powers using FOIL or the binomial theorem, distribute scalar coefficients, and combine like terms into descending canonical order.
The 4-Step Algebraic Simplification Method
Simplifying a composite function means transforming the raw nested expression f(g(x)) into its cleanest, most compact canonical form. Unlike numerical evaluation — which yields a single constant — simplification yields a new symbolic formula in terms of x.
- 1 Step 1 • Wrap and Substitute: Write out outer function f(x). Erase each instance of x and replace it with (g(x)) enclosed in full parentheses. Wrapping in parentheses is mandatory to preserve the order of operations for powers and negative signs.
- 2 Step 2 • Expand Exponents (FOIL): If the substituted expression is squared or cubed, expand it completely using the binomial theorem: (a + b)² = a² + 2ab + b².
- 3 Step 3 • Distribute Coefficients: Multiply any leading scalar numbers across every term inside each set of parentheses.
- 4 Step 4 • Combine Like Terms: Group terms by descending powers of x and add their coefficients to produce canonical polynomial standard form.
Expanding Powers with FOIL and the Binomial Theorem
The most error-prone stage of function simplification is squaring or cubing an inner binomial. Remember that exponents do not distribute over addition:
Omitting the middle cross-term 2ab is the single most common student algebraic error.
For example, (2x - 3)² = 4x² - 12x + 9.
The Degree Multiplication Theorem
A powerful sanity check for polynomial composition is the Degree Multiplication Theorem:
Domain Restrictions in Simplified Expressions
When simplifying rational or radical composite functions, algebraic cancellation can artificially disguise forbidden values:
Consider f(x) = x² and g(x) = √x.
The composite function simplifies to f(g(x)) = (√x)² = x.
While the formula y = x exists for all real numbers, the actual composite function is restricted to x ≥ 0 because any negative input cannot enter the inner function √x in the real number system.
Step-by-Step Worked Simplifications
Given f(x) = x² − 3x + 2 and g(x) = 2x − 1, simplify (f ∘ g)(x)
Practical Applications in Science & Engineering
Thermodynamics & Thermal Expansion
If an engine cylinder's volume depends on radius V(r) = π r² h, and temperature causes linear thermal expansion r(T) = r₀(1 + αT), substituting produces the composite thermal volume function V(T).
Microeconomics Cost Modeling
A factory's manufacturing cost depends on units produced C(q) = 50q + 1000. Market demand dictates quantity produced over time q(t) = 20t². The composite cost function over time is C(t) = 1000t² + 1000.
Common Pitfalls & FOIL Mistakes
Forgetting the Cross-Term in (a + b)²
Writing (2x - 1)² = 4x² + 1 instead of 4x² - 4x + 1. Always remember the 2ab middle term!
Sign Errors in Negative Distributions
When distributing -3(2x - 1), forgetting that negative times negative equals positive: it is -6x + 3, not -6x - 3.
Missing Parentheses on Substitution
Writing 2x - 1² instead of (2x - 1)² changes the entire equation and completely invalidates the result.
Reversing Composition Order
Simplifying g(f(x)) when the exam asked for f(g(x)). Since composition is non-commutative, the answer will be completely wrong.
Lead Developer & Founder of Basic Math Tools. Specializes in browser-native computational algorithms and applied mathematics.
Mathematics & curriculum specialists. Audited against standard algebraic and arithmetic principles.