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

Adding functions

Given that f(x)=9-x^2 and g(x)=5x^2+2x+1, Sal finds (f+g)(x). Created by Sal Khan and Monterey Institute for Technology and Education.

Want to join the conversation?

  • blobby green style avatar for user David Huffman
    I'm 72 and trying to learn again math that I studied over 50 years ago and hence I am somewhat challenged. My question: When you speak of functions such as f(x) or g(x) and then define them as you do on the videos as, for example f(x)=9+x2 or g(x) +5x2 + 2x +1, where do these equations come from? Are they just stated or do they come from a real problem? Thanks.
    (282 votes)
    Default Khan Academy avatar avatar for user
  • male robot donald style avatar for user Mihir Solanki
    towards the end at .. Sal says "There are two constants i.e. 0 degree terms"
    Is he referring to the power of 9 and -1 ?
    If so .. 9 to the power of 0 i.e. [9^0] would be equalt to 1 right??
    as anything to the power 0 is one...
    (10 votes)
    Default Khan Academy avatar avatar for user
  • piceratops ultimate style avatar for user Liam Nickell
    Couldn't you have simplified it down further to 2(2x^2 + x + 5)?
    (4 votes)
    Default Khan Academy avatar avatar for user
    • piceratops ultimate style avatar for user Just Keith
      Yes, but there is no particular reason to do so. As you move into higher levels of math, the emphasis is less on "simplest form" and more on a practical or useful form. With polynomials, you often see them left in standard form. Factoring is typically done to the extent there is a reason to do so.
      (11 votes)
  • blobby green style avatar for user Apsara
    Trying to solve in/out box math problem. What function will work for this: f(x)=y function must work for all when X =1 and y=1; X=2 and y=7; X=3 and y=19; and x=4 and y=37.
    (5 votes)
    Default Khan Academy avatar avatar for user
    • piceratops ultimate style avatar for user Brice Marnier
      Beware : A finite number of points is not enough to define a unique function. There is an infinite number of functions that could fit these four points, but most of them would give you "wrong" values on any other values. The best way to find the correct one, is by algebra and calculus based on careful problem analysis; but this is not always possible...
      However, we can find a quite simple function that would work on these. Let's rewrite:
      1 |--> 1
      2 |--> 7 = 1.2.3 + 1
      3 |--> 19 = 2.3.3 + 1
      4 |--> 37 = 3.4.3 + 1
      Looks like there is a pattern, isn't it ?
      x |--> (x-1).(x).(3) +1
      or f(x)=3x(x-1)+1
      This is a rare case where guessing works... Otherwise, you would have to use a regression algorithm to fit the values against some function family (linear, quadratics, exponentials...). In this case, a linear regression would give pretty bad results, but a quadratics should give you the same answer, yet in expanded form:
      f(x)=3x²+3x+1.
      A graph (to scale) can be quite helpful to guess the appropriate function family.
      Finally, you should give a try at oeis.org, and search for "1,7,19,37" : there is more than 80 registered sequences that fit these few numbers, amongst which is the sequence of hexagonal numbers
      a003215(n)=3*n*(n+1)+1
      which is very similar to our function !
      Have fun !
      (6 votes)
  • blobby green style avatar for user Shayla
    is this tenth or ninth grade math, you see im using khan for homeschooling but I don't know what is what. and also would you mind giving me some adding function practice problems? that would be so helpful. thanks! :)
    (3 votes)
    Default Khan Academy avatar avatar for user
  • leaf yellow style avatar for user Joshua
    Can (f+g)(x) be written as f+g(x)?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • male robot hal style avatar for user Chris Burns
    4x^2+2x+10 could simplify to 2(2x^2+x+5), is there a reason why he did not do that? Just curious...
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Nifemi Lawal
    Would the same rule apply to a subtracting function whereby the equation is like that above aside for subtraction signs in place of the addition?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user gleesonashleigh
    But what if you are adding a quadratic and a cubic function? How do you add them when they are different powers?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user nithya
    Hi. I tried doing this problem and in the end when I got (f+g)(x)= 4x^2+2x+10 I simplified it further by dividing the equation by 2 i.e., (f+g)(x)= 2x^2+x+5. Will this be the same as the former equation or is it wrong to simplify a function like this? I'm confused.
    (1 vote)
    Default Khan Academy avatar avatar for user

Video transcript

f of x is equal to 9 minus x. Actually, it should be 9 minus x squared. And g of x is equal to 5x squared plus 2x plus 1. And then they say find f plus g of x. And this looks a little bit bizarre. What kind of notation is this? And that's really the core of this problem is just to realize that when someone writes f plus g in parentheses like this of x this is just notation for-- so f plus g of x, I just rewrote it. This is the same thing. This is just a kind of shorthand notation for f of x plus g of x. You could view f plus g as a new function that's created by adding the other two functions. But when you view it like this-- so this is really what we have to find. Then, you just have to add these two functions. So f of x, they've given the definition right over there, is 9 minus x squared. And g of x, they've given the definition right over here, is 5x squared plus 2x plus 1. So when you add f of x to g of x, this is going to be equal to-- and I'm just rewriting a lot of things just to make it clear. The f of x part is 9 minus x squared. And then you have the plus. I'll do that in yellow. Plus the g of x part, which is 5x squared plus 2x plus 1. And now we can just simplify this a little bit. We can say-- let me just get rid of the parentheses. I'll just rewrite it. So this is equal to 9 minus x squared plus-- since this is a positive, we don't have to worry about the parentheses. So plus 5x squared plus 2x plus 1. And then we have two x squared terms or second degree terms. We have 5x squared. And then we have negative x squared. 5x squared minus x squared is 4x squared. So you get 4x squared when you combine these two terms. You only have one first degree term 2x there, so plus 2x. And then you have two constant terms, or 0 degree terms. So you have the 9 and you have the 1. And 9 plus 1 gets us to 10. So we're done. f plus g of x is equal to 4x squared plus 2x plus 10. Notice this is a new function that's created by summing the function definitions of f and g.