Function Composition

When you see something like f(g(x))f(g(x)) or (fg)x(f \circ g) x, you have function composition.

The idea behind function composition is that we start with two separate functions, like f(x)=x+5f(x) = x+5 and g(x)=x2g(x) = x^2. Then, one function acts as the input for another function.

So, see how f(x)=x+5f(x) = x+5 has input xx? When we have a composition like f(g(x))f(g(x)), the input becomes g(x)g(x). This means we need to replace every xx with g(x)g(x).

It's like how cute Sonic replaced creepy Sonic in every scene of the movie after the trailer dropped.

Similarly, we need to replace every xx with g(x)g(x). Try it out! Enter in two functions and see what the composition looks like:

f(x)=f(x) =
g(x)=g(x) =
  1. We start by replacing every xx you see with g(x)g(x)

  2. Since the function you entered for f(x)f(x) doesn't have any xx's in it, there's nothing to replace on the right side, so we can just finish our calculation and be done!

  3. Then, replace every g(x)g(x) on the right side with the function you entered for g(x)g(x).

  4. Since the function you entered for g(x)g(x) doesn't have any xx's in it, we can just finish our calculation, and we're done!

And that's function composition! Now, let's plug in a value for xx.

Pick a number:

There seems to be an issue with one of your functions. Make sure you have valid numbers and variables - no dollar signs, percents, or any other non-math symbols.

  1. This value gets plugged in for every xx we see. So, we get:


  2. We can first simplify if possible, and then replace each blue part we see with the result.

  3. Then, we just do our final calculation and we're done!