If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

# Intro to composing functions

CCSS.Math:

## Video transcript

so we have three different function definitions here this is f of X in blue here we map between different values of T and what G of T would be so you could view this as a definition of G of T and here we map from X to H of X so for example when X is equal to 3 H of X is equal to 0 when X is equal to 1 H of X is equal to 2 and actually let me number this 1 2 3 just like that now what I want to do in this video is introduce you to the idea of composing functions now what does it mean to compose functions well that means to build up a function by composing one function of other functions or or I guess you can think of nesting them what do I mean by that well let's think about what it means to evaluate what does it mean to evaluate F of not X but we're going to evaluate F of actually let's just start with a little warm-up let's evaluate F of G of G of 2 now what do you think this is going to be and I encourage you to pause this video and think about it on your own well it seems kind of daunting at first if you're not very familiar with the notation but we just have to remember what a function is a function is just a mapping from one set of numbers to another so for example when we're saying G of 2 that means take the number 2 input it into the function G and then you're going to get an output which we are going to call G of 2 G of 2 now we're going to use that output G of 2 and then input it into the function f so we're going to input it into the function f we're going to input it into the function f and what we're going to get is f of the thing that we inputted F of G of 2 F of G of 2 so let's just take the step by step what is G of 2 well when T is equal to 2 G of 2 is negative 3 so G of 2 is negative 3 and so when I put negative 3 to F what am I going to get well I'm going to get negative three squared negative three squared minus one which is nine minus one which is going to be equal to eight so this right over here is equal to eight f of G of 2 is going to be equal to eight now what would using that same exact logic what would F of f of H of two be F of H of two be and once again I encourage you to pause the video and think about it on your own well let's think about it this way instead of doing it using these kind of this little diagram here everywhere you see the input is X so whatever you do at the end whatever the input is U squared and minus 1 here the input is H of 2 and so we're going to take the input which is H of 2 and we're going to square it and we're going to square it and then we're going to subtract and we're going to subtract 1 so f of H of 2 is H of 2 squared minus 1 now what is H of 2 when X is equal to 2 H of 2 is 1 so H of 2 is 1 so since H of 2 is equal to 1 this simplifies to 1 squared minus 1 well that's just going to be 1 minus 1 which is equal which is equal to 0 and we could have done it with the the diagram way we could have said hey we're going to input 2 into H and put 2 into H if you input 2 into H you get 1 so that is H of 2 right over here so that is H of 2 and then we're going to input that into F and then we're going to input that into F which is going to give us F of 1 F of 1 is 1 squared minus 1 which is 0 which is 0 so this right over here is f of H of 2 H of 2 is the input into F so the output is going to be F of our input of H of two now it can go even further let's do a composite let's compose three of these let's compose three of these functions together so let's take I don't know let's take G of let's take I'm doing this on the fly a little bit so I hope it's a good result G of and let me switch the order G of F of G of F of F of 2 and let me just think about this for one second so that's going to be G of F of 2 and let's take H of G of F of 2 just for fun H of so now we're really doing a triple composition so there's a bunch of ways we could do this one ways to just try to evaluate what is what is f of 2 well F of 2 is going to be equal to 2 squared minus 1 it's going to be 4 minus 1 or 3 so this is going to be equal to 3 now what is G of 3 G of 3 is when T is equal to 3 G of 3 is 4 so G of 3 this whole thing this whole thing is 4 F of 2 is 3 G of 3 is 4 what is H of 4 well we can just look back to our original graph here when X is 4 H of 4 is negative 1 so H of G of f of 2 is just equal to is just equal to negative 1 so hopefully this makes you somewhat familiar with how to evaluate the composition of functions