Algebra • Symbolic Function Operations

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.

|
Last Updated: September 2026
|
Verified Accurate: Computer Algebra & Polynomial Ring Axioms
Simplification Presets

Composition Target

Choose which composite expression to expand & simplify

Variable: x
f(x) =
Variable: x
g(x) =
Simplified Composite Function
(f ∘ g)(x) =
4x² + 2x - 6
Raw Substitution: (2x - 1)² + 3(2x - 1) - 4
Classification
Quadratic
Polynomial
Degree (deg)
Degree 2
deg(f) × deg(g) = 2 × 1
y-Intercept (x=0)
(0, -6)
f(g(0)) = -6
Domain
(-∞, ∞)
All Real Numbers

Step-by-Step Algebraic Expansion & Simplification

Rigorous algebraic steps

Equivalence Test (Check Simplification)

Test any x

Verify that the simplified expression yields the exact same numerical output as the unsimplified raw composition:

x =
Raw Output f(g(x)): 36
Simplified Output: 36
Identity Check: Identical (Valid Simplification)

Simplified Composite Function Curve

x ∈ [-4, 4]
Simplified (f ∘ g)(x)
y-Intercept
Direct Answer & Overview
Verified Educational Guide

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.

Primary Mathematical Formula Symbolic Polynomial Substitution & Expansion Model
Standard Equation
ƒ(x)
Q.E.D.
(fcircg)(x)=f(g(x))quadextandquad(gcircf)(x)=g(f(x))(f circ g)(x) = f(g(x)) quad ext{and} quad (g circ f)(x) = g(f(x))
Substitution must preserve parentheses: f(ax + b) requires evaluating powers before distributing coefficients.
Exact Formula
Input Parameters
Required
1
Outer Function f(x): Target algebraic rule receiving the substitution.
2
Inner Function g(x): Expression being inserted in place of variable x.
3
Direction: Select f(g(x)) or reverse g(f(x)).
Expected Outputs
Calculated
Simplified Formula: Fully expanded canonical polynomial expression.
Composite Degree: deg(f ∘ g) = deg(f) · deg(g) polynomial degree.
Worked Numerical Example
Instant Verification
Simplify f(g(x)) for f(x) = x² − 3 and g(x) = 2x + 1
→ f(2x + 1) = (2x + 1)² − 3 = (4x² + 4x + 1) − 3 = 4x² + 4x − 2
f(g(x)) = 4x² + 4x − 2

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. 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. 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. 3
    Step 3 • Distribute Coefficients: Multiply any leading scalar numbers across every term inside each set of parentheses.
  4. 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:

Fatal Mistake (Freshman's Dream)
(a + b)² ≠ a² + b²

Omitting the middle cross-term 2ab is the single most common student algebraic error.

Correct Expansion Identity
(a + b)² = a² + 2ab + b²

For example, (2x - 3)² = 4x² - 12x + 9.

The Degree Multiplication Theorem

A powerful sanity check for polynomial composition is the Degree Multiplication Theorem:

The Degree Multiplication Formula
deg(f ∘ g) = deg(f) × deg(g)
The degree of the composite polynomial is the product of their individual degrees

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

Worked Problem Quadratic × Linear

Given f(x) = x² − 3x + 2 and g(x) = 2x − 1, simplify (f ∘ g)(x)

1. Substitute: f(2x - 1) = (2x - 1)² - 3(2x - 1) + 2
2. Expand power: (2x - 1)² = 4x² - 4x + 1
3. Distribute: -3(2x - 1) = -6x + 3
4. Group: 4x² - 4x + 1 - 6x + 3 + 2 = 4x² - 10x + 6
Final Simplified Result: 4x² − 10x + 6

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.

Fact-Checked & Verified • Computational Accuracy Standards
Updated September 2026 • Editorial Policy
Authored By
Sanjay Samanta

Lead Developer & Founder of Basic Math Tools. Specializes in browser-native computational algorithms and applied mathematics.

Reviewed & Verified By
Academic Review Board

Mathematics & curriculum specialists. Audited against standard algebraic and arithmetic principles.

Found an error or have an improvement suggestion? Report a calculation issue

Frequently Asked Questions

What does simplifying a composite function mean?
Simplifying a composite function means substituting the inner function expression into every occurrence of the variable in the outer function, and then performing algebraic expansion, distribution, and combining like terms until the result is in simplified polynomial or canonical form.
How do you simplify f(g(x)) step by step?
Step 1: Write down f(x). Step 2: Replace every x with parentheses containing g(x): f(g(x)). Step 3: Expand all powers using the binomial theorem or FOIL. Step 4: Distribute scalar coefficients into parentheses. Step 5: Combine like polynomial terms in descending powers of x.
What is the difference between simplifying f(g(x)) and evaluating f(g(c))?
Simplifying f(g(x)) produces a symbolic algebraic formula in terms of the variable x (e.g. 4x² − 12x + 9). Evaluating f(g(c)) inputs a specific number c and outputs a single numeric constant (e.g. 25).
What is the degree of a composite polynomial function?
The degree of a composite polynomial is the product of their individual degrees: deg(f ∘ g) = deg(f) · deg(g). For example, if f is quadratic (degree 2) and g is cubic (degree 3), the simplified composite function f(g(x)) has degree 2 · 3 = 6.
Does simplifying f(g(x)) change its domain?
Algebraic simplification may conceal domain restrictions. For example, if g(x) = √x and f(u) = u², the simplified formula is (√x)² = x. While y = x is defined for all real numbers, the composite function f(g(x)) is strictly restricted to x ≥ 0 because inputs must pass through √x first.
Why is f(g(x)) generally not equal to g(f(x))?
Function composition is non-commutative. Applying transformation g followed by f produces a different result than applying f followed by g, except in special cases such as when f and g are inverse functions (where f(g(x)) = g(f(x)) = x).