Start by plugging one function into another one
We start with the outside function, f: 4 times something - 1, but everywhere that we would normally have put an x, we now substitute in the function g(x). So instead of 4x - 1, or 4w- 1, or 4 :) - 1, we have 4(g(x)) - 1. But since we know that g(x) is just 3x^2, we can substitute that in as well, which makes f(g(x)) equal to 4(3x^2) - 1. Simplifying again gives us our final answer as 12x^2 - 1.
And that's it! But composing functions can be difficult because seeing all those letters - f and g and x - can be daunting. Even when you get that part, it can be easy to do the problem backwards and substitute the functions into each other the wrong way. So, let's look at an example or two, and see if we can address those two common mistakes and prevent them from happening to you.
Example #1
Let's set up some new functions - maybe r(x) = -x + 1 and s(x) = 2x + 5 - and run through the different ways we could compose them.
How about r(s(x))? Well, r is the outside function, so we start with that: negative something plus 1. But instead of an x, we're substituting in s(x). That turns what we have, -x + 1, into -(2x + 5) + 1. Again, distributing and simplifying gives us r(s(x)) = -2x- 4.
How about the other way: s(r(x))? This time the outside function is s, which means we'll start with 2x + 5, but then substitute the r function where the x used to be. That gives us 2(-x + 1) + 5, and our simplified answer is -2x + 7.
Notice that we get different answers when we compose the functions in different directions. This means that you've got to be careful to not do them in the wrong way. I limit my mistakes by always starting by writing down the outside function, and only then do I think about the inside one.
Limit mistakes by writing down the outside function first, then move on to the inside one
Example #2
There are a few other ways to make these problems slightly more complex. One of those is to compose a function with itself. Maybe r(r(x)): r is the outside function, so we start with -x + 1, but then r is the inside function as well, so where we saw the x, we put another -x + 1. That gives us this: -(-x + 1) + 1, which simplifies down to just plain x.
We can also evaluate a composition of functions at a specific value - maybe like s(s(3)). We start with the sfunction, 2x + 5, substitute in another s function, 2(2x+ 5) + 5, and then substitute a 3 into that (where the x used to be), giving us 2(2(3) + 5) + 5. Now, instead of just simplifying, we multiply and add it out. 2 times 3 is 6 plus 5 is 11 times 2 is 22 plus 5 is 27. So, s(s(3)) is just 27!
Lesson Summary
Hopefully, this has helped to remove some of the confusing nature of compositions of functions, and show it's simply another way of plugging things into equations. Let's quickly review the highlights.
We can substitute anything we want into a function - variables, shapes, numbers and even other functions!
That's what it means to compose functions - plugging one function into another.
When doing so, begin with the outside function and work your way inside by changing the x into whatever new function you are asked to substitute in.
When evaluating a composition of functions at a specific numeric value, do the same process, but then plug that number in where the x used to be.