Skip to content
IGCSE·Tuition

Tools

Function composition and inverse explorer

Composite functions look like a pair of brackets until you have to decide which function goes first.

On this page
  1. How do you use it?
  2. How do you read the result?
  3. Example walk-through
  4. What are the assumptions and limits?
  5. Which lessons explain the ideas behind it?

Everything you enter stays on this device. Nothing is sent to us.

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?

  1. Type f(x) = and g(x) =. Use numbers, x, + − × ÷ ^, brackets, sqrt( ) and abs( ). For example, 2x+1 or (x-1)^2.
  2. Enter an input value x to trace through both functions.
  3. Enter a domain from and to value. The “from” value must be smaller.
  4. Under “Check the inverse of”, choose f or g.
  5. Enter a y value if you want the inverse evaluated there.
  6. 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?

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.

Questions people ask

Why are f(g(x)) and g(f(x)) usually different?

Composition applies the inner function first. f(g(x)) means do g, then f. g(f(x)) means do f, then g. Changing the order changes which operation acts on the original input, so the results differ in general. A few special inputs can match by coincidence, which the tool points out.

What does it mean for a function to be one-to-one on a domain?

It means each output comes from only one input in that domain. On a graph, a horizontal line never cuts it twice. Only a one-to-one function has an inverse on that domain. For example, x² is not one-to-one on −3 to 3, but it is on 0 to 3.

Does the tool prove that an inverse exists?

No. It checks sampled points across the domain and reports whether the values always rise or always fall. That is a numerical check, not a proof. In your own answer, justify an inverse by showing the function is one-to-one or by solving for x and stating the domain.

What can I type in the function boxes?

Numbers, x, the operations + − × ÷ and ^, brackets, sqrt( ) and abs( ). An example is 2x+1 or (x−1)^2. The tool reads these with a fixed safe parser and does not run arbitrary code. Anything else gives a message explaining what it could not read.

Updated:

Your next step

If the order of composition or the domain of an inverse keeps catching you out, a one-to-one teacher can work through your own questions in a paid one-hour trial.

Paid one-hour trial at your assigned teacher’s confirmed rate, starting from RM80. Other fees, schedules and ongoing arrangements are confirmed directly with your teacher after the trial class.

9,000+ students helped through our service