1 00:00:00,000 --> 00:00:00,970 2 00:00:00,970 --> 00:00:01,219 Let's 3 00:00:01,219 --> 00:00:04,879 get going with more examples of function problems, and 4 00:00:04,879 --> 00:00:07,199 hopefully as we keep doing this, you're going to get 5 00:00:07,200 --> 00:00:08,665 the idea of how all this stuff works. 6 00:00:08,664 --> 00:00:12,739 So let's do another problem. 7 00:00:12,740 --> 00:00:14,720 I'll use green this time. 8 00:00:14,720 --> 00:00:17,580 Let me clear everything. 9 00:00:17,579 --> 00:00:19,649 So I'll show you-- I showed you that 1, you could define a 10 00:00:19,649 --> 00:00:22,919 function as just kind of a standard algebraic expression, 11 00:00:22,920 --> 00:00:25,710 you could also do it a kind of if number is odd, this is what 12 00:00:25,710 --> 00:00:27,980 you do, if a number is this, is what you do. 13 00:00:27,980 --> 00:00:30,030 You could also define a function visually. 14 00:00:30,030 --> 00:00:34,810 Let's say-- let me draw a graph, and I'll use the line 15 00:00:34,810 --> 00:00:40,060 tool so it's a reasonably neat graph-- that's 16 00:00:40,060 --> 00:00:43,480 the x-axis there. 17 00:00:43,479 --> 00:00:44,379 That's pretty good. 18 00:00:44,380 --> 00:00:48,830 And let's draw the f of x-axis, or you might be used to calling 19 00:00:48,829 --> 00:00:54,649 that the y-axis, but-- OK. 20 00:00:54,649 --> 00:00:57,491 I almost had it vertical, but let's see. 21 00:00:57,491 --> 00:00:59,489 Let's draw a few slashes here. 22 00:00:59,490 --> 00:01:03,270 23 00:01:03,270 --> 00:01:05,740 And a couple here, like this. 24 00:01:05,739 --> 00:01:09,969 25 00:01:09,969 --> 00:01:11,760 Sorry if you're getting bored while I draw this graph. 26 00:01:11,760 --> 00:01:13,750 I should really have some type of tool so that the 27 00:01:13,750 --> 00:01:15,409 graphs just show up. 28 00:01:15,409 --> 00:01:21,829 Let me draw a-- let's say that-- let me 29 00:01:21,829 --> 00:01:22,500 draw this function. 30 00:01:22,500 --> 00:01:23,069 So this is what? 31 00:01:23,069 --> 00:01:28,949 This is 1, 2, 3, 4, 5, this is negative 5, this is 5, this 32 00:01:28,950 --> 00:01:31,769 is 5, this is negative 5. 33 00:01:31,769 --> 00:01:38,409 And this is x-axis, and this is-- we'll call 34 00:01:38,409 --> 00:01:39,769 this the f of x-axis. 35 00:01:39,769 --> 00:01:43,459 Now that might not seem obvious to you at first, but all this 36 00:01:43,459 --> 00:01:47,209 is saying is let's say when x is equal to negative 5, this 37 00:01:47,209 --> 00:01:50,449 function-- I'm creating a function definition-- let's say 38 00:01:50,450 --> 00:01:59,436 it equals 2, that's negative 1, that stays the same, that stays 39 00:01:59,436 --> 00:02:10,140 the same, then it goes to here, and then it goes to here, to 40 00:02:10,139 --> 00:02:13,829 here, and then-- let's see. 41 00:02:13,830 --> 00:02:15,936 I hope I'm not boring you. 42 00:02:15,936 --> 00:02:18,450 And it just keeps moving up. 43 00:02:18,449 --> 00:02:19,909 Let me see, what would this look like-- this 44 00:02:19,909 --> 00:02:21,819 would look like this. 45 00:02:21,819 --> 00:02:25,239 So if I-- you might think I'm doing something very strange 46 00:02:25,240 --> 00:02:29,930 right now, but just bear with me while I draw this. 47 00:02:29,930 --> 00:02:32,983 I hope I don't mess up too much. 48 00:02:32,983 --> 00:02:35,640 And, see, one like that. 49 00:02:35,639 --> 00:02:37,219 See one like that. 50 00:02:37,219 --> 00:02:39,629 So we're like, Sal, this is a very strange looking graph. 51 00:02:39,629 --> 00:02:40,569 And it is. 52 00:02:40,569 --> 00:02:42,819 But what this is, is this is a function definition. 53 00:02:42,819 --> 00:02:46,199 This tells you whenever I input an x, at least for the x's that 54 00:02:46,199 --> 00:02:49,659 we can see on the graph, this graph tell me what 55 00:02:49,659 --> 00:02:51,030 f of x equals. 56 00:02:51,030 --> 00:02:56,830 So if x is equal to negative 5, f of x would equal plus 2. 57 00:02:56,830 --> 00:02:58,230 And we could draw a couple of examples. 58 00:02:58,229 --> 00:03:04,549 f of 0, well we go to 0 on the x-axis, and we say 59 00:03:04,550 --> 00:03:08,840 f of 0 is equal to 0. 60 00:03:08,840 --> 00:03:13,979 f of 1 is equal to-- well, we go to x equal to 1, and we 61 00:03:13,979 --> 00:03:17,799 just see where the chart is, well, it equals negative 1. 62 00:03:17,800 --> 00:03:18,620 I think you get the idea. 63 00:03:18,620 --> 00:03:21,990 This isn't too difficult, but this is a function definition. 64 00:03:21,990 --> 00:03:27,960 So we've defined this graph right here as f of x. 65 00:03:27,960 --> 00:03:31,330 So if that graph-- that's the graph of f of x, and let's say 66 00:03:31,330 --> 00:03:41,230 that we define g of x is equal to f of x-- let's say 67 00:03:41,229 --> 00:03:48,619 it's equal to f of x squared minus f of x. 68 00:03:48,620 --> 00:04:03,090 And let's say that h of x is equal to 3 minus x. 69 00:04:03,090 --> 00:04:18,639 So what if I were to ask you, what is h of g of negative 1? 70 00:04:18,639 --> 00:04:21,120 So just like we did in the previous problems, first we'll 71 00:04:21,120 --> 00:04:23,590 say, well, let's try to figure out what g of negative 1 is, 72 00:04:23,589 --> 00:04:27,019 and then we can substitute that into h of x. 73 00:04:27,019 --> 00:04:35,129 So g of negative 1 is equal to-- and this is how I do it. 74 00:04:35,129 --> 00:04:36,389 There's no trick to it. 75 00:04:36,389 --> 00:04:38,360 Wherever you see the x, you just substitute it with the 76 00:04:38,360 --> 00:04:40,939 number that you're saying is now the value for x. 77 00:04:40,939 --> 00:04:47,680 So you say, well, that's equal to f of negative 1 squared 78 00:04:47,680 --> 00:04:51,240 minus f of negative 1. 79 00:04:51,240 --> 00:04:53,203 All I did is at g of negative 1, I just substituted 80 00:04:53,202 --> 00:04:56,049 it wherever I saw an x. 81 00:04:56,050 --> 00:04:58,189 Well what's f of negative 1? 82 00:04:58,189 --> 00:05:01,740 Well, when x is equal to negative 1, f of 83 00:05:01,740 --> 00:05:03,620 x is equal to 1. 84 00:05:03,620 --> 00:05:07,300 So f of negative 1-- let's write that, f of negative 85 00:05:07,300 --> 00:05:09,660 1 is equal to 1. 86 00:05:09,660 --> 00:05:12,040 So g of negative 1 is equal to-- well, that's just 87 00:05:12,040 --> 00:05:16,939 1 squared minus 1, well that equals 0. 88 00:05:16,939 --> 00:05:20,050 Because f of negative 1 is 1, so it's 1 squared minus 89 00:05:20,050 --> 00:05:22,020 1 that equals 1 minus 1. 90 00:05:22,019 --> 00:05:23,500 0. 91 00:05:23,500 --> 00:05:25,939 So g of negative 1 is 0, so this is the 92 00:05:25,939 --> 00:05:29,410 same thing as h of 0. 93 00:05:29,410 --> 00:05:32,070 Because g of negative 1, we just figured out is 0. 94 00:05:32,069 --> 00:05:35,959 h of 0, we just take that 0 and substitute it here, so it's 3 95 00:05:35,959 --> 00:05:38,599 minus 0, so that just equals 3. 96 00:05:38,600 --> 00:05:40,660 And we solved the problem. 97 00:05:40,660 --> 00:05:42,710 Let's do another example, and I don't want to erase my graph 98 00:05:42,709 --> 00:05:47,469 since I took four minutes to actually draw it, let me 99 00:05:47,470 --> 00:05:51,230 erase what we just did here. 100 00:05:51,230 --> 00:05:53,500 And what you might want to do after you watch it the first 101 00:05:53,500 --> 00:05:55,709 time-- and this isn't true just of this video, actually of all 102 00:05:55,709 --> 00:05:58,079 the videos-- but especially the functions, after watching it 103 00:05:58,079 --> 00:06:01,889 once, you might want to rewatch it and pause it right after I 104 00:06:01,889 --> 00:06:04,379 give you the problem and try to do it yourself, and then see-- 105 00:06:04,379 --> 00:06:06,600 and if you get stuck, you can play it, or if you get an 106 00:06:06,600 --> 00:06:09,150 answer, just you can play the video and make sure that 107 00:06:09,149 --> 00:06:11,629 we did the same way. 108 00:06:11,629 --> 00:06:12,204 Let's see. 109 00:06:12,204 --> 00:06:18,370 110 00:06:18,370 --> 00:06:19,750 I'm going to create another definition 111 00:06:19,750 --> 00:06:22,639 for g of x this time. 112 00:06:22,639 --> 00:06:26,564 Let's say that g of x-- oh whoops, I was trying to write 113 00:06:26,564 --> 00:06:38,439 in black-- let's say that g of x is equal to f of x 114 00:06:38,439 --> 00:06:51,000 squared plus f of x plus 2. 115 00:06:51,000 --> 00:06:53,529 116 00:06:53,529 --> 00:07:01,379 So now, in this case, what is g of-- let's pick a random 117 00:07:01,379 --> 00:07:06,319 number-- what is g of minus-- no, let's pick a, let's 118 00:07:06,319 --> 00:07:08,759 say-- what is g of minus 2? 119 00:07:08,759 --> 00:07:10,289 After we try and pick a number that we could find 120 00:07:10,290 --> 00:07:11,819 an actual solution for. 121 00:07:11,819 --> 00:07:16,009 Well g of minus 2, wherever we see the x, x is not 122 00:07:16,009 --> 00:07:17,610 going to be minus 2. 123 00:07:17,610 --> 00:07:25,230 That is equal to f of minus 2 squared plus 124 00:07:25,230 --> 00:07:29,080 f of minus 2 plus 2. 125 00:07:29,079 --> 00:07:31,379 All we did is wherever we saw an x, we substituted 126 00:07:31,379 --> 00:07:33,089 it, minus 2 there. 127 00:07:33,089 --> 00:07:34,119 And let's simplify that. 128 00:07:34,120 --> 00:07:38,110 Well, f of minus 2 squared, we know what minus 2 squared is, 129 00:07:38,110 --> 00:07:45,270 that's the same thing as f of 4, plus f of minus 2 plus 2. 130 00:07:45,269 --> 00:07:46,669 That's 0. 131 00:07:46,670 --> 00:07:48,720 Plus f of 0. 132 00:07:48,720 --> 00:07:51,680 And now we just figure out what f of 4 and f of 0 is. 133 00:07:51,680 --> 00:07:55,120 Well, f of 4, we go where x equals r, it's right here, 134 00:07:55,120 --> 00:07:59,220 and when x equals 4, f of 4 is equal to 2. 135 00:07:59,220 --> 00:08:03,210 So this is equal to 2 plus f of 0. 136 00:08:03,209 --> 00:08:05,709 And just as a reminder, this is the definition of f. 137 00:08:05,709 --> 00:08:10,560 We didn't define it in terms of an algebraic expression, we 138 00:08:10,560 --> 00:08:13,319 defined in terms of an actual visual graph. 139 00:08:13,319 --> 00:08:16,290 So what's f of 0? f of 0 is 0. 140 00:08:16,290 --> 00:08:20,580 When x is equal to 0-- f of 0 is 0 so that's 2 plus 0-- so g 141 00:08:20,579 --> 00:08:23,879 of negative 2 is equal to 2. 142 00:08:23,879 --> 00:08:26,110 An interesting thing, you might want to make problems like this 143 00:08:26,110 --> 00:08:28,330 for yourself and keep experimenting with different 144 00:08:28,329 --> 00:08:30,419 types of functions, and a very interesting thing would 145 00:08:30,420 --> 00:08:33,870 actually be to graph g of x, and actually that's a 146 00:08:33,870 --> 00:08:34,669 good idea, I think. 147 00:08:34,669 --> 00:08:37,509 I think maybe we'll do that in the future modules to kind of 148 00:08:37,509 --> 00:08:39,330 play with functions and actually to try graph 149 00:08:39,330 --> 00:08:42,090 the functions and see how they turn out. 150 00:08:42,090 --> 00:08:45,580 I will-- I don't know if I have enough time-- actually, I'm 151 00:08:45,580 --> 00:08:48,320 going to wait until the next lecture to do a couple 152 00:08:48,320 --> 00:08:49,250 more examples. 153 00:08:49,250 --> 00:08:51,940 I want to do as many examples on the functions as I can with 154 00:08:51,940 --> 00:08:54,410 you, because I think as you keep watching and watching the 155 00:08:54,409 --> 00:08:58,219 function problems and seeing more and more variations on 156 00:08:58,220 --> 00:09:01,170 functions, you'll see both how general of a concept this is, 157 00:09:01,169 --> 00:09:03,899 and hopefully you'll get an idea of how the functions 158 00:09:03,899 --> 00:09:05,169 actually work. 159 00:09:05,169 --> 00:09:07,289 Well, I'll see you in the next lecture. 160 00:09:07,289 --> 00:09:08,779 Have fun. 161 00:09:08,779 --> 00:09:11,992