1 00:00:00,012 --> 00:00:05,962 [MUSIC] Thus far, I've been trying to sell you on the idea that the derivative 2 00:00:05,962 --> 00:00:11,162 of f measures how we wiggling the input effects the output. 3 00:00:11,162 --> 00:00:17,487 A very important point is that sensitivity to the input depends on where 4 00:00:17,487 --> 00:00:21,612 you're wiggling the input. And here's an example. 5 00:00:21,612 --> 00:00:28,216 Think about the function f(x)=x^3. f(2) which is 2^3 is 8. 6 00:00:28,216 --> 00:00:36,367 f(2.01) 2.01 cubed is 8.120601. So, the input change of 0.01 was 7 00:00:36,367 --> 00:00:41,632 magnified by about 12 times in the output. 8 00:00:41,632 --> 00:00:47,962 Now, think about f(3) which is 3^3, which is 27. 9 00:00:47,962 --> 00:00:53,865 f(3.01) is 27.270901 so the input change of 0.01 was magnified by about 24 times 10 00:00:53,865 --> 00:00:57,460 as much, right? This input change and this input 11 00:00:57,460 --> 00:01:00,789 change were magnified by different amounts. 12 00:01:00,789 --> 00:01:06,642 You know, you shouldn't be too surprised by that right, the derivative, of course, 13 00:01:06,642 --> 00:01:11,214 measures this. The derivative of this function is 3x^2, 14 00:01:11,214 --> 00:01:19,483 so the derivative at two is 3*2^2 is 3*4 is 12 and not coincidentally, there's a 15 00:01:19,483 --> 00:01:27,205 12 here and there's a 12 here, right, that's reflecting the sensitivity of the 16 00:01:27,205 --> 00:01:32,626 output to the input change. And the derivative of this function at 3 is 17 00:01:32,626 --> 00:01:38,284 3*3^2, which is 3*9 which is 27 and again, not too surprisingly here's a 27, 18 00:01:38,284 --> 00:01:44,252 right? The point is just that how much the output is effected depends on where 19 00:01:44,252 --> 00:01:49,158 you're wiggling the input. If you're wiggling around 2, the output 20 00:01:49,158 --> 00:01:53,679 is affected by about 12 times as much if we're wiggling around 3, the output is 21 00:01:53,679 --> 00:01:57,588 affected by 27 times as much, right? The derivative isn't constant 22 00:01:57,588 --> 00:02:00,654 everywhere, it depends on where you're plugging in. 23 00:02:00,654 --> 00:02:05,164 We can package together all of those ratios of output changes to input changes 24 00:02:05,164 --> 00:02:10,253 as a single function. What I mean by this, well, f'(x) is the 25 00:02:10,253 --> 00:02:17,527 limit as h goes to 0 of f(x+h)-f(x)/h. And this limit doesn't just calculate the 26 00:02:17,527 --> 00:02:23,656 derivative at a particular point. This is actually a rule, right, this is a 27 00:02:23,656 --> 00:02:29,049 rule for a function. The function is f'(x) and this tells me 28 00:02:29,049 --> 00:02:32,885 how to compute that function at some input X. 29 00:02:32,885 --> 00:02:38,137 The derivative is a function. Now, since the derivative is itself a 30 00:02:38,137 --> 00:02:42,368 function, I can take the derivative of the derivative. 31 00:02:42,368 --> 00:02:47,681 I'm often going to write the second derivative, the derivative of the 32 00:02:47,681 --> 00:02:50,335 derivative this way, f''(x). 33 00:02:50,335 --> 00:02:54,370 There's some other notations that you'll see in the wild as well. 34 00:02:54,370 --> 00:02:58,070 So, here's the derivative of f. If I take the derivative of the 35 00:02:58,070 --> 00:03:02,348 derivative, this would be the second derivative but I might write this a 36 00:03:02,348 --> 00:03:06,090 little bit differently. I could put these 2 d's together, so to 37 00:03:06,090 --> 00:03:09,832 speak, and these dx's together and then I'll be left with this. 38 00:03:09,832 --> 00:03:16,753 The second derivative of f(x). A subtle point here is if f were maybe y, 39 00:03:16,753 --> 00:03:24,159 you might see this written down and sometimes people write this dy^2, that's 40 00:03:24,159 --> 00:03:28,217 not right. I mean, it's d^2 dx^2 is the second 41 00:03:28,217 --> 00:03:32,534 derivative of y. The derivative measures the slope of the 42 00:03:32,534 --> 00:03:36,604 tangent line, geometrically. So, what does the second dreivative 43 00:03:36,604 --> 00:03:40,887 measure? Well, let's think back to what the derivative is measuring. 44 00:03:40,887 --> 00:03:45,446 The derivative is measuring how changes to the input affect the output. 45 00:03:45,446 --> 00:03:50,325 The deravitive of the derivative measures how changing the input changes, how 46 00:03:50,325 --> 00:03:55,652 changing the input changes the output, and I'm not just repeating myself here, 47 00:03:55,652 --> 00:03:59,297 it's really what the second derivative is measuring. 48 00:03:59,297 --> 00:04:04,106 It's measuring how the input affects how the input affects the output. 49 00:04:04,106 --> 00:04:07,825 If you say it like that, it doesn't make a whole lot of sense. 50 00:04:07,825 --> 00:04:12,761 Maybe a geometric example will help convey what the second derivative is 51 00:04:12,761 --> 00:04:15,742 measuring. Here's a function, y=1+x^2. 52 00:04:15,742 --> 00:04:16,117 And I've drawn this graph and I've slected three points on the graph. 53 00:04:16,117 --> 00:04:19,027 Let's at a tangent line through those 3 points. 54 00:04:19,027 --> 00:04:23,697 So, here's the tangent line through this bottom point, the point 0,1 and the 55 00:04:23,697 --> 00:04:28,812 tangent line to the graph at that point is horizontal, right, the derivative is 0 56 00:04:28,812 --> 00:04:31,842 there. If I move over here, the tangent line has 57 00:04:31,842 --> 00:04:36,582 positive slope and if I move over to this third point and draw the tangent line 58 00:04:36,582 --> 00:04:41,592 now, the derivative there is even larger. The line has more slope than the line 59 00:04:41,592 --> 00:04:45,049 through that point. What's going on here is that the 60 00:04:45,049 --> 00:04:49,296 derivative is different. Here it's 0, here it's positive, here 61 00:04:49,296 --> 00:04:54,876 it's larger still, right? The derivative is changing and the second derivative is 62 00:04:54,876 --> 00:04:58,352 measuring how quickly the derivative is changing. 63 00:04:58,352 --> 00:05:03,058 Contrast that with say, this example of just a perfectly straight line. 64 00:05:03,058 --> 00:05:08,102 Here, I've drawn 3 points on this line. If I draw the tangent line to this line, 65 00:05:08,102 --> 00:05:11,789 it's just itself. I mean, the tangent line to this line is 66 00:05:11,789 --> 00:05:16,616 just the line I started with, right? So, the slope of this tangent line isn't 67 00:05:16,616 --> 00:05:20,740 changing at all. And the second derivative of this 68 00:05:20,740 --> 00:05:27,932 function, y=x+1, really is 0, right? The function's derivative isn't changing 69 00:05:27,932 --> 00:05:31,919 at all. Here, in this example, the function's 70 00:05:31,919 --> 00:05:38,327 derivative really is changing and I can see that if I take the second derivative 71 00:05:38,327 --> 00:05:42,062 of this, if I differentiate this, I get 2x, and if 72 00:05:42,062 --> 00:05:46,335 I differentiate that again, I just get two, which isn't 0. 73 00:05:46,335 --> 00:05:51,289 There's also a physical interpretation of the second derivative. 74 00:05:51,289 --> 00:05:56,840 So, let's call p(t), the function that records your position at time t. 75 00:05:56,840 --> 00:06:02,054 Now, what happens if I differentiate this? What's the derivative with respect 76 00:06:02,054 --> 00:06:05,443 to time of p(t)? I might write that, p'(t). 77 00:06:05,443 --> 00:06:10,834 That's asking, how quickly is your position changing, well, that's velocity. 78 00:06:10,834 --> 00:06:14,940 That's how quickly you're moving. You got a word for that. 79 00:06:14,940 --> 00:06:21,412 Now, I could ask the same question again. What happens if I differentiate velocity, 80 00:06:21,412 --> 00:06:25,358 I am asking how quickly is your velocity changing. 81 00:06:25,358 --> 00:06:29,417 We've got a word for that, too. That's acceleration. 82 00:06:29,417 --> 00:06:33,292 That's the rate of change of your rate of change. 83 00:06:33,292 --> 00:06:36,677 There's also an economic interpretation of the second derivative. 84 00:06:36,677 --> 00:06:39,882 So, maybe right now dhappiness, ddonuts for me is equal to 0, 85 00:06:39,882 --> 00:06:43,527 right? What this is saying? This is saying how much will my happiness be 86 00:06:43,527 --> 00:06:45,867 affected, if I change my donut eating habits. 87 00:06:45,867 --> 00:06:49,737 If I were really an economist I'd be talking about marginal utility of donuts 88 00:06:49,737 --> 00:06:53,492 or something, but, this is really a reasonable statement, right? This is 89 00:06:53,492 --> 00:06:57,273 saying that right at this moment you know, eating more donuts really won't 90 00:06:57,273 --> 00:07:01,667 make me any more happier and I probably am in this state right now, because if 91 00:07:01,667 --> 00:07:04,160 this weren't the case, I'd be eating donuts. 92 00:07:04,160 --> 00:07:07,484 So, let's suppose this is true right now and now, something else might be true 93 00:07:07,484 --> 00:07:10,128 right now. I might know something about the second 94 00:07:10,128 --> 00:07:13,112 derivative of my happiness with respect to donuts. 95 00:07:13,112 --> 00:07:16,537 What is this saying? Maybe this is positive right now. 96 00:07:16,537 --> 00:07:21,722 This is saying that a small change to my donut eating habits might affect how, 97 00:07:21,722 --> 00:07:25,432 changing my donut habits would affect how happy I am. 98 00:07:25,432 --> 00:07:31,250 If this were positive right now, should I be eating more donuts, even though 99 00:07:31,250 --> 00:07:37,229 dhappiness, ddonuts is equal to zero? Well, yeah, if this is positive, then a 100 00:07:37,229 --> 00:07:43,108 small change in my donut eating habits, just one more bite of delicious donut 101 00:07:43,108 --> 00:07:47,210 would suddenly result in dhappiness, ddonuts being positive, 102 00:07:47,210 --> 00:07:51,176 which should be great, then I should just keep on eating more donuts. 103 00:07:51,176 --> 00:07:55,596 Contrast this with the situation of the opposite situation, where the second 104 00:07:55,596 --> 00:08:00,457 derivative happens with respect to donuts isn't positive, but the second derivative 105 00:08:00,457 --> 00:08:03,265 of happiness with respect to donuts is negative. 106 00:08:03,265 --> 00:08:08,292 If this is the case I absolutely should not be eating any more donuts because if 107 00:08:08,292 --> 00:08:12,962 I start eating more donuts, then I'm going to find that, that eating any more 108 00:08:12,962 --> 00:08:16,692 donuts will make me less happy. Let's think about this case 109 00:08:16,692 --> 00:08:19,787 geometrically. So here, I've drawn a graph of my 110 00:08:19,787 --> 00:08:23,065 happiness depending on how many donuts I'm eating. 111 00:08:23,065 --> 00:08:27,487 And here's two places that I might be standing right now on the graph. 112 00:08:27,487 --> 00:08:31,402 These are two places where the derivative is equal to zero. 113 00:08:31,402 --> 00:08:34,693 And I sort of know that I must be standing at a place where the derivative 114 00:08:34,693 --> 00:08:38,279 is 0, because if I were standing in the middle, I'd be eating more donuts right 115 00:08:38,279 --> 00:08:40,416 now. So, I know that I'm standing either right 116 00:08:40,416 --> 00:08:42,751 here, say, or right here. Or maybe here, or here. 117 00:08:42,751 --> 00:08:45,279 I'm standing some place where the derivative vanishes. 118 00:08:45,279 --> 00:08:48,569 Now, the question is how can I distinguish between these two different 119 00:08:48,569 --> 00:08:53,337 situations? Right here, if I started eating some more donuts, I'd really be 120 00:08:53,337 --> 00:08:56,541 much happier. But here, if I started eating some more 121 00:08:56,541 --> 00:09:00,389 donuts I'd be sadder. Well, look at this situation, this is a 122 00:09:00,389 --> 00:09:05,020 situation where the second derivative of happiness to respected donuts is 123 00:09:05,020 --> 00:09:06,364 positive, right? 124 00:09:06,364 --> 00:09:10,186 When I'm standing at the bottom of this hole, a small change in my donut 125 00:09:10,186 --> 00:09:14,666 consumption starts to increase the extent to which a change in my donut consumption 126 00:09:14,666 --> 00:09:17,705 will make me happier, alright? If I find that the second 127 00:09:17,705 --> 00:09:22,092 derivative of my happiness with respect to donuts is positive, I should be eating 128 00:09:22,092 --> 00:09:25,392 more donuts to walk up this hill to a place where I'm happier. 129 00:09:25,392 --> 00:09:28,061 Contrast that with a situation where I'm up here. 130 00:09:28,061 --> 00:09:32,743 Again, the derivative is zero so a small change in my doughnut consumption doesn't 131 00:09:32,743 --> 00:09:36,780 really seem to affect my happiness. But the second derivative in that 132 00:09:36,780 --> 00:09:40,305 situation is negative. And what does that mean? That means a 133 00:09:40,305 --> 00:09:44,854 small change to my donuts consumption starts to decrease the extent to which 134 00:09:44,854 --> 00:09:48,506 donuts make me happier. So, if I'm standing up here and I find 135 00:09:48,506 --> 00:09:52,283 that the second derivative of my happiness with respect to donuts is 136 00:09:52,283 --> 00:09:55,644 negative, I absolutely shouldn't be eating anymore donuts. 137 00:09:55,644 --> 00:09:59,826 I should just realize that I'm standing in a place where, at least for small 138 00:09:59,826 --> 00:10:04,155 changes to my donut consumption, I'm as happy as I can possibly be and I should 139 00:10:04,155 --> 00:10:07,868 just be content to stay there. There's more to this graph. 140 00:10:07,868 --> 00:10:10,569 Look at this graph again. So, maybe I am standing here. 141 00:10:10,569 --> 00:10:13,972 Maybe the derivative of my happiness with respect to donuts is zero. 142 00:10:13,972 --> 00:10:17,404 Maybe the second derivative of my happiness with respect to donuts is 143 00:10:17,404 --> 00:10:19,623 negative. So, I realize that I'm as happy as I 144 00:10:19,623 --> 00:10:22,544 really could be for small changes in my donut consumption. 145 00:10:22,544 --> 00:10:25,245 But if I'm willing to make a drastic change to my life, 146 00:10:25,245 --> 00:10:29,097 if I'm willing to just gorge myself on donuts, things are going to get real bad, 147 00:10:29,097 --> 00:10:32,313 but then they're going to get really really good and I'm going to start 148 00:10:32,313 --> 00:10:36,987 climbing up this great hill. It's not just about donuts, it's also 149 00:10:36,987 --> 00:10:41,257 true for Calculus. Look, right now, you might think things 150 00:10:41,257 --> 00:10:46,757 are really good, they're going to get worse. But with just a little bit more 151 00:10:46,757 --> 00:10:52,267 work, you're eventually going to climb up this hill and you're going to find the 152 00:10:52,267 --> 00:10:57,787 immeasurable rewards that increased Calculus knowledge will bring you. 153 00:10:57,787 --> 00:10:58,420 [MUSIC]