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

Evaluating composite functions (advanced)

Given that h(x)=3x and g(t)=-2t-2-h(t), Sal finds h(g(8)). Created by Sal Khan.

Want to join the conversation?

Video transcript

We are told that h of x is equal to 3x. g of t is equal to negative 2t minus 2 minus h of t. f of n is equal to negative 5n squared plus h of n. So we have three function definitions, and two of these function definitions are actually defined in terms of another function-- in particular, in terms of the function h. And then we're asked to calculate, what is h of g of 8? And this can be very daunting, but we just have to remember that all a function is is something that takes an input and gives you an output for it. And this somewhat convoluted looking statement is another way of saying, look, we are going to take the number 8, and we are going to input it into the function g. And then that is going to produce g of 8. And then we're going to take whatever value that is and input that into the function h. So we're going to take this whole thing, and then we're going to input that into the function h. And what we will have will be h of what we inputted, h of g of 8. So let's just do it one step at a time. Let's figure out what g of 8 is. And I'm going to color code it, so we can keep track of things. g of 8 is equal to-- well, g of t, we have our definition here. So our input now, 8 is going to be our t, so our input is 8. So every place where we see a t in this function definition, we replace it with an 8. So it's going to be negative 2 times 8 minus 2 minus-- and this might be a little daunting, but let's just replace this t with an 8 and then see if we can make sense of it. h minus-- and let me do it in the right color-- minus 2 minus h of 8. Notice, to evaluate g of 8, all we did is, everywhere we saw a t, we replaced it with the input 8. Now let's see if we can calculate this. This is going to be equal to negative 2 times 8 is negative 16. Minus 2 is negative 18. Let me do that the same. So this is going to be equals negative 18 minus-- what is h of 8 going to be equal to? So let's do that over here. So h of 8-- this thing, h of 8. Now we go to the definition of h. Don't worry about later we're going to input all this business into h again. Just let's worry about it one step at a time. We need to calculate h of 8. So h of 8 is just going to be-- well, every time we see an x, we replace it with an 8-- it's going to be 3 times 8, which is equal to 24. So this value right over here is 24. We are subtracting it, so we have minus 24. Negative 18 minus 24 is what? That's negative 42. So all of this business is going to be equal to-- did I do that right? Yeah-- negative 42. So we figured out what g of 8 is. It is negative 42. So this right over here is negative 42. And now we can input negative 42 into h. Let me do it right over here. h of negative 42-- remember, negative 42 is the same thing as g of 8. So this is h of g of 8 is the same thing as h of negative 42. Let me do that in the same color. This is going to be equal to 3 times negative 42, which is equal to-- this is negative 126. And we are done. So it seemed convoluted at first, but if you just keep track of what's our input, what's our output, and really just evaluate the functions, it should hopefully be reasonably straightforward.