Racira Calculator

Function Composition Calculator

Function Composition Calculator

Compute f(g(x))

Format: terms like 3x^2, -2x, +5. Exponents use ^.

COMPOSED RESULT
f(g(2)) = 3

Apply g first (x^2 − 3 at 2 gives 1), then f (2x + 1 at 1 gives 3).

Result Breakdown

QuantityValue
f(x) (simplified)2x + 1
g(x) (simplified)x^2 − 3
g(2) = g(x) at input1
f(g(2)) — (f∘g)(2)3
g(f(2)) — (g∘f)(2)22

Composition Curves

g(x) and the composed f(g(x)) across the value table.

Value Table (x = −2 … 2)

xg(x)f(g(x))
-213
-1-2-3
0-3-5
1-2-3
213
Summary Statistics
Order Mattersf∘g ≠ g∘f here
Composition(f∘g)(x) = f(g(x))
f(x)2x + 1
g(x)x^2 − 3

About the Function Composition Calculator

Function composition chains operations: (f∘g)(x) = f(g(x)) means "run g on x, then run f on the output." It is the mathematical version of a pipeline — the inner function feeds the outer one. For f(x) = 2x + 1 and g(x) = x² − 3, the composition (f∘g)(x) = 2(x² − 3) + 1 = 2x² − 5, so at x = 2 the value is 3.

Why order matters

Composition is not commutative: reversing the order gives g(f(x)) = (2x + 1)² − 3, a completely different function. This is why the calculator shows both directions and a value table — watching f(g(x)) diverge from g(f(x)) across inputs makes the non-commutativity concrete. The parser accepts simple polynomials without any eval, so expressions like 3x^2 + 2x − 5 are safe to enter.

Frequently Asked Questions

Related Calculators