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

Worked example: evaluating expressions with function notation

Evaluating -2⋅f(-6)+g(1) given the graphs of f and g. Created by Sal Khan.

Want to join the conversation?

  • leaf green style avatar for user Abdo Reda
    I don't know where is the best place to ask this question , and I am sorry for any bad English.

    Can i have a function inside it self, is there a way to solve this or am I making this up ?
    for example f(x)=f(x)+2+x; if I replace it with f(2) would there be a way to solve this ?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • leaf green style avatar for user kubleeka
      Your example doesn't really involve a function. Notice that we can subtract f(x) from both sides to get 0=2+x.

      Now subtract 2 from both sides to get x= -2. So we just have an equation of one variable that we can solve.

      What we can do is define functions recursively. For example, we can define a function over the whole numbers:
      f(0)=1
      f(n)=n*f(n-1)

      So if we want to find f(3), this is 3•f(2)=3•(2•f(1))=3•2•(1•f(0))=3•2•1•1=6.

      If you meant something else, comment back.
      (14 votes)
  • mr pants purple style avatar for user Gilbert
    Around wouldn't it be -14+-5=-9 instead of -14+-5=-19?
    (4 votes)
    Default Khan Academy avatar avatar for user
  • winston default style avatar for user Caroline
    how old do you have to be to do this stuff?
    (0 votes)
    Default Khan Academy avatar avatar for user
  • leaf green style avatar for user yig646
    is there a reason that sal always uses the x as the input and receives a y value in return and not the other way around
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user sangshingala
    in video why we are not considering g(x)=+8 rather than why are considering g(x)=-5 only.....
    (2 votes)
    Default Khan Academy avatar avatar for user
    • hopper happy style avatar for user eddiemin
      What you are considering is f(1) = 8, not g(1) = 8. f(x) is the bolded graph while g(x) is the dotted graph. Since we are finding g(1), we find the corresponding y value of x = 1, which is -5. The functions are different, so you do not consider the other part when it only requests for one function.
      (2 votes)
  • leaf green style avatar for user donovan.vanness
    Why can I never remember this?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • aqualine sapling style avatar for user c8kboy
    How can we apply this information in real life? I mean, where do we see these types of graphs in our day-to-day lives?

    I don't get how this would be useful.
    (2 votes)
    Default Khan Academy avatar avatar for user
    • hopper cool style avatar for user KDP28
      We Don't Learn Only Things That We can use in life but we also learn things to enrich our minds so that we can stretch them and learn how to problem solve and become independent instead of dependent! Do You know what I Mean?
      (8 votes)
  • sneak peak purple style avatar for user Avani Mohindra
    at , why does Sal say g of 1 = -5, when there is also 7? Which one is it? Thanks
    (2 votes)
    Default Khan Academy avatar avatar for user
    • stelly blue style avatar for user Kim Seidel
      No, there isn't also a 7.
      g(1) means you need to find the output value of g(x) when x=1. g(x) is the red dashed line. When x=1, the y=value that is on the red dashed line is -5.

      I don't see where you get the 7. The other line is f(x) and f(1)=8, not 7.
      (1 vote)
  • mr pants teal style avatar for user Susan  Ortega
    How do you find the domain and range of the following question: Sal is driving 70mph. What is a reasonable domain and range if the total distance from Houston to Miami is 980 miles.
    (2 votes)
    Default Khan Academy avatar avatar for user
  • leaf green style avatar for user Costanza Mancini
    Every point of the two lines f(x) and g(x) have both coordinates (one on the x axis and one on the y one) so why do we call the entire line just by indicating the x ?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • stelly blue style avatar for user Kim Seidel
      "x" in the input to the function. The output of the function is "y". So, you input "x" and you calculate "y" giving you a point on the line.

      Where ever you see the "f(x)" or "g(x)", that is the same as "y"
      For example: f(x) = 3x + 1 is the same as having y = 3x + 1.
      So, if x = 1: y = 3(1) + 1 = 4. This gives you the point (1, 4)
      If x = -2: y = 3(-2) + 1 = -5 . This gives you the point (-2, -5)

      Hope this helps.
      (2 votes)

Video transcript

We're asked to evaluate negative 2 times f of negative 6 plus g of 1. And they've defined, at least graphically, f of x and g of x here below. So let's see how we can evaluate this. Well, to do this, we first have to figure out what f of negative 6 is. So our input into our function is negative 6. And we'll assume that's along the horizontal axis. So our input is negative 6. And based on our function definition, f of negative 6 is 7. So this thing. Let me write this down. f of negative 6 is equal to 7. And what is g of 1? Well, once again, here's our input axis. And then the function says that g of 1, which is right over there, is negative 5. g of 1 is equal to negative 5. So this statement simplifies to negative 2 times f of negative 6, which is 7. So times 7 plus g of 1, which is negative 5. So plus negative 5, which simplifies to-- let's see. Negative 2 times 7 is negative 14 plus negative 5, which is negative 19. And we are done.