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

Sal evaluates (h⚬g)(-6) for g(x)=x²+5x-3 and h(y)=3(y-1)²-5.

Want to join the conversation?

  • duskpin ultimate style avatar for user Stopmotiongeek
    I'm confused when it comes to how to solve questions involving functions that look something like: "If f(x) = -2x + 5, what is f(-3x) equal to?". For reference this is a problem on the 4th SAT practice test here on Khan Academy that I got right, only I don't understand the real logic behind it. If anyone could give me some intuition I would be thankful manyfold :)
    (2 votes)
    Default Khan Academy avatar avatar for user
    • hopper happy style avatar for user Silas and i like π
      Hallo
      Well first of all we can look at this problem and say, well what do we see in common with f(x) and f(-3x)? All you are doing is substituting the x and the -3x. You have to do the same thing to both sides of the equation so just put a -3x for every x in -2x + 5. Once you do this you will get: -2x(-3x)+5. Then it's just simple multiplication to get 6x^2 + 5. So, f(-3x) = 6x^2 + 5
      Hope that helped,
      Silas
      (19 votes)
  • male robot donald style avatar for user Damon Laboissoniere
    can someone help me? I just watched this video and when i went to the activity i lost all thought. Anyone have tips on how to stop that?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user gp745649
    What would be the next step for g(f(0.25)?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • duskpin ultimate style avatar for user Sara Beth
    Why did he continue to solve the problem after he got the answer of 3?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • leaf green style avatar for user Bhargav Tata
      He continued to solve the problem after he got the answer of 3 because in a composite function problem, there are two steps. The first step is to find the answer of the function within the function. The second step is to input the answer of the function of the function in to the function on the outside. This is the best I can explain it, and I hope it helped!
      (10 votes)
  • mr pink red style avatar for user kristen pace
    im confused about questions where it says something like f(g(x)) and then says the function equation thing. Could somebody explain this to me.
    Thank You
    (4 votes)
    Default Khan Academy avatar avatar for user
    • duskpin seedling style avatar for user Rhea Meka
      That is the expression of the function first you find g(x) it will give you answer and let’s that answer is y then you do f(y) then you will get your final outcome or your final answer. I hope this answers your question
      (3 votes)
  • starky ultimate style avatar for user akshath prasad
    is there an order in which one you have to substitute first
    (3 votes)
    Default Khan Academy avatar avatar for user
  • duskpin tree style avatar for user Shadow Uchiha%
    I'm confused on how to solve a problem g(b)=5b-9
    and h(b)=(b-1)^2. If anyone could give me some intuition I would be thankful manyfold :)
    (3 votes)
    Default Khan Academy avatar avatar for user
  • starky seed style avatar for user Naomi Tijerina
    I am really confused and do not know where to start Please Help!!
    ~Naomi
    (2 votes)
    Default Khan Academy avatar avatar for user
  • starky ultimate style avatar for user Ethan Compton
    At what does it mean if h is "of" g? I have never heard the "of" term used before.
    (2 votes)
    Default Khan Academy avatar avatar for user
  • aqualine tree style avatar for user brownhairedlucas
    why/when would you use this
    (2 votes)
    Default Khan Academy avatar avatar for user
    • stelly blue style avatar for user Kim Seidel
      Computer programming breaks algorithms down into reusable functions / modules.
      They would use this concept of composite functions where the output of one function becomes the input to another function.

      A real life example would be in calculating what you pay at a store.
      Let's say you buy a sweater and it is on sale for 25% off. And, you live in a state where they apply income tax to your purchase. You could have 2 functions:
      1) Calculate the discounted price: Input = original price; output = discounted price
      2) Apply tax: Input = discounted price; output = price with tax
      (2 votes)

Video transcript

- [Voiceover] So, we're told that g of x is equal to x squared plus 5 x minus 3 and h of y is equal to 3 times y minus 1 squared, minus 5. And then, we're asked, what is h of g of negative 6? And the way it's written might look a little strange to you. This little circle that we have in between the h and the g, that's our function composition symbol. So, function, function composition, composition, composition symbol. And one way to rewrite this, it might make a little bit more sense. So, this h of g of negative 6. You could rewrite this as, this is going to be the same thing as g of negative 6, and then h of that. So, h of g of negative 6. Notice, I spoke this out the same way that I said this. This is h of g of negative 6. This is h of g of negative 6. I find the second notation far more intuitive, but it's good to become familiar with this function composition notation, this little circle, because you might see that sometime and you shouldn't stress, it's just the same thing as what we have right over here. Now, what is h of g of negative 6? Well, we just have to remind ourselves that this means that we're going to take the number negative 6, we're going to input it into our function g, and then that will output g of negative 6, whatever that number is, we'll figure it out in a second, and then we're going to input that into our function h. We're going to input that into our function h. And then, what we output is going to be h of g of negative six, which is what we want to figure out. h of g of negative 6. So, we just have to do it one step at a time. A lot of times, when you first start looking at these function composition, it seems really convoluted and confusing, but you just have to, I want you to take a breath and take it one step at a time. Well, let's figure out what g of negative 6 is. It's going to evaluate to a number in this case. And then, we input that number into the function h, and then we'll figure out another -- that's going to map to another number. So, g of negative 6. Let's figure that out. g of negative 6 is equal to negative 6 squared, plus 5 times negative 6, minus 3, which is equal to positive 36, minus 30, minus 3. So, that's equal to what? 36 minus 33, which is equal to 3. So, g of negative 6 is equal to 3. g of negative 6 is equal to 3. g of negative 6 is equal to 3. You input negative 6 into g, it outputs 3. And so, h of g of negative 6 has now simplified to just h of 3 because g of negative 6 is 3. So, let's figure out what h of 3 is. h of 3 --. notice, whatever we outputted from g, we're inputting that now into h. So, that's the number 3, so h of 3 is going to be 3 times 3 minus 1, 3 minus 1 squared, minus 5, which is equal to 3 times 2 squared, this is 2 right over here, minus 5, which is equal to 3 times 4 minus 5, which is equal to 12 minus 5, which is equal to 7. And we're done. So, you input negative 6 into g, you get 3. And then, you take that output from g and you put it into h and you get 7. So, this right over here is 7. All of this has come out to be equal to 7. So, h of g of negative 6 is equal to 7. h of g of negative 6 is equal to 7. Input negative 6 into g, take that output and input it into h, and you're gonna get 7.