Overview
Function composition means applying one function to the output of another. In f(g(x)) we first compute g(x), then substitute the result into f. Order matters, because f(g(x)) and g(f(x)) often give different results.
Formula
f(g(x)) = f evaluated at g(x), and g(f(x)) = g evaluated at f(x).
How it works
Write both functions
Enter the expressions for f(x) and g(x) using x.
Evaluate the inner function
Compute g(x) at the given value.
Substitute into the outer function
Use the g(x) result as the input to f.
Repeat in reverse order
Compute g(f(x)) and compare the two results.
Worked examples
Example 1: f(x) = x + 1 and g(x) = 2x at x = 3
g(3) = 6, so f(g(3)) = 7. And f(3) = 4, so g(f(3)) = 8.
Example 2: f(x) = x² and g(x) = x + 1 at x = 2
f(g(2)) = f(3) = 9, while g(f(2)) = g(4) = 5.
Frequently asked questions
Is f(g(x)) equal to g(f(x))?
Usually not. Composition is not commutative except in special cases.
What is the inner function?
The function evaluated first, such as g in f(g(x)).
Can a function be composed with itself?
Yes, as in f(f(x)), and the calculator also shows that value.
This calculator is for educational and informational purposes only and is not a substitute for professional advice.