Math Solver Free

Function Composition Calculator

(f∘g)(x) and (g∘f)(x), expanded — instantly and free.

How Function Composition Works

Composition chains functions like a production line: g processes x first, then f processes g’s output. The notation (f∘g)(x) is read “f of g of x”, and the rightmost function always acts first.

Substitution, Not Multiplication

The classic mistake is multiplying the functions instead of substituting. For f(x) = 2x + 1 and g(x) = x², (f∘g)(x) replaces every x in f with x², giving 2x² + 1 — not 2x³ + x².

Order Matters

(g∘f)(x) for the same pair is (2x+1)² = 4x² + 4x + 1 — completely different. Always substitute in the order the notation demands, innermost first.

Composition is how inverses are verified: try our inverse function calculator or simplify the substituted expressions with the algebra calculator.

Frequently Asked Questions

What is function composition?

Plugging one function’s output into another: (f∘g)(x) means compute g(x) first, then feed the result into f.

Is (f∘g)(x) the same as (g∘f)(x)?

Almost never — order matters. If f doubles and g squares, (f∘g)(3) = 18 but (g∘f)(3) = 36.

How do you evaluate a composition?

Substitute the entire inner function wherever x appears in the outer function, then simplify. The tool expands and simplifies automatically.

Is this calculator free?

Yes — every tool on Math Solver Free is free with no sign-up, and all calculations run in your browser.