9
2
7
8
-1
-1
9
2
7
8
-1
-1
Function composition is one of the most important operations in precalculus and beyond, forming the conceptual backbone of the chain rule in calculus. Given two functions $$f$$ and $$g$$, the composite function $$f \circ g$$ is defined as $$f(g(x))$$ — you first evaluate $$g$$ at $$x$$, then feed that output into $$f$$. Crucially, composition is not commutative: $$f(g(x)) \neq g(f(x))$$ in general, which this calculator clearly demonstrates.
Our Composite Function Calculator lets you define $$f(x)$$ as either a linear ($$ax + b$$) or quadratic ($$ax^2 + bx + c$$) function and $$g(x)$$ as a linear function ($$cx + d$$). It then computes both $$f(g(x))$$ and $$g(f(x))$$ at your chosen point, along with the individual values $$f(x)$$ and $$g(x)$$. Comparing the two compositions side by side builds deep intuition about the asymmetry of function composition.
Composite functions appear throughout applied mathematics: in physics, converting between unit systems involves nested linear functions; in economics, tax-after-discount calculations are compositions of linear maps; and in computer science, function pipelines are sequential compositions. This calculator helps you verify hand computations and explore how changing coefficients affects both composition orders.
The calculator evaluates compositions using straightforward substitution:
Individual evaluations: $$f(x)$$ is computed based on your chosen type — linear: $$ax + b$$ or quadratic: $$ax^2 + bx + c$$. The function $$g(x) = cx + d$$ is always linear.
Composition f(g(x)): First compute $$g(x) = cx + d$$, then substitute into $$f$$. For linear $$f$$: $$f(g(x)) = a(cx + d) + b = acx + ad + b$$. For quadratic $$f$$: $$f(g(x)) = a(cx+d)^2 + b(cx+d) + c$$.
Composition g(f(x)): First compute $$f(x)$$, then substitute into $$g$$: $$g(f(x)) = c \cdot f(x) + d$$.
Notice that even when both $$f$$ and $$g$$ are linear, the two compositions generally differ unless the functions satisfy special symmetry conditions.
Compare f(g(x)) and g(f(x)) to see whether composition order matters for your specific functions. If they are equal at one particular x-value, that does not mean they are equal everywhere — try several values to check. When $$f(g(x)) = g(f(x))$$ for all x, the functions are said to commute under composition, which is relatively rare. The individual values $$f(x)$$ and $$g(x)$$ help you trace each step of the computation manually.
Inputs
Results
f(x) = 2x + 3, g(x) = x − 1. f(g(3)) = f(2) = 7, g(f(3)) = g(9) = 8. Different results confirm non-commutativity.
Inputs
Results
f(x) = x² − 4, g(x) = 2x + 1. f(g(1)) = f(3) = 5, g(f(1)) = g(−3) = −5. Composition with a quadratic amplifies differences.
Function composition combines two functions by using the output of one as the input of the other. The notation $$(f \circ g)(x) = f(g(x))$$ means evaluate $$g$$ first, then apply $$f$$ to the result. It is a fundamental operation in algebra, calculus, and all branches of mathematics.
No, function composition is generally not commutative. That is, $$f(g(x)) \neq g(f(x))$$ for most function pairs. Two functions commute under composition only under special algebraic conditions. This calculator lets you verify this by computing both orders simultaneously.
The chain rule in calculus states that the derivative of a composite function $$f(g(x))$$ is $$f'(g(x)) \cdot g'(x)$$. Understanding composition is a prerequisite for applying the chain rule correctly. If you can identify the outer function $$f$$ and inner function $$g$$, the chain rule follows naturally.
This calculator supports a quadratic $$f$$ composed with a linear $$g$$, or a linear $$f$$ composed with a linear $$g$$. Composing two quadratics produces a degree-4 polynomial, which is more complex. You can still use this tool by treating one quadratic as a linear approximation near your point of interest.
The domain of $$f(g(x))$$ consists of all x-values in the domain of $$g$$ for which $$g(x)$$ falls within the domain of $$f$$. For linear and polynomial functions (as in this calculator), the domain is all real numbers, so there are no restrictions. When square roots or logarithms are involved, domain analysis becomes critical.
Two functions $$f$$ and $$g$$ are inverses if both $$f(g(x)) = x$$ and $$g(f(x)) = x$$ for all x in their domains. You can test this with the calculator: if both composition outputs equal the input x-value for every x you try, the functions are likely inverses. A formal proof requires showing this algebraically for all x.
Roboculator Team
The Roboculator Team explains calculations, planning tools, and practical formulas in clear language for real-life situations.
How helpful was this calculator?
Be the first to rate!
Function Transformations Calculator
Precalculus & Advanced Math
Piecewise Function Calculator
Precalculus & Advanced Math
Parametric Equation Calculator
Precalculus & Advanced Math
Polar Equation Calculator
Precalculus & Advanced Math
Conic Sections Calculator
Precalculus & Advanced Math
Hyperbola Calculator
Precalculus & Advanced Math