1 00:00:07,300 --> 00:00:08,500 PROFESSOR: Hi. 2 00:00:08,500 --> 00:00:10,380 Well, today's the chain rule. 3 00:00:10,380 --> 00:00:15,630 Very, very useful rule, and it's kind of neat, natural. 4 00:00:15,630 --> 00:00:18,650 Can I explain what a chain of functions is? 5 00:00:18,650 --> 00:00:21,810 There is a chain of functions. 6 00:00:21,810 --> 00:00:26,360 And then we want to know the slope, the derivative. 7 00:00:26,360 --> 00:00:28,600 So how does the chain work? 8 00:00:28,600 --> 00:00:32,250 So there x is the input. 9 00:00:32,250 --> 00:00:35,000 It goes into a function g of x. 10 00:00:35,000 --> 00:00:39,000 We could call that inside function y. 11 00:00:39,000 --> 00:00:46,290 So the first step is y is g of x. 12 00:00:46,290 --> 00:00:51,690 So we get an output from g, call it y. 13 00:00:51,690 --> 00:00:57,250 That's halfway, because that y then becomes the input to f. 14 00:00:57,250 --> 00:00:59,160 That completes the chain. 15 00:00:59,160 --> 00:01:03,850 It starts with x, produces y, which is the inside 16 00:01:03,850 --> 00:01:05,470 function g of x. 17 00:01:05,470 --> 00:01:09,830 And then let me call it z is f of y. 18 00:01:09,830 --> 00:01:13,870 And what I want to know is how quickly does 19 00:01:13,870 --> 00:01:16,920 z change as x changes? 20 00:01:16,920 --> 00:01:18,740 That's what the chain rule asks. 21 00:01:18,740 --> 00:01:22,260 It's the slope of that chain. 22 00:01:22,260 --> 00:01:24,900 Can I maybe just tell you the chain rule? 23 00:01:24,900 --> 00:01:27,970 And then we'll try it on some examples. 24 00:01:27,970 --> 00:01:30,170 You'll see how it works. 25 00:01:30,170 --> 00:01:32,120 OK, here it is. 26 00:01:32,120 --> 00:01:44,180 The derivative, the slope of this chain dz dx, notice I 27 00:01:44,180 --> 00:01:47,830 want the change in the whole thing when I change the 28 00:01:47,830 --> 00:01:49,530 original input. 29 00:01:49,530 --> 00:01:54,040 Then the formula is that I take-- it's nice. 30 00:01:54,040 --> 00:02:04,800 You take dz dy times dy dx. 31 00:02:04,800 --> 00:02:08,539 So the derivative that we're looking for, the slope, the 32 00:02:08,539 --> 00:02:14,160 speed, is a product of two simpler derivatives that we 33 00:02:14,160 --> 00:02:16,200 probably know. 34 00:02:16,200 --> 00:02:20,100 And when we put the chain together, we multiply those 35 00:02:20,100 --> 00:02:21,460 derivatives. 36 00:02:21,460 --> 00:02:28,310 But there's one catch that I'll explain. 37 00:02:28,310 --> 00:02:31,620 I can give you a hint right away. 38 00:02:31,620 --> 00:02:38,710 dz dy, this first factor, depends on y. 39 00:02:38,710 --> 00:02:43,170 But we're looking for the change due to the original 40 00:02:43,170 --> 00:02:46,150 change in x. 41 00:02:46,150 --> 00:02:51,110 When I find dz dy, I'm going to have to get back to x. 42 00:02:51,110 --> 00:02:54,180 Let me just do an example with a picture. 43 00:02:54,180 --> 00:02:56,480 You'll see why I have to do it. 44 00:02:56,480 --> 00:03:02,350 So let the chain be cosine of-- oh, sine. 45 00:03:02,350 --> 00:03:02,940 Why not? 46 00:03:02,940 --> 00:03:04,520 Sine of 3x. 47 00:03:04,520 --> 00:03:07,500 Let me take sine of 3x. 48 00:03:07,500 --> 00:03:15,520 So that's my sine of 3x. 49 00:03:15,520 --> 00:03:19,405 I would like to know if that's my function, and I can draw it 50 00:03:19,405 --> 00:03:23,700 and will draw it, what is the slope? 51 00:03:23,700 --> 00:03:26,720 OK, so what's the inside function? 52 00:03:26,720 --> 00:03:28,340 What's y here? 53 00:03:28,340 --> 00:03:30,420 Well, it's sitting there in parentheses. 54 00:03:30,420 --> 00:03:33,740 Often it's in parentheses so we identify it right away. 55 00:03:33,740 --> 00:03:35,790 y is 3x. 56 00:03:35,790 --> 00:03:37,590 That's the inside function. 57 00:03:37,590 --> 00:03:40,775 And then the outside function is the sine of y. 58 00:03:44,870 --> 00:03:47,330 So what's the derivative by the chain rule? 59 00:03:47,330 --> 00:03:49,810 I'm ready to use the chain rule, because these are such 60 00:03:49,810 --> 00:03:53,630 simple functions, I know their separate derivative. 61 00:03:53,630 --> 00:03:57,230 So if this whole thing is z, the chain rule 62 00:03:57,230 --> 00:04:03,780 says that dz dx is-- 63 00:04:03,780 --> 00:04:05,000 I'm using this rule. 64 00:04:05,000 --> 00:04:09,040 I first name dz dy, the derivative of z with respect 65 00:04:09,040 --> 00:04:13,820 to y, which is cosine of y. 66 00:04:13,820 --> 00:04:17,560 And then the second factor is dy dx, and that's just a 67 00:04:17,560 --> 00:04:22,820 straight line with slope 3, so dy dx is 3. 68 00:04:22,820 --> 00:04:24,580 Good. 69 00:04:24,580 --> 00:04:29,190 Good, but not finished, because I'm getting an answer 70 00:04:29,190 --> 00:04:32,530 that's still in terms of y, and I have to get back to x, 71 00:04:32,530 --> 00:04:34,430 and no problem to do it. 72 00:04:34,430 --> 00:04:36,750 I know the link from y to x. 73 00:04:36,750 --> 00:04:38,630 So here's the 3. 74 00:04:38,630 --> 00:04:41,550 I can usually write it out here, and then I wouldn't need 75 00:04:41,550 --> 00:04:42,550 parentheses. 76 00:04:42,550 --> 00:04:44,250 That's just that 3. 77 00:04:44,250 --> 00:04:48,520 Now the part I'm caring about: cosine of 3x. 78 00:04:52,900 --> 00:04:57,000 Not cosine x, even though this was just sine. 79 00:04:57,000 --> 00:05:00,870 But it was sine of y, and therefore, we need cosine 3x. 80 00:05:00,870 --> 00:05:05,480 Let me draw a picture of this function, and you'll see 81 00:05:05,480 --> 00:05:08,420 what's going on. 82 00:05:08,420 --> 00:05:10,580 If I draw a picture of-- 83 00:05:10,580 --> 00:05:15,570 I'll start with a picture of sine x, maybe out to 180 84 00:05:15,570 --> 00:05:18,310 degrees pi. 85 00:05:18,310 --> 00:05:21,140 This direction is now x. 86 00:05:21,140 --> 00:05:25,000 And this direction is going to be-- well, there is the sine 87 00:05:25,000 --> 00:05:27,500 of x, but that's not my function. 88 00:05:27,500 --> 00:05:32,800 My function is sine of 3x, and it's worth realizing what's 89 00:05:32,800 --> 00:05:33,750 the difference. 90 00:05:33,750 --> 00:05:39,720 How does the graph change if I have 3x instead of x? 91 00:05:39,720 --> 00:05:42,420 Well, things come sooner. 92 00:05:42,420 --> 00:05:45,310 Things are speeded up. 93 00:05:45,310 --> 00:05:49,680 Here at x equal pi, 180 degrees, is when the sine 94 00:05:49,680 --> 00:05:51,360 goes back to 0. 95 00:05:51,360 --> 00:05:56,510 But for 3x, it'll be back to 0 already when x is 60 96 00:05:56,510 --> 00:05:58,290 degrees, pi over 3. 97 00:05:58,290 --> 00:06:05,520 So 1/3 of the way along, right there, my sine 3x is this one. 98 00:06:05,520 --> 00:06:11,700 It's just like the sine curve but faster. 99 00:06:11,700 --> 00:06:15,940 That was pi over 3 there, 60 degrees. 100 00:06:15,940 --> 00:06:23,080 So this is my z of x curve, and you can see that the slope 101 00:06:23,080 --> 00:06:26,220 is steeper at the beginning. 102 00:06:26,220 --> 00:06:27,890 You can see that the slope-- 103 00:06:27,890 --> 00:06:30,700 things are happening three times faster. 104 00:06:30,700 --> 00:06:33,200 Things are compressed by 3. 105 00:06:33,200 --> 00:06:37,300 This sine curve is compressed by 3. 106 00:06:37,300 --> 00:06:44,190 That makes it speed up so the slope is 3 at the start, and I 107 00:06:44,190 --> 00:06:47,300 claim that it's 3 cosine of 3x. 108 00:06:47,300 --> 00:06:49,320 Oh, let's draw the slope. 109 00:06:49,320 --> 00:06:52,350 All right, draw the slope. 110 00:06:52,350 --> 00:06:55,140 All right, let me start with the slope of sine-- so this 111 00:06:55,140 --> 00:06:58,280 was just old sine x. 112 00:06:58,280 --> 00:07:04,400 So its slope is just cosine x along to-- 113 00:07:04,400 --> 00:07:04,980 right? 114 00:07:04,980 --> 00:07:11,850 That's the slope starts at 1. 115 00:07:11,850 --> 00:07:14,560 This is now cosine x. 116 00:07:14,560 --> 00:07:18,290 But that's going out to pi again. 117 00:07:18,290 --> 00:07:21,050 That's the slope of the original one, not the slope of 118 00:07:21,050 --> 00:07:23,660 our function, of our chain. 119 00:07:23,660 --> 00:07:27,290 So the slope of our chain will be-- 120 00:07:27,290 --> 00:07:29,160 I mean, it doesn't go out so far. 121 00:07:29,160 --> 00:07:35,500 It's all between here and pi over 3, right? 122 00:07:35,500 --> 00:07:38,580 Our function, the one we're looking at, is 123 00:07:38,580 --> 00:07:40,680 just on this part. 124 00:07:40,680 --> 00:07:45,690 And the slope starts out at 3, and it's three times bigger, 125 00:07:45,690 --> 00:07:47,760 so it's going to be-- well, I'll just 126 00:07:47,760 --> 00:07:49,200 about get it on there. 127 00:07:49,200 --> 00:07:50,450 It's going to go down. 128 00:07:54,980 --> 00:07:58,880 I don't know if that's great, but it maybe makes the point 129 00:07:58,880 --> 00:08:05,700 that I started up here at 3, and I ended down here at minus 130 00:08:05,700 --> 00:08:12,840 3 when x was 60 degrees because then-- 131 00:08:12,840 --> 00:08:18,830 you see, this is a picture of 3 cosine of 3x. 132 00:08:21,410 --> 00:08:27,270 I had to replace y by 3x at this point. 133 00:08:27,270 --> 00:08:32,039 OK, let me do two or three more examples, 134 00:08:32,039 --> 00:08:33,929 just so you see it. 135 00:08:33,929 --> 00:08:36,620 Let's take an easy one. 136 00:08:36,620 --> 00:08:42,510 Suppose z is x cubed squared. 137 00:08:45,170 --> 00:08:47,500 All right, here is the inside function. 138 00:08:47,500 --> 00:08:54,350 y is x cubed, and z is-- do you see what z is? 139 00:08:54,350 --> 00:08:58,890 z is x cubed squared. 140 00:08:58,890 --> 00:09:02,080 So x cubed is the inside function. 141 00:09:02,080 --> 00:09:04,910 What's the outside function? 142 00:09:04,910 --> 00:09:06,220 It's a function of y. 143 00:09:06,220 --> 00:09:07,400 I'm not going to write-- 144 00:09:07,400 --> 00:09:10,020 it's going to be the squaring function. 145 00:09:10,020 --> 00:09:11,710 That's what we do outside. 146 00:09:11,710 --> 00:09:13,610 I'm not going to write x squared. 147 00:09:13,610 --> 00:09:15,310 It's y squared. 148 00:09:15,310 --> 00:09:16,170 This is y. 149 00:09:16,170 --> 00:09:18,380 It's y squared that gets squared. 150 00:09:18,380 --> 00:09:26,010 Then the derivative dz dx by the chain rule is dz dy. 151 00:09:26,010 --> 00:09:27,640 Shall I remember the chain rule? 152 00:09:27,640 --> 00:09:32,350 dz dy, dy dx. 153 00:09:32,350 --> 00:09:37,810 Easy to remember because in the mind of everybody, these 154 00:09:37,810 --> 00:09:42,530 dy's, you see that they're sort of canceling. 155 00:09:42,530 --> 00:09:45,100 So what's dz dy? 156 00:09:45,100 --> 00:09:49,300 z is y squared, so this is 2y, that factor. 157 00:09:49,300 --> 00:09:51,320 What's dy dx? 158 00:09:51,320 --> 00:09:52,650 y is x cubed. 159 00:09:52,650 --> 00:09:54,740 We know the derivative of x cubed. 160 00:09:54,740 --> 00:09:58,050 It's 3x squared. 161 00:09:58,050 --> 00:10:04,210 There is the answer, but it's not final because I've got a y 162 00:10:04,210 --> 00:10:05,830 here that doesn't belong. 163 00:10:05,830 --> 00:10:07,130 I've got to get it back to. 164 00:10:07,130 --> 00:10:12,630 X So I have all together 2 times 3 is making 6, and that 165 00:10:12,630 --> 00:10:17,420 y, I have to go back and see what was y in terms of x. 166 00:10:17,420 --> 00:10:18,950 It was x cubed. 167 00:10:18,950 --> 00:10:22,150 So I have x cubed there, and here's an x squared, 168 00:10:22,150 --> 00:10:25,460 altogether x to the fifth. 169 00:10:25,460 --> 00:10:28,340 Now, is that the right answer? 170 00:10:28,340 --> 00:10:33,110 In this example, we can certainly check it because we 171 00:10:33,110 --> 00:10:37,350 know what x cubed squared is. 172 00:10:37,350 --> 00:10:42,430 So x cubed is x times x times x, and I'm squaring that. 173 00:10:42,430 --> 00:10:43,850 I'm multiplying by itself. 174 00:10:43,850 --> 00:10:45,820 There's another x times x times x. 175 00:10:45,820 --> 00:10:52,360 Altogether I have x to the sixth power. 176 00:10:52,360 --> 00:10:54,230 Notice I don't add those. 177 00:10:54,230 --> 00:10:59,990 When I'm squaring x cubed, I multiply the 2 by 178 00:10:59,990 --> 00:11:02,310 the 3 and get 6. 179 00:11:02,310 --> 00:11:06,040 So z is x to the sixth, and of course, the derivative of x to 180 00:11:06,040 --> 00:11:10,390 the sixth is 6 times x to the fifth, one power lower. 181 00:11:14,170 --> 00:11:17,630 OK, I want to do two more examples. 182 00:11:17,630 --> 00:11:23,600 Let me do one more right away while we're on a roll. 183 00:11:23,600 --> 00:11:30,310 I'll bring down that board and take this function, just so 184 00:11:30,310 --> 00:11:32,580 you can spot the inside function 185 00:11:32,580 --> 00:11:34,070 and the outside function. 186 00:11:34,070 --> 00:11:39,760 So my function z is going to be 1 over the square root of 1 187 00:11:39,760 --> 00:11:43,490 minus x squared. 188 00:11:43,490 --> 00:11:47,480 Such things come up pretty often so we have to know its 189 00:11:47,480 --> 00:11:47,950 derivative. 190 00:11:47,950 --> 00:11:50,640 We could graph it. 191 00:11:50,640 --> 00:11:55,920 That's a perfectly reasonable function, and 192 00:11:55,920 --> 00:11:59,100 it's a perfect chain. 193 00:11:59,100 --> 00:12:03,610 The first point is to identify what's the inside function and 194 00:12:03,610 --> 00:12:04,950 what's the outside. 195 00:12:04,950 --> 00:12:08,370 So inside I'm seeing this 1 minus x squared. 196 00:12:08,370 --> 00:12:14,440 That's the quantity that it'll be much simpler if I just give 197 00:12:14,440 --> 00:12:17,330 that a single name y. 198 00:12:17,330 --> 00:12:19,150 And then what's the outside function? 199 00:12:19,150 --> 00:12:21,290 What am I doing to this y? 200 00:12:21,290 --> 00:12:26,480 I'm taking its square root, so I have y to the 1/2. 201 00:12:26,480 --> 00:12:29,870 But that square root is in the denominator. 202 00:12:29,870 --> 00:12:33,520 I'm dividing, so it's y to the minus 1/2. 203 00:12:33,520 --> 00:12:38,800 So z is y to the minus 1/2. 204 00:12:38,800 --> 00:12:42,150 OK, those are functions I'm totally happy with. 205 00:12:42,150 --> 00:12:44,355 The derivative is what? 206 00:12:48,310 --> 00:12:51,210 dz dy, I won't repeat the chain rule. 207 00:12:51,210 --> 00:12:53,090 You've got that clearly in mind. 208 00:12:53,090 --> 00:12:54,490 It's right above. 209 00:12:54,490 --> 00:12:56,970 Let's just put in the answer here. 210 00:12:56,970 --> 00:13:01,140 dz dy, the derivative, that's y to some power, so I get 211 00:13:01,140 --> 00:13:05,306 minus 1/2 times y to what power? 212 00:13:08,210 --> 00:13:10,560 I always go one power lower. 213 00:13:10,560 --> 00:13:12,355 Here the power is minus 1/2. 214 00:13:12,355 --> 00:13:17,490 If I go down by one, I'll have minus 3/2. 215 00:13:17,490 --> 00:13:22,630 And then I have to have dy dx, which is easy. 216 00:13:22,630 --> 00:13:25,430 dy dx, y is 1 minus x squared. 217 00:13:25,430 --> 00:13:31,030 The derivative of that is just minus 2x. 218 00:13:31,030 --> 00:13:37,490 And now I have to assemble these, put them together, and 219 00:13:37,490 --> 00:13:39,660 get rid of the y. 220 00:13:39,660 --> 00:13:42,490 So the minus 2 cancels the minus 1/2. 221 00:13:42,490 --> 00:13:43,600 That's nice. 222 00:13:43,600 --> 00:13:50,560 I have an x still here, and I have y to the minus 3/2. 223 00:13:50,560 --> 00:13:52,310 What's that? 224 00:13:52,310 --> 00:13:58,660 I know what y is, 1 minus x squared, and so it's that to 225 00:13:58,660 --> 00:14:01,220 the minus 3/2. 226 00:14:01,220 --> 00:14:02,760 I could write it that way. 227 00:14:02,760 --> 00:14:05,960 x times 1 minus x squared-- 228 00:14:05,960 --> 00:14:07,410 that's the y-- 229 00:14:07,410 --> 00:14:11,370 to the power minus 3/2. 230 00:14:11,370 --> 00:14:13,470 Maybe you like it that way. 231 00:14:13,470 --> 00:14:15,870 I'm totally OK with that. 232 00:14:15,870 --> 00:14:19,250 Or maybe you want to see it as-- 233 00:14:19,250 --> 00:14:28,310 this minus exponent down here as 3/2. 234 00:14:28,310 --> 00:14:30,440 Either way, both good. 235 00:14:30,440 --> 00:14:34,650 OK, so that's one more practice. 236 00:14:34,650 --> 00:14:37,970 and I've got one more in mind. 237 00:14:37,970 --> 00:14:42,310 But let me return to this board, the starting board, 238 00:14:42,310 --> 00:14:50,060 just to justify where did this chain rule come from. 239 00:14:50,060 --> 00:14:53,160 OK, where do derivatives come from? 240 00:14:53,160 --> 00:15:00,280 Derivative always start with small finite steps, with delta 241 00:15:00,280 --> 00:15:01,530 rather than d. 242 00:15:05,160 --> 00:15:09,630 So I start here, I make a change in x, and I want to 243 00:15:09,630 --> 00:15:13,660 know the change in z. 244 00:15:13,660 --> 00:15:23,320 These are small, but not zero, not darn small. 245 00:15:23,320 --> 00:15:30,860 OK, all right, those are true quantities, and for those, I'm 246 00:15:30,860 --> 00:15:41,870 perfectly entitled to divide and multiply by the change in 247 00:15:41,870 --> 00:15:44,170 y because there will be a change in y. 248 00:15:44,170 --> 00:15:49,070 When I change x, that produces a change in g of x. 249 00:15:49,070 --> 00:15:50,840 You remember this was the y. 250 00:15:54,000 --> 00:15:56,760 So this factor-- 251 00:15:56,760 --> 00:16:00,310 well, first of all, that's simply a true 252 00:16:00,310 --> 00:16:02,840 statement for fractions. 253 00:16:05,720 --> 00:16:07,080 But it's the right way. 254 00:16:07,080 --> 00:16:09,070 It's the way we want it. 255 00:16:09,070 --> 00:16:14,190 Because now when I show it, and in words, it says when I 256 00:16:14,190 --> 00:16:19,130 change x a little, that produces a change in y, and 257 00:16:19,130 --> 00:16:22,520 the change in y produces a change in z. 258 00:16:22,520 --> 00:16:26,920 And it's the ratio that we're after, the ratio between the 259 00:16:26,920 --> 00:16:29,190 original change and the final change. 260 00:16:29,190 --> 00:16:32,130 So I just put the inside change up 261 00:16:32,130 --> 00:16:34,020 and divide and multiply. 262 00:16:34,020 --> 00:16:37,490 OK, what am I going to do? 263 00:16:37,490 --> 00:16:41,940 What I always do, whatever body does with derivatives at 264 00:16:41,940 --> 00:16:44,740 an instant, at a point. 265 00:16:44,740 --> 00:16:47,510 Let delta x go to 0. 266 00:16:47,510 --> 00:16:51,270 Now as delta x goes to 0, delta y will go to 0, delta z 267 00:16:51,270 --> 00:16:55,650 will go to 0, and we get a lot of zeroes over 0. 268 00:16:55,650 --> 00:16:59,870 That's what calculus is prepared to live with. 269 00:16:59,870 --> 00:17:03,040 Because it keeps this ratio. 270 00:17:05,780 --> 00:17:13,050 It doesn't separately think about 0 and then later 0. 271 00:17:13,050 --> 00:17:17,230 It's looking at the ratio as things happen. 272 00:17:17,230 --> 00:17:19,619 And that ratio does approach that. 273 00:17:19,619 --> 00:17:22,119 That was the definition of the derivative. 274 00:17:22,119 --> 00:17:26,460 This ratio approaches that, and we get the answer. 275 00:17:26,460 --> 00:17:31,490 This ratio approaches the derivative we're after. 276 00:17:31,490 --> 00:17:34,370 That in a nutshell is the thinking 277 00:17:34,370 --> 00:17:36,470 behind the chain rule. 278 00:17:36,470 --> 00:17:41,390 OK, I could discuss it further, but that's the 279 00:17:41,390 --> 00:17:42,430 essence of it. 280 00:17:42,430 --> 00:17:51,730 OK, now I'm ready to do one more example that isn't just 281 00:17:51,730 --> 00:17:52,470 so made up. 282 00:17:52,470 --> 00:17:55,750 It's an important one. 283 00:17:55,750 --> 00:18:00,090 And it's one I haven't tackled before. 284 00:18:00,090 --> 00:18:10,960 My function is going to be e to the minus x squared over 2. 285 00:18:10,960 --> 00:18:13,670 That's my function. 286 00:18:13,670 --> 00:18:16,670 Shall I call it z? 287 00:18:16,670 --> 00:18:19,080 That's my function of x. 288 00:18:19,080 --> 00:18:23,790 So I want you to identify the inside function and the 289 00:18:23,790 --> 00:18:27,850 outside function in that change, take the derivative, 290 00:18:27,850 --> 00:18:30,290 and then let's look at the graph for this one. 291 00:18:30,290 --> 00:18:34,430 The graph of this one is a familiar important graph. 292 00:18:34,430 --> 00:18:37,770 But it's quite an interesting function. 293 00:18:37,770 --> 00:18:41,140 OK, so what are you going to take? 294 00:18:41,140 --> 00:18:42,560 This often happens. 295 00:18:42,560 --> 00:18:47,550 We have e to the something, e to some function. 296 00:18:47,550 --> 00:18:50,760 So that's our inside function up there. 297 00:18:50,760 --> 00:18:56,390 Our function y, inside function, is going to be minus 298 00:18:56,390 --> 00:19:01,310 x squared over 2, that quantity 299 00:19:01,310 --> 00:19:03,060 that's sitting up there. 300 00:19:03,060 --> 00:19:06,980 And then z, the outside function, is 301 00:19:06,980 --> 00:19:11,550 just e to the y, right? 302 00:19:11,550 --> 00:19:15,650 So two very, very simple functions have gone into this 303 00:19:15,650 --> 00:19:18,900 chain and produced this e to the minus x 304 00:19:18,900 --> 00:19:20,830 squared over 2 function. 305 00:19:20,830 --> 00:19:24,940 OK, I'm going to ask you for the derivative, and you're 306 00:19:24,940 --> 00:19:25,760 going to do it. 307 00:19:25,760 --> 00:19:27,500 No problem. 308 00:19:27,500 --> 00:19:32,430 So dz dx, let's use the chain rule. 309 00:19:32,430 --> 00:19:36,420 Again, it's sitting right above. 310 00:19:36,420 --> 00:19:41,450 dz dy, so I'm going to take the slope, the derivative of 311 00:19:41,450 --> 00:19:46,550 the outside function dz dy, which is e to the y. 312 00:19:46,550 --> 00:19:51,380 And that has that remarkable property, which is why we care 313 00:19:51,380 --> 00:19:55,230 about it, why we named it, why we created it. 314 00:19:55,230 --> 00:19:56,940 The derivative of that is itself. 315 00:19:59,940 --> 00:20:03,670 And the derivative of minus x squared over 2 is-- 316 00:20:03,670 --> 00:20:05,920 that's a picnic, right?-- 317 00:20:05,920 --> 00:20:07,510 is a minus. 318 00:20:07,510 --> 00:20:09,580 x squared, we'll bring down a 2. 319 00:20:09,580 --> 00:20:12,640 Cancel that 2, it'll be minus x. 320 00:20:12,640 --> 00:20:15,720 That's the derivative of minus x squared over 2. 321 00:20:15,720 --> 00:20:18,240 Notice the result is negative. 322 00:20:18,240 --> 00:20:21,390 This function is at least out where-- 323 00:20:21,390 --> 00:20:25,460 if x is positive, the whole slope is negative, and the 324 00:20:25,460 --> 00:20:27,650 graph is going downwards. 325 00:20:27,650 --> 00:20:29,290 And now what's-- 326 00:20:29,290 --> 00:20:31,230 everybody knows this final step. 327 00:20:31,230 --> 00:20:33,360 I can't leave the answer like that because 328 00:20:33,360 --> 00:20:34,870 it's got a y in it. 329 00:20:34,870 --> 00:20:39,890 I have to put in what y is, and it is-- 330 00:20:39,890 --> 00:20:42,590 can I write the minus x first? 331 00:20:42,590 --> 00:20:47,090 Because it's easier to write it in front of this e to the 332 00:20:47,090 --> 00:20:51,640 y, which is e to the minus x squared over 2. 333 00:20:51,640 --> 00:20:54,360 So that's the derivative we wanted. 334 00:20:54,360 --> 00:20:58,000 Now I want to think about that function a bit. 335 00:20:58,000 --> 00:21:05,570 OK, notice that we started with an e to the minus 336 00:21:05,570 --> 00:21:10,520 something, and we ended with an e to the minus something 337 00:21:10,520 --> 00:21:12,320 with other factors. 338 00:21:12,320 --> 00:21:15,200 This is typical for exponentials. 339 00:21:15,200 --> 00:21:20,080 Exponentials, the derivative stays with that exponent. 340 00:21:20,080 --> 00:21:23,800 We could even take the derivative of that, and we 341 00:21:23,800 --> 00:21:26,660 would again have some expression. 342 00:21:26,660 --> 00:21:30,470 Well, let's do it in a minute, the derivative of that. 343 00:21:30,470 --> 00:21:36,230 OK, I'd like to graph these functions, the original 344 00:21:36,230 --> 00:21:42,690 function z and the slope of the z function. 345 00:21:42,690 --> 00:21:45,910 OK, so let's see. 346 00:21:45,910 --> 00:21:48,000 x can have any sign. 347 00:21:50,780 --> 00:21:53,430 x can go for this-- 348 00:21:53,430 --> 00:21:54,760 now, I'm graphing this. 349 00:21:58,590 --> 00:22:00,420 OK, so what do I expect? 350 00:22:00,420 --> 00:22:05,220 I can certainly figure out the point x equals 0. 351 00:22:05,220 --> 00:22:12,030 At x equals 0, I have e to the 0, which is 1. 352 00:22:12,030 --> 00:22:16,170 So at x equals 0, it's 1. 353 00:22:16,170 --> 00:22:20,830 OK, now at x equals to 1, it has dropped to something. 354 00:22:23,660 --> 00:22:28,520 And also at x equals minus 1, notice the symmetry. 355 00:22:28,520 --> 00:22:32,800 This function is going to be-- this graph is going to be 356 00:22:32,800 --> 00:22:39,650 symmetric around the y-axis because I've got x squared. 357 00:22:39,650 --> 00:22:42,010 The right official name for that is we 358 00:22:42,010 --> 00:22:43,660 have an even function. 359 00:22:43,660 --> 00:22:48,950 It's even when it's same for x and for minus x. 360 00:22:48,950 --> 00:22:51,830 OK, so what's happening at x equal 1? 361 00:22:51,830 --> 00:22:54,920 That's e to the minus 1/2. 362 00:22:54,920 --> 00:22:55,690 Whew! 363 00:22:55,690 --> 00:22:57,720 I should have looked ahead to figure out 364 00:22:57,720 --> 00:23:00,460 what that number is. 365 00:23:00,460 --> 00:23:01,540 Whatever. 366 00:23:01,540 --> 00:23:05,620 It's smaller than 1, certainly, because it's e to 367 00:23:05,620 --> 00:23:07,210 the minus something. 368 00:23:07,210 --> 00:23:11,890 So let me put it there, and it'll be here, too. 369 00:23:11,890 --> 00:23:16,740 And now rather than a particular value, what's your 370 00:23:16,740 --> 00:23:18,240 impression of the whole graph? 371 00:23:23,060 --> 00:23:24,590 The whole graph is--It's symmetric, so it's going to 372 00:23:24,590 --> 00:23:28,230 start like this, and it's going to start sinking. 373 00:23:28,230 --> 00:23:30,200 And then it's going to sink. 374 00:23:30,200 --> 00:23:31,950 Let me try to get through that point. 375 00:23:35,570 --> 00:23:36,870 Look here. 376 00:23:36,870 --> 00:23:43,150 As x gets large, say x is even just 3 or 4 or 1000, I'm 377 00:23:43,150 --> 00:23:47,170 squaring it, so I'm getting 9 or 16 or 1000000. 378 00:23:47,170 --> 00:23:48,890 And then divide by 2. 379 00:23:48,890 --> 00:23:49,700 No problem. 380 00:23:49,700 --> 00:23:53,600 And then e to the minus is-- 381 00:23:53,600 --> 00:23:57,590 I mean, so e to the thousandth would be off 382 00:23:57,590 --> 00:24:00,780 that board by miles. 383 00:24:00,780 --> 00:24:06,560 e to the minus 1000 is a very small number and getting 384 00:24:06,560 --> 00:24:11,560 smaller fast. So this is going to get-- but never touches 0, 385 00:24:11,560 --> 00:24:13,240 so it's going to-- 386 00:24:13,240 --> 00:24:17,550 well, let's see. 387 00:24:17,550 --> 00:24:22,490 I want to make it symmetric, and then I want to somehow I 388 00:24:22,490 --> 00:24:27,870 made it touch because this darn finite chalk. 389 00:24:27,870 --> 00:24:31,750 I couldn't leave a little space. 390 00:24:31,750 --> 00:24:35,320 But to your eye it touches. 391 00:24:35,320 --> 00:24:41,100 If we had even fine print, you couldn't see that distance. 392 00:24:41,100 --> 00:24:50,370 So this is that curve, which was meant to be symmetric, is 393 00:24:50,370 --> 00:24:55,610 the famous bell-shaped curve. 394 00:24:58,320 --> 00:25:07,160 It's the most important curve for gamblers, for 395 00:25:07,160 --> 00:25:10,740 mathematicians who work in probability. 396 00:25:10,740 --> 00:25:15,000 That bell-shaped curve will come up, and you'll see in a 397 00:25:15,000 --> 00:25:20,150 later lecture a connection between how calculus enters in 398 00:25:20,150 --> 00:25:23,110 probability, and it enters for this function. 399 00:25:23,110 --> 00:25:25,790 OK, now what's this slope? 400 00:25:25,790 --> 00:25:28,170 What's the slope of that function? 401 00:25:28,170 --> 00:25:32,650 Again, symmetric, or maybe anti-symmetric, because I have 402 00:25:32,650 --> 00:25:33,960 this factor x. 403 00:25:33,960 --> 00:25:35,290 So what's the slope? 404 00:25:35,290 --> 00:25:37,660 The slope starts at 0. 405 00:25:37,660 --> 00:25:40,000 So here's x again. 406 00:25:40,000 --> 00:25:45,270 I'm graphing now the slope, so this was z. 407 00:25:45,270 --> 00:25:48,660 Now I'm going to graph the slope of this. 408 00:25:48,660 --> 00:25:55,200 OK, the slope starts out at 0, as we see from this picture. 409 00:25:55,200 --> 00:25:59,570 Now we can see, as I go forward here, the slope is 410 00:25:59,570 --> 00:26:01,540 always negative. 411 00:26:01,540 --> 00:26:03,480 The slope is going down. 412 00:26:03,480 --> 00:26:09,380 Here it starts out-- 413 00:26:09,380 --> 00:26:13,710 yeah, so the slope is 0 there. 414 00:26:13,710 --> 00:26:16,085 The slope is becoming more and more negative. 415 00:26:19,545 --> 00:26:20,400 Let's see. 416 00:26:20,400 --> 00:26:23,260 The slope is becoming more and more negative, maybe up to 417 00:26:23,260 --> 00:26:25,660 some point. 418 00:26:25,660 --> 00:26:29,460 Actually, I believe it's that point where 419 00:26:29,460 --> 00:26:31,220 the slope is becoming-- 420 00:26:31,220 --> 00:26:32,990 then it becomes less negative. 421 00:26:32,990 --> 00:26:33,990 It's always negative. 422 00:26:33,990 --> 00:26:43,030 I think that the slope goes down to that point x equals 1, 423 00:26:43,030 --> 00:26:46,570 and that's where the slope is as steep as it gets. 424 00:26:46,570 --> 00:26:51,110 And then the slope comes up again, but the slope 425 00:26:51,110 --> 00:26:53,740 never gets to 0. 426 00:26:53,740 --> 00:26:57,430 We're always going downhill, but very slightly. 427 00:26:57,430 --> 00:27:02,170 Oh, well, of course, I expect to be close to that line 428 00:27:02,170 --> 00:27:04,600 because this e to the minus x squared over 2 429 00:27:04,600 --> 00:27:06,930 is getting so small. 430 00:27:06,930 --> 00:27:12,470 And then over here, I think this will be symmetric. 431 00:27:12,470 --> 00:27:15,040 Here the slopes are positive. 432 00:27:15,040 --> 00:27:16,210 Ah! 433 00:27:16,210 --> 00:27:17,980 Look at that! 434 00:27:17,980 --> 00:27:22,890 Here we had an even function, symmetric across 0. 435 00:27:22,890 --> 00:27:26,350 Here its slope turns out to be-- 436 00:27:26,350 --> 00:27:28,550 and this could not be an accident. 437 00:27:28,550 --> 00:27:32,470 Its slope turns out to be an odd function, 438 00:27:32,470 --> 00:27:34,660 anti-symmetric across 0. 439 00:27:34,660 --> 00:27:36,080 Now, it just was. 440 00:27:36,080 --> 00:27:39,480 This is an odd function, because if I change x, I 441 00:27:39,480 --> 00:27:41,740 change the sign of that function. 442 00:27:41,740 --> 00:27:48,140 OK, now if you will give me another moment, I'll ask you 443 00:27:48,140 --> 00:27:49,910 about the second derivative. 444 00:27:49,910 --> 00:27:52,180 Maybe this is the first time we've done the second 445 00:27:52,180 --> 00:27:54,040 derivative. 446 00:27:54,040 --> 00:27:56,760 What do you think the second derivative is? 447 00:27:56,760 --> 00:28:00,990 The second derivative is the derivative of the derivative, 448 00:28:00,990 --> 00:28:04,440 the slope of the slope. 449 00:28:04,440 --> 00:28:09,210 My classical calculus problem starts with function one, 450 00:28:09,210 --> 00:28:14,130 produces function two, height to slope. 451 00:28:14,130 --> 00:28:17,910 Now when I take another derivative, I'm starting with 452 00:28:17,910 --> 00:28:23,440 this function one, and over here will be a function two. 453 00:28:23,440 --> 00:28:31,910 So this was dz dx, and now here is going to be the second 454 00:28:31,910 --> 00:28:32,050 derivative. 455 00:28:32,050 --> 00:28:33,300 Second derivative. 456 00:28:35,680 --> 00:28:42,940 And we'll give it a nice notation, nice symbol. 457 00:28:42,940 --> 00:28:47,040 It's not dz dx, all squared. 458 00:28:47,040 --> 00:28:48,880 That's not what I'm doing. 459 00:28:48,880 --> 00:28:52,530 I'm taking the derivative of this. 460 00:28:52,530 --> 00:28:54,240 So I'm taking-- 461 00:28:54,240 --> 00:29:00,050 well, the derivative of that, I could-- 462 00:29:00,050 --> 00:29:05,090 I'm going to give a whole return to the second 463 00:29:05,090 --> 00:29:05,530 derivative. 464 00:29:05,530 --> 00:29:07,700 It's a big deal. 465 00:29:07,700 --> 00:29:14,250 I'll just say how I write it: dz dx squared. 466 00:29:14,250 --> 00:29:15,780 That's the second derivative. 467 00:29:15,780 --> 00:29:18,760 It's the slope of this function. 468 00:29:18,760 --> 00:29:23,110 And I guess what I want is would you know how to take the 469 00:29:23,110 --> 00:29:26,360 slope of that function? 470 00:29:26,360 --> 00:29:29,000 Can we just think what would go into that, 471 00:29:29,000 --> 00:29:30,540 and I'll put it here? 472 00:29:30,540 --> 00:29:32,430 Let me put that function here. 473 00:29:32,430 --> 00:29:37,500 minus x e to the minus x squared over 2. 474 00:29:37,500 --> 00:29:40,750 Slope of that, derivative of that. 475 00:29:40,750 --> 00:29:42,990 What do I see there? 476 00:29:42,990 --> 00:29:44,500 I see a product. 477 00:29:44,500 --> 00:29:47,760 I see that times that. 478 00:29:47,760 --> 00:29:50,580 So I'm going to use the product rule. 479 00:29:50,580 --> 00:29:55,280 But then I also see that in this factor, in this minus x 480 00:29:55,280 --> 00:29:58,330 squared over 2, I see a chain. 481 00:29:58,330 --> 00:30:01,530 In fact, it's exactly my original chain. 482 00:30:01,530 --> 00:30:03,790 I know how to deal with that chain. 483 00:30:03,790 --> 00:30:05,710 So I'm going to use the product rule 484 00:30:05,710 --> 00:30:08,060 and the chain rule. 485 00:30:08,060 --> 00:30:14,430 And that's the point that once we have our list of rules, 486 00:30:14,430 --> 00:30:19,800 these are now what we might call four simple rules. 487 00:30:19,800 --> 00:30:25,270 We know those guys: sum, difference, product, quotient. 488 00:30:25,270 --> 00:30:28,390 And now we're doing the chain rule, but we have to be 489 00:30:28,390 --> 00:30:33,070 prepared as here for a product, and then one of these 490 00:30:33,070 --> 00:30:34,400 factors is a chain. 491 00:30:34,400 --> 00:30:36,510 All right, can we do it? 492 00:30:36,510 --> 00:30:38,185 So the derivative, slope. 493 00:30:41,300 --> 00:30:46,890 Well, slope of slope, because this was the original slope. 494 00:30:46,890 --> 00:30:52,580 OK, so it's the first factor times the derivative of the 495 00:30:52,580 --> 00:30:55,100 second factor. 496 00:30:55,100 --> 00:30:57,990 And that's the chain, but that's the one 497 00:30:57,990 --> 00:30:59,410 we've already done. 498 00:30:59,410 --> 00:31:03,530 So the derivative of that is what we already computed, and 499 00:31:03,530 --> 00:31:04,680 what was it? 500 00:31:04,680 --> 00:31:06,870 It was that. 501 00:31:06,870 --> 00:31:10,980 So the second factor was minus x e to the minus x 502 00:31:10,980 --> 00:31:12,930 squared over 2. 503 00:31:12,930 --> 00:31:15,130 So this is-- 504 00:31:15,130 --> 00:31:20,030 can I just like remember this is f dg dx 505 00:31:20,030 --> 00:31:21,210 in the product rule. 506 00:31:21,210 --> 00:31:23,040 And the product, this is-- 507 00:31:23,040 --> 00:31:26,330 here is a product of f times g. 508 00:31:26,330 --> 00:31:36,500 So f times dg dx, and now I need g times-- 509 00:31:36,500 --> 00:31:41,850 this was g, and this is df dx, or it will be. 510 00:31:41,850 --> 00:31:44,070 What's df dx? 511 00:31:44,070 --> 00:31:46,970 Phooey on this old example. 512 00:31:46,970 --> 00:31:48,220 Gone. 513 00:31:49,650 --> 00:31:55,880 OK, df dx, well, f is minus x. df dx is just minus 1. 514 00:31:55,880 --> 00:31:56,980 Simple. 515 00:31:56,980 --> 00:32:00,230 All right, put the pieces together. 516 00:32:00,230 --> 00:32:04,370 We have, as I expected we would, everything has this 517 00:32:04,370 --> 00:32:08,490 factor e to the minus x squared over 2. 518 00:32:08,490 --> 00:32:11,780 That's controlling everything, but the question is what's 519 00:32:11,780 --> 00:32:16,330 it-- so here we have a minus 1; is that right? 520 00:32:16,330 --> 00:32:19,240 And here, we have a plus x squared. 521 00:32:19,240 --> 00:32:25,050 So I think we have x squared minus 1 times that. 522 00:32:25,050 --> 00:32:35,504 OK, so we computed a second derivative. 523 00:32:35,504 --> 00:32:36,754 Ha! 524 00:32:40,380 --> 00:32:42,990 Two things I want to do, one with this example. 525 00:32:45,750 --> 00:32:51,630 The second derivative will switch sign. 526 00:32:51,630 --> 00:32:56,570 If I graph the darn thing-- suppose I tried to graph that? 527 00:32:56,570 --> 00:32:59,900 When x is 0, this thing is negative. 528 00:32:59,900 --> 00:33:01,530 What is that telling me? 529 00:33:01,530 --> 00:33:03,230 So this is the second group. 530 00:33:03,230 --> 00:33:10,990 This is telling me that the slope is going 531 00:33:10,990 --> 00:33:13,830 downwards at the start. 532 00:33:13,830 --> 00:33:16,440 I see it. 533 00:33:16,440 --> 00:33:22,140 But then at x equal 1, that second derivative, because of 534 00:33:22,140 --> 00:33:26,700 this x squared minus 1 factor, is up to 0. 535 00:33:26,700 --> 00:33:30,910 It's going to take time with this second derivative. 536 00:33:30,910 --> 00:33:33,350 That's the slope of the slope. 537 00:33:33,350 --> 00:33:36,840 That's this point here. 538 00:33:36,840 --> 00:33:38,430 Here is the slope. 539 00:33:38,430 --> 00:33:44,350 Now, at that point, its slope is 0. 540 00:33:44,350 --> 00:33:48,460 And after that point, its slope is upwards. 541 00:33:48,460 --> 00:33:50,410 We're getting something like this. 542 00:33:50,410 --> 00:33:59,470 The slope of the slope, and it'll go evenly upwards, and 543 00:33:59,470 --> 00:34:00,636 then so on. 544 00:34:00,636 --> 00:34:02,100 Ha! 545 00:34:02,100 --> 00:34:07,730 You see that we've got the derivative code, the slope, 546 00:34:07,730 --> 00:34:11,110 but we've got a little more thinking to do for the slope 547 00:34:11,110 --> 00:34:16,440 of the slope, the rate of change of the rate of change. 548 00:34:16,440 --> 00:34:18,870 Then you really have calculus straight. 549 00:34:18,870 --> 00:34:27,739 And a challenge that I don't want to try right now would be 550 00:34:27,739 --> 00:34:31,370 what's the chain rule for the second derivative? 551 00:34:31,370 --> 00:34:32,170 Ha! 552 00:34:32,170 --> 00:34:41,750 I'll leave that as a challenge for professors who might or 553 00:34:41,750 --> 00:34:43,469 might not be able to do it. 554 00:34:43,469 --> 00:34:49,040 OK, we've introduced the second derivative here at the 555 00:34:49,040 --> 00:34:51,179 end of a lecture. 556 00:34:51,179 --> 00:34:58,240 The key central idea of the lecture was the chain rule to 557 00:34:58,240 --> 00:34:59,790 give us that derivative. 558 00:34:59,790 --> 00:35:00,290 Good! 559 00:35:00,290 --> 00:35:02,610 Thank you. 560 00:35:02,610 --> 00:35:04,420 NARRATOR: This has been a production of MIT 561 00:35:04,420 --> 00:35:06,810 OpenCourseWare and Gilbert Strang. 562 00:35:06,810 --> 00:35:09,080 Funding for this video was provided by the Lord 563 00:35:09,080 --> 00:35:10,300 Foundation. 564 00:35:10,300 --> 00:35:13,430 To help OCW continue to provide free and open access 565 00:35:13,430 --> 00:35:16,510 to MIT courses, please make a donation at 566 00:35:16,510 --> 00:35:18,070 ocw.mit.edu/donate.