The function composition and inverse explorer lets you type two functions, f(x) and g(x), and see what happens when you put one inside the other. It also tests whether f or g has an inverse on a domain you choose.
It shows the working in steps, then a table and a graph.
How do you use it?
- Type f(x) = and g(x) =. Use numbers, x, + − × ÷ ^, brackets, sqrt( ) and abs( ). For example, 2x+1 or (x-1)^2.
- Enter an input value x to trace through both functions.
- Enter a domain from and to value. The “from” value must be smaller.
- Under “Check the inverse of”, choose f or g.
- Enter a y value if you want the inverse evaluated there.
- Press Show working. Press Reset to return to the sample.
How do you read the result?
Composition at x shows two lines: f(g(x)) and g(f(x)). Each one is split into inner step and outer step, for example “first g(3) = 9, then f(9) = 19”.
The input-output table lists x, g(x), f(g(x)), f(x) and g(f(x)) across your domain. The graph plots both compositions so you can see where they agree or differ.
The inverse check says whether the chosen function is one-to-one on your domain in the sampled test. If it is, an inverse exists on that domain. If it is not, the tool says two inputs give one output and suggests that restricting the domain may help. For a linear function it also shows the inverse by solving for x.
Example walk-through
The sample is f(x) = 2x + 1 and g(x) = x², with x = 3.
- f(g(3)): first g(3) = 9, then f(9) = 2 × 9 + 1 = 19.
- g(f(3)): first f(3) = 7, then g(7) = 49.
The order matters: 19 and 49 are far apart. In general, f(g(x)) = 2x² + 1 and g(f(x)) = (2x + 1)².
Try x = 0. Both give 1. The tool notes that this is a coincidence of the input, not a rule. The two compositions also agree at x = −2, where both give 9.
For the inverse, choose f and set y = 7. The function is linear, so the tool solves y = 2x + 1 for x and gets x = (7 − 1) ÷ 2 = 3, which matches f(3) = 7.
Now choose g on the default domain of −3 to 3. The tool reports that g is not one-to-one, because g(−2) and g(2) are both 4. Change the domain to 0 to 3 and run again. Now g is always increasing, so an inverse exists on that domain.
What are the assumptions and limits?
- Expressions are read by an allow-listed parser. No arbitrary code is run.
- The inverse check is numerical, based on sampled points, and is not a proof.
- Not every function has a global inverse. State the domain whenever you claim one.
- Division by zero and square roots of negative numbers are reported as undefined instead of guessed.
- The graph only covers the domain you choose.
Which lessons explain the ideas behind it?
- Evaluate a function with negative inputs is the place to start for function notation.
- Trace an input through a composite function builds the inner-then-outer habit.
- Form a composite function in the correct order covers writing the composite as an expression.
- Find an inverse and check its domain explains the inverse check.
- Explain a many-to-one mapping that has no unrestricted inverse covers the x² case.
- I ignore function-domain restrictions helps if domains are where marks go missing.
The wider topics are functions and mappings and functions and restrictions. For a teacher to check your reasoning, see online one-to-one Additional Mathematics tuition. Other tools are in the learning tools directory.