Function Composition Calculator
Compute (f∘g)(x).
Loading tool…
About this tool
Enter f(x) and g(x) to get f(g(x)). With f(x) = 2x + 3 and g(x) = x², the composition is 2x² + 3.
How to use
1
Step 1
Type f(x).
2
Step 2
Type g(x).
3
Step 3
Press Calculate to get f(g(x)).
How it works
Composition substitutes g(x) wherever f has x. The order matters: with f = 2x + 3 and g = x², f(g(x)) = 2x² + 3, but g(f(x)) = (2x + 3)². The result is substituted, not expanded.
(f ∘ g)(x) = f(g(x))
Worked example
Square root of a shifted square
- Input
- f(x) = sqrt(x), g(x) = x^2 + 9
- Output
- sqrt(x ^ 2 + 9)
- Walkthrough
- Replace x in sqrt(x) with x² + 9. The result is defined for all real x since x² + 9 is always positive.
Limitations
- The result is not expanded or simplified, so (x + 1)^2 stays factored.
- It gives f(g(x)) only; swap the inputs for g(f(x)).
Questions
What is f(g(x)) if f = x² and g = x + 1?
(x + 1)².
What is f(g(x)) if f = 2x + 3 and g = x²?
2x² + 3.
Is f(g(x)) the same as g(f(x))?
Usually not. For f = 2x + 3 and g = x², g(f(x)) is (2x + 3)².
Features
- Any two functions
- Symbolic substitution
- Runs in your browser
Related resources
Guides and videos from around the web—opens on YouTube or the publisher’s site.
What are variables, expressions, and equations?
Khan Academy
Language of algebra before using equation solvers.
Watch on YouTubeFinding mean, median, and mode
Khan Academy
Descriptive stats used across statistics tools.
Watch on YouTube
- Elementary Algebra 2e
OpenStax
Free algebra textbook for equations and polynomials.
- Order of Operations
Math is Fun
PEMDAS/BODMAS when expression tools surprise you.