📱

Get Our Mobile App

Take your business learning on the go!

Download on the App StoreGet it on Google Play

Functions (Part III)

Khan Academy9:15

Transcription

Let's get going with more examples of function problems, and hopefully, as we keep doing this, you're going to get the idea of how all this stuff works. So let's do another problem. I'll use green this time. Let me clear everything. So I'll show you--I showed you that 1, you could define a function as just kind of a standard algebraic expression; you could also do it a kind of if number is odd, this is what you do, if a number is this, is what you do. You could also define a function visually.

Let's say--let me draw a graph, and I'll use the line tool so it's a reasonably neat graph--that's the x-axis there. That's pretty good. And let's draw the f of x-axis, or you might be used to calling that the y-axis, but--OK. I almost had it vertical, but let's see. Let's draw a few slashes here. And a couple here, like this. Sorry if you're getting bored while I draw this graph. I should really have some type of tool so that the graphs just show up. Let me draw a--let's say that--let me draw this function. So this is what? This is 1, 2, 3, 4, 5, this is negative 5, this is 5, this is 5, this is negative 5. And this is x-axis, and this is--we'll call this the f of x-axis.

Now that might not seem obvious to you at first, but all this is saying is let's say when x is equal to negative 5, this function--I'm creating a function definition--let's say it equals 2, that's negative 1, that stays the same, that stays the same, then it goes to here, and then it goes to here, to here, and then--let's see. I hope I'm not boring you. And it just keeps moving up. Let me see, what would this look like--this would look like this. So if I--you might think I'm doing something very strange right now, but just bear with me while I draw this. I hope I don't mess up too much. And, see, one like that. See one like that. So we're like, Sal, this is a very strange-looking graph. And it is. But what this is, is this is a function definition. This tells you whenever I input an x, at least for the x's that we can see on the graph, this graph tells me what f of x equals. So if x is equal to negative 5, f of x would equal plus 2. And we could draw a couple of examples. f of 0, well we go to 0 on the x-axis, and we say f of 0 is equal to 0. f of 1 is equal to--well, we go to x equal to 1, and we just see where the chart is, well, it equals negative 1. I think you get the idea. This isn't too difficult, but this is a function definition. So we've defined this graph right here as f of x.

So if that graph--that's the graph of f of x, and let's say that we define g of x is equal to f of x--let's say it's equal to f of x squared minus f of x. And let's say that h of x is equal to 3 minus x. So what if I were to ask you, what is h of g of negative 1? So just like we did in the previous problems, first we'll say, well, let's try to figure out what g of negative 1 is, and then we can substitute that into h of x. So g of negative 1 is equal to--and this is how I do it. There's no trick to it. Wherever you see the x, you just substitute it with the number that you're saying is now the value for x. So you say, well, that's equal to f of negative 1 squared minus f of negative 1. All I did is at g of negative 1, I just substituted it wherever I saw an x. Well what's f of negative 1? Well, when x is equal to negative 1, f of x is equal to 1. So f of negative 1--let's write that, f of negative 1 is equal to 1. So g of negative 1 is equal to--well, that's just 1 squared minus 1, well that equals 0. Because f of negative 1 is 1, so it's 1 squared minus 1 that equals 1 minus 1, 0. So g of negative 1 is 0, so this is the same thing as h of 0. Because g of negative 1, we just figured out is 0. h of 0, we just take that 0 and substitute it here, so it's 3 minus 0, so that just equals 3. And we solved the problem.

Let's do another example, and I don't want to erase my graph since I took four minutes to actually draw it, let me erase what we just did here. And what you might want to do after you watch it the first time--and this isn't true just of this video, actually of all the videos--but especially the functions, after watching it once, you might want to rewatch it and pause it right after I give you the problem and try to do it yourself, and then see--and if you get stuck, you can play it, or if you get an answer, just you can play the video and make sure that we did the same way. Let's see. I'm going to create another definition for g of x this time. Let's say that g of x--oh whoops, I was trying to write in black--let's say that g of x is equal to f of x squared plus f of x plus 2. So now, in this case, what is g of--let's pick a random number--what is g of minus--no, let's pick a, let's say--what is g of minus 2? After we try and pick a number that we could find an actual solution for. Well g of minus 2, wherever we see the x, x is not going to be minus 2. That is equal to f of minus 2 squared plus f of minus 2 plus 2. All we did is wherever we saw an x, we substituted it, minus 2 there. And let's simplify that. Well, f of minus 2 squared, we know what minus 2 squared is, that's the same thing as f of 4, plus f of minus 2 plus 2. That's 0. Plus f of 0. And now we just figure out what f of 4 and f of 0 is. Well, f of 4, we go where x equals 4, it's right here, and when x equals 4, f of 4 is equal to 2. So this is equal to 2 plus f of 0. And just as a reminder, this is the definition of f. We didn't define it in terms of an algebraic expression; we defined it in terms of an actual visual graph. So what's f of 0? f of 0 is 0. When x is equal to 0--f of 0 is 0 so that's 2 plus 0--so g of negative 2 is equal to 2. An interesting thing, you might want to make problems like this for yourself and keep experimenting with different types of functions, and a very interesting thing would actually be to graph g of x, and actually that's a good idea, I think. I think maybe we'll do that in the future modules to kind of play with functions and actually to try graph the functions and see how they turn out. I will--I don't know if I have enough time--actually, I'm going to wait until the next lecture to do a couple more examples. I want to do as many examples on the functions as I can with you, because I think as you keep watching and watching the function problems and seeing more and more variations on functions, you'll see both how general of a concept this is, and hopefully you'll get an idea of how the functions actually work. Well, I'll see you in the next lecture. Have fun.