1 00:00:00,012 --> 00:00:06,389 [MUSIC] We're going to calculate the derivative of x squared with respect to 2 00:00:06,389 --> 00:00:10,372 x. maybe a little bit more prosaically, I 3 00:00:10,372 --> 00:00:13,893 want to know how wiggling x affect x squared? 4 00:00:13,893 --> 00:00:18,366 There's a ton of different ways to approach this. 5 00:00:18,366 --> 00:00:22,462 Let's start by looking at this numerically. 6 00:00:22,462 --> 00:00:27,068 So let's start off by just noting that 2 sqyared is 4, 7 00:00:27,068 --> 00:00:32,097 and I'm going to wiggle the 2 and see how the 4 wiggles. 8 00:00:32,097 --> 00:00:36,516 Instead of plugging in 2, let's plug in 2.01. 9 00:00:36,516 --> 00:00:42,018 2.01 squared is 4.0401. And let's just keep on going with some 10 00:00:42,018 --> 00:00:45,672 more examples. 2.02 squared is 4.0804. 11 00:00:45,672 --> 00:00:51,742 2.003 squared, say, is 4.012009. Alright, so those are a few examples. 12 00:00:51,742 --> 00:00:57,336 I've wiggled the inputs, and I've seen how the outputs are affected. 13 00:00:57,336 --> 00:01:03,398 And of course the, all the outputs are close to 4, alright? But they're not 14 00:01:03,398 --> 00:01:07,651 exactly 4. When I wiggled the input from 2 to 2.01, 15 00:01:07,651 --> 00:01:13,681 the output changed by about .04, and a little bit more, but that'ts a lot 16 00:01:13,681 --> 00:01:17,781 smaller. When I wiggled the input from 2 to 2.02, 17 00:01:17,781 --> 00:01:24,001 the output changed by about .08, not exactly .08, but pretty close to .08. 18 00:01:24,001 --> 00:01:29,492 And when I wiggled from 2 to 2.003, the output changed by about. 19 00:01:29,492 --> 00:01:33,469 About .012 and a little bit more, but, you know, it's close. 20 00:01:33,469 --> 00:01:38,491 Now look at the relationship between the input change and the output change. 21 00:01:38,491 --> 00:01:43,004 The input change by .01, the output change by 4 times as much, about. 22 00:01:43,004 --> 00:01:47,029 The input change by .02, the output change by 4 times as much. 23 00:01:47,029 --> 00:01:51,662 The input change by .003, the output change by about 4 times as much. 24 00:01:51,662 --> 00:01:57,421 I'm going to summarize that. The output change is the input change 25 00:01:57,421 --> 00:02:03,024 magnified by 4 times. Right? The input change by some factor. 26 00:02:03,024 --> 00:02:07,632 And the output change by about 4 times that amount. 27 00:02:07,632 --> 00:02:12,372 Let's see this at a different input point. 28 00:02:12,372 --> 00:02:20,200 Instead of plugging in 2, let's plug in 3 and see what happens. 29 00:02:20,200 --> 00:02:25,581 So 3^2 is 9, but what's, say 3.1^2? That's 9.61. 30 00:02:25,581 --> 00:02:33,487 Or what's 3.01^2? Well, that's 9.0601. maybe wiggle down a little bit. 31 00:02:33,487 --> 00:02:39,667 What's 2.99 squared? That's close to 3 but wiggling down by .01. 32 00:02:39,667 --> 00:02:44,757 That's 8.9401. Let's see how much roughly the output 33 00:02:44,757 --> 00:02:49,237 changed by. When I went from 3 to 3.1 the output 34 00:02:49,237 --> 00:02:56,002 changed by Out point 6. When I went from 3 to 3.01, the output 35 00:02:56,002 --> 00:03:04,919 changed by about .06, and when I went from 3 down to 2.99, the output when down 36 00:03:04,919 --> 00:03:09,292 by about .06 again. Little bit less. 37 00:03:09,292 --> 00:03:14,674 Now what's the relationship between the input change and the output change? Well 38 00:03:14,674 --> 00:03:19,737 here the input changed by .1, the output change by .6, about 6 times as much. 39 00:03:19,737 --> 00:03:24,502 Again, the input change by .01, the output changed by About six times as 40 00:03:24,502 --> 00:03:27,369 much. And when the input went down by .01 the 41 00:03:27,369 --> 00:03:30,211 output went down by about six times as much. 42 00:03:30,211 --> 00:03:35,194 So again, we're seeing some sort of magnification of the output change to the 43 00:03:35,194 --> 00:03:39,951 input change, but now it's magnified not by four times But by six times. 44 00:03:39,951 --> 00:03:44,393 So the important lesson here is that the extent to which wiggling the input 45 00:03:44,393 --> 00:03:47,588 affects the output depends on where you're wiggling. 46 00:03:47,588 --> 00:03:52,278 If you're wiggling around 2, the output is being changed by about four times as 47 00:03:52,278 --> 00:03:54,970 much. If you're wiggling the input around 3, 48 00:03:54,970 --> 00:03:58,362 the output is being change by about six times as much. 49 00:03:58,362 --> 00:04:03,992 Instead of doing just a few numerical examples, let's generalize this by doing 50 00:04:03,992 --> 00:04:07,812 some algebra. So, I'm starting with x^2 and I'm going 51 00:04:07,812 --> 00:04:13,432 to wiggle x and see how x^2 is effected. So, instead of plugging in x, I'll plug 52 00:04:13,432 --> 00:04:16,992 in x + something, let's call the change in x, h. 53 00:04:16,992 --> 00:04:24,876 Now I want to know, how is this related to x ^ 2? Well I can expand out (x+h)^2, 54 00:04:24,876 --> 00:04:31,426 that's x^2+2xh+h^2. So when I wiggle the input from x to x+h, 55 00:04:31,426 --> 00:04:39,692 how is the output being affected? Well the output, is the old output value plus 56 00:04:39,692 --> 00:04:45,418 this change in output value 2xh+h^2, h^2 is pretty small. 57 00:04:45,418 --> 00:04:52,476 When h is small, h^2 is really small so I'm going to throw that away for now. 58 00:04:52,476 --> 00:04:59,907 And just summarize this by saying that the output change is 2xh and the input 59 00:04:59,907 --> 00:05:01,227 change. Is h. 60 00:05:01,227 --> 00:05:07,797 Now the derivative is supposed to measure the relationship between the output 61 00:05:07,797 --> 00:05:12,992 change and the input change. So I'm going to take the ratio of the 62 00:05:12,992 --> 00:05:18,972 output change to the input change, and 2xh/h=2x, as long as h isn't 0. 63 00:05:18,972 --> 00:05:23,947 This is the ratio of output change to input change and that makes sense, right? 64 00:05:23,947 --> 00:05:28,992 Think back to what just happened here a minute ago, when we were plugging in some 65 00:05:28,992 --> 00:05:32,532 nearby values and seeing how the outputs were affected. 66 00:05:32,532 --> 00:05:37,622 When I was wiggling the input around 2, the output was changing by about twice 2. 67 00:05:37,622 --> 00:05:43,814 When I was wiggling the input around 3, the output was changing by about twice 3, 68 00:05:43,814 --> 00:05:48,315 alright? 2x is the ratio of output change to input change. 69 00:05:48,315 --> 00:05:54,457 If the algebra's not really speaking to you, we can also do this geometrically, 70 00:05:54,457 --> 00:05:58,809 like drawing a picture. Here's a square of side length x. 71 00:05:58,809 --> 00:06:02,673 The area of this square is not, coincidentally, x^2. 72 00:06:02,673 --> 00:06:06,749 Now I want to now the derivative of x^2 with respect to x. 73 00:06:06,749 --> 00:06:11,498 I want to know how changing x would affect the area of this square. 74 00:06:11,498 --> 00:06:17,188 Now to see this here is another square. This is a slightly larger square of side 75 00:06:17,188 --> 00:06:20,542 length x+h. h is a small but positive number. 76 00:06:20,542 --> 00:06:26,662 So how does the area of this new square compare to the area of this old square? 77 00:06:26,662 --> 00:06:32,652 Let me put the old square on top of the new square, and you can see that when I 78 00:06:32,652 --> 00:06:37,522 change the input from x to x+h, I gained a bit of extra area. 79 00:06:37,522 --> 00:06:43,607 The derivative is recording the ratio of output change to input change. 80 00:06:43,607 --> 00:06:49,817 So, I want to know what's the ratio of this new area as compared to just the 81 00:06:49,817 --> 00:06:54,633 change in the input H. So, let me pull off the extra area. 82 00:06:54,633 --> 00:06:58,512 There is extra area, is this L shaped region. 83 00:06:58,512 --> 00:07:04,900 How big is this L shaped region? Well, this short side here, has side length h. 84 00:07:04,900 --> 00:07:10,569 This side length here, is also h. This is the extra length that I added 85 00:07:10,569 --> 00:07:15,962 when I went from x to x+h. This inside has length x, and this inside 86 00:07:15,962 --> 00:07:20,896 edge has length x. Now I want to know the area of this 87 00:07:20,896 --> 00:07:25,032 region. To see that, I'm going to get out my 88 00:07:25,032 --> 00:07:29,728 scissors and cut this region up into 3 pieces. 89 00:07:29,728 --> 00:07:37,148 Now here's one of those pieces. And, here's another one of those pieces. 90 00:07:37,148 --> 00:07:43,430 And, here's the third piece. So these are the 2 long thin rectangles, 91 00:07:43,430 --> 00:07:46,981 and they've both got height h, and length x. 92 00:07:46,981 --> 00:07:50,962 I'm also left with this little tiny corner piece. 93 00:07:50,962 --> 00:07:57,211 And that little tiny corner piece has side length h, and the other side is also 94 00:07:57,211 --> 00:08:00,222 length h. It's a little tiny square. 95 00:08:00,222 --> 00:08:04,892 Well the limit, this little tiny corner piece, is infinitesimal. 96 00:08:04,892 --> 00:08:10,344 I'm going to throw this piece away and most of the area is left in these 2 long, 97 00:08:10,344 --> 00:08:13,833 thin rectangles. If I rearrange these long, thin 98 00:08:13,833 --> 00:08:16,982 rectangles a bit, can put them end to end. 99 00:08:16,982 --> 00:08:23,322 They've both got height h. So I can put them next to each other like 100 00:08:23,322 --> 00:08:26,982 this. And their base is both length x. 101 00:08:26,982 --> 00:08:34,032 So how much area is in this long thin rectangle? Well, it's height h, it's 102 00:08:34,032 --> 00:08:37,212 width is 2x. So the area is 2x * h. 103 00:08:37,212 --> 00:08:43,142 Now this is the additional area, excepting for that little tiny square, 104 00:08:43,142 --> 00:08:48,614 which we gained when I changed the size of the square from x to x + h. 105 00:08:48,614 --> 00:08:51,915 So the change in output is about 2 * x * h. 106 00:08:51,915 --> 00:08:58,177 The change in input was h, so the ratio of output change to input change Is 2 * 107 00:08:58,177 --> 00:09:01,192 x. Maybe what we're doing here seems a 108 00:09:01,192 --> 00:09:05,312 little bit wishy washy, not really precise enough. 109 00:09:05,312 --> 00:09:11,637 But we can also calculate the derivative of x ^ 2 with respect to x, by just going 110 00:09:11,637 --> 00:09:16,142 back to the definition of derivative in terms of limits. 111 00:09:16,142 --> 00:09:22,723 Carefully, f of x is x^2. And the derivative of f is by definition 112 00:09:22,723 --> 00:09:29,424 the limit as h approaches 0. F of x plus h minus f of x, the change in 113 00:09:29,424 --> 00:09:37,462 output divided by h, the change in input. In this case f of x plus h is just x plus 114 00:09:37,462 --> 00:09:44,382 h squared and f of x is just x squared. I'm dividing by h. 115 00:09:44,382 --> 00:09:54,213 I can expand this out. This is the limit as h approaches 0 of 116 00:09:54,213 --> 00:10:01,882 ((x+h)^2-x^2)/h. Now I've got an x^2-x^2, so I can cancel 117 00:10:01,882 --> 00:10:10,082 those, and I'm just left with the limit, as h approaches 0, of (2xh+h^2)/h. 118 00:10:10,082 --> 00:10:17,782 More good news, in the limit I'm never going to be plugging h=0, so I can 119 00:10:17,782 --> 00:10:24,741 replace this With an equivalent function that agrees with it when h is close to 120 00:10:24,741 --> 00:10:29,027 but not equal to 0. In other words, maybe a little bit more 121 00:10:29,027 --> 00:10:34,632 simply, I'm canceling an h from the numerator to the denominator. 122 00:10:34,632 --> 00:10:38,902 So, 2xh over h is just 2x and h^x over h is just an h. 123 00:10:38,902 --> 00:10:43,922 Now what's the limit of this sum? Well that's the sum of the limits. 124 00:10:43,922 --> 00:10:49,185 It's the limit of 2x as h approaches 0 + the limit of h as h approaches 0. 125 00:10:49,185 --> 00:10:54,918 Now as far as wiggling h is concerned, 2x is a constant, so the limit of 2x as h 126 00:10:54,918 --> 00:10:59,745 approaches 0 is just 2x. And what's the limit of h as h approaches 127 00:10:59,745 --> 00:11:04,032 0? Well, what's h getting close to when h is close to 0. 128 00:11:04,032 --> 00:11:08,694 That's just 0. So, this limit is equal to 2x and that's 129 00:11:08,694 --> 00:11:14,188 the derivative of x^2. What that limit is really calculating is 130 00:11:14,188 --> 00:11:20,518 the slope of a tangent line at the point x and we can see that it's working. 131 00:11:20,518 --> 00:11:26,342 This is the graph of y=x^2. At -4 the slope of the tangent line is -8 132 00:11:26,342 --> 00:11:31,205 At 2, the slope of the tangent line is 4, and, at 6, the slope of the tangent line 133 00:11:31,205 --> 00:11:34,043 is 12. There's a ton of different perspectives 134 00:11:34,043 --> 00:11:36,923 here. We've been thinking about the derivative 135 00:11:36,923 --> 00:11:42,038 of x ^ 2 with respect to x, numerically, algebriaically, geometrically, going back 136 00:11:42,038 --> 00:11:46,659 to the definition of derivative in terms of limits, looking at it in terms of 137 00:11:46,659 --> 00:11:50,634 slopes of tangent lines. What makes derivatives so much fun is 138 00:11:50,634 --> 00:11:54,979 that there just so many different perspectives on this single topic, no 139 00:11:54,979 --> 00:11:58,654 matter how you slice it. We've shown that the derivative of x 140 00:11:58,654 --> 00:12:03,325 squared with respect to x is 2 times x. Maybe you like algebra, maybe you like 141 00:12:03,325 --> 00:12:06,481 geometry, maybe you just like to play with numbers. 142 00:12:06,481 --> 00:12:11,632 But now matter what your interests are, derivatives have something to offer you. 143 00:12:11,632 --> 00:12:20,157 [MUSIC]