Main content

## Algebra (all 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?

- 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.(279 votes)
- Wow, you're an inspiration to me sir. Keep it up! :)(11 votes)

- towards the end at2:10.. 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)- 0 degree terms means the variable is raised to 0.(16 votes)

- Couldn't you have simplified it down further to 2(2x^2 + x + 5)?(4 votes)
- 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)

- 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)
- 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)

- 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)
- Algebra II is tenth Grade.

Here's a link to a nice program which you can test your math skills: https://www.khanacademy.org/computer-programming/mathemania-game-html/6608536766545920

EDIT: It is tenth for advanced students, but is also taught in 11th grade.(2 votes)

- Can (f+g)(x) be written as f+g(x)?(2 votes)
- No never. Jacob

(f+g)(x) it means f(x)+g(x)

they shared common "x" variable..

so, you can't write (f+g)(x) as a f+g(x)..

i hope this will helps you!

Thank you!🙂🙂.(1 vote)

- 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)
- He could've done it, but the question didn't ask for it. It's not mandatory for you to simplify your equation so he just did what the question asked and left it.

I hope that answered your question.(3 votes)

- 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)
- Yes, (f - g)(x) is the same as f(x) - g(x). In this case it would be
`(9 - x^2) - (5x^2 + 2x + 1)`

= 9 - x^2 - 5x^2 - 2x - 1

= -6x^2 - 2x + 8(2 votes)

- But what if you are adding a quadratic and a cubic function? How do you add them when they are different powers?(2 votes)
- Cubic and quadratic expressions do have
*some*powers in common, namely x², x, and the constant term. Assuming both are polynomial function of x, of course. So those can be added.

(Ax³ + Bx² + Cx + D) + (Px² + Qx + R) = Ax³ + (B+P)x² + (C+Q)x + (D + R)(2 votes)

- 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)
- Its wrong. Your new equation has the same zeros (that is, if you put in values for x so that the whole thing is equal to 0), and it will look the same, but it is stretched out (by the factor that you divided by).

The zeros are the same becuase 0 * 2 ist still 0, as is 0/2.(3 votes)

## 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.