1 00:00:00,012 --> 00:00:05,588 [music] Why do critical points have to include places where the function fails to 2 00:00:05,588 --> 00:00:09,833 be differentiable? Here's a specific example that we can work 3 00:00:09,833 --> 00:00:15,142 through to see why it's necessary to check points of non-differentiability. 4 00:00:15,142 --> 00:00:20,248 You'll notice that I've included some absolute value brackets to introduce some 5 00:00:20,248 --> 00:00:24,888 non-differentiability, okay? Anyway, here's the problem. 6 00:00:24,888 --> 00:00:28,389 Find maximum and minimum values of this function. 7 00:00:28,389 --> 00:00:33,675 X minus the absolute value of x squared minus 2 x, and do it on the interval 8 00:00:33,675 --> 00:00:36,524 between 0 and 3. Well, how do I proceed? 9 00:00:36,524 --> 00:00:41,215 Let's differentiate, okay? So, I differentiate f prime is, well, the 10 00:00:41,215 --> 00:00:46,968 derivative of x is 1 minus the derivative. Okay, whoa, wait, what am I going to do 11 00:00:46,968 --> 00:00:52,712 about differentiating this absolute value? I can rewrite this function as a piece 12 00:00:52,712 --> 00:00:56,271 wise function, getting rid of the absolute value. 13 00:00:56,271 --> 00:01:00,110 So, here's the original function where I got an absolute value, and remember what 14 00:01:00,110 --> 00:01:03,176 absolute value does. Absolute value negates this input if the 15 00:01:03,176 --> 00:01:06,353 input's negative, right? So, the absolute value guarantees that 16 00:01:06,353 --> 00:01:09,770 it's output is positive with the same magnitude as the original input. 17 00:01:09,770 --> 00:01:14,582 So all I've got to do to rewrite f as a piece-wise function is to deal with that, 18 00:01:14,582 --> 00:01:17,586 right? I've just got to make sure that if this 19 00:01:17,586 --> 00:01:22,835 input is negative, then I better flip the sign, the sign of the absolute value. 20 00:01:22,835 --> 00:01:27,593 Now, I want to know the derivative of this function and I can compute that by just 21 00:01:27,593 --> 00:01:31,451 differentiating each piece in my piece-wise define function. 22 00:01:31,451 --> 00:01:34,938 So, here I go. I'm going to differentiate these two 23 00:01:34,938 --> 00:01:38,789 pieces separately. So, the derivative of f is also now a 24 00:01:38,789 --> 00:01:42,685 piece-wise function and I should differentiate this. 25 00:01:42,685 --> 00:01:47,824 The derivative of x is 1 minus the derivative of this which is 2 x, that's 26 00:01:47,824 --> 00:01:52,488 the derivative of x squared, and the derivative of 2 x is just 2. 27 00:01:52,489 --> 00:01:57,100 And this is if x squared minus 2 x. So, bigger than zero. 28 00:01:57,100 --> 00:02:03,815 And the derivative of this is 1 plus the derivative of this, which is 2 x minus 2. 29 00:02:03,815 --> 00:02:08,076 And this is if x squared minus 2 x is less than zero. 30 00:02:08,076 --> 00:02:14,546 And you'll notice that I'm careful to change the greater than or equal to here 31 00:02:14,546 --> 00:02:19,592 to just greater than. And the reason is because this derivative 32 00:02:19,592 --> 00:02:23,799 is not going to be defined when this quantity is equal to 0. 33 00:02:23,799 --> 00:02:26,954 Now, it is time to hunt for critical points. 34 00:02:26,954 --> 00:02:33,208 So, to simplify our hunt for the critical points, I can rewrite f prime a little bit 35 00:02:33,208 --> 00:02:37,050 to make it a little bit easier to see what's going on. 36 00:02:37,050 --> 00:02:42,454 So, what can we do here? Well, 1 minus 2 x minus 2, that's the same 37 00:02:42,454 --> 00:02:46,571 thing as three minus 2 x and 1 plus 2 x minus 2. 38 00:02:46,571 --> 00:02:53,530 That's the same thing as minus 1 plus 2 x. Alright, and then I can rewrite this x 39 00:02:53,530 --> 00:02:59,491 squared minus 2 x greater than 0, and x squared minus 2 x less than 0. 40 00:02:59,491 --> 00:03:05,841 To say that x squared minus 2 x is bigger than 0 is the same as saying that x is 41 00:03:05,841 --> 00:03:12,601 less than 0, or x is bigger than 2, and to say that this is less than 0 is just to 42 00:03:12,601 --> 00:03:19,049 say that x is trapped between 0 and 2. Alright, now that I've got this nicer way 43 00:03:19,049 --> 00:03:25,253 of writing the derivative I can very visibly see that something terrible is 44 00:03:25,253 --> 00:03:31,441 happening when, when x is equal to 2. Because if this thing were differentiable 45 00:03:31,441 --> 00:03:37,124 there, you'd expect this quantity and this quantity to agree when x equals 2. 46 00:03:37,124 --> 00:03:39,945 But these things disagree when x is equal to 2, alright? 47 00:03:39,945 --> 00:03:43,980 So, this function ends up not being differentiable at 2. 48 00:03:43,980 --> 00:03:49,714 Where is this thing equal to zero? Well, 3 minus 2x would vanish if x were 3 49 00:03:49,714 --> 00:03:52,946 halves. But 3 halves doesn't satisfy this. 50 00:03:52,946 --> 00:03:58,055 So, this first thing never results in a critical point where the derivative 51 00:03:58,055 --> 00:04:00,051 vanishes. What about this? 52 00:04:00,051 --> 00:04:04,862 What about minus 1 plus 2 x? Well, this is equal to 0 if x is equal to 53 00:04:04,862 --> 00:04:07,372 a half. And that is in this region. 54 00:04:07,372 --> 00:04:14,748 So here, what we know the derivative is equal to 0 if x is equal to a half and the 55 00:04:14,748 --> 00:04:19,581 function's not differentiable when x is equal to 2. 56 00:04:19,581 --> 00:04:23,743 Well, a function's also not differentiable when x is equal to zero. 57 00:04:23,743 --> 00:04:28,357 But remember, the end points of our interval that we're considering are 0 and 58 00:04:28,357 --> 00:04:30,699 3. So, if you like, you can include 0 as a 59 00:04:30,699 --> 00:04:35,244 point of non-differentiability. But, it's in this list of end points so 60 00:04:35,244 --> 00:04:40,747 we're going to have to consider it anyhow. Note that there's something really special 61 00:04:40,747 --> 00:04:44,581 in this particular example. I really want to emphasize that 2 is a 62 00:04:44,581 --> 00:04:49,341 critical point not because the derivative is equal to 0, but because the function is 63 00:04:49,341 --> 00:04:53,759 not differentiable at the .2. So, to finish off this problem, to find 64 00:04:53,759 --> 00:04:58,905 the minimum and maximum values of my function f, all I have to do is check the 65 00:04:58,905 --> 00:05:03,746 critical points and the endpoints. So, here's our endpoints, 0 and 3, a place 66 00:05:03,746 --> 00:05:07,962 where the derivative vanishes when x is equal to 1 half and a place where the 67 00:05:07,962 --> 00:05:10,624 derivative is not defined when x is equal to 2. 68 00:05:10,624 --> 00:05:14,990 And where were the original function is? Alright, f of x is x minus the absolute 69 00:05:14,990 --> 00:05:19,313 value of x squared minus 2 x. So, what do we get when I plug in 0? 70 00:05:19,313 --> 00:05:23,844 I just get 0. And when I plug in 3, I also get 0, right? 71 00:05:23,844 --> 00:05:30,843 3 minus, well, 3 squared is 9 minus 2 times 3, that's 9 minus 3, that's 3. 72 00:05:30,843 --> 00:05:35,509 3 minus 3 is also 0. When I plug in 1 half, I get minus a 73 00:05:35,509 --> 00:05:38,756 quarter. And when I plug in 2, I get 2. 74 00:05:38,756 --> 00:05:43,412 So, I've got my table. Where is the maximum and where is the 75 00:05:43,412 --> 00:05:47,331 minimum? So, the minimum value is here, when x is 76 00:05:47,331 --> 00:05:52,446 equal to 1 half, the functions minimum value is minus quarter. 77 00:05:52,446 --> 00:05:58,683 And the maximum value is when x is equal to 2, the function's output is 2. 78 00:05:58,684 --> 00:06:03,784 Had I not been careful to include x equals 2, the point where the function fails to 79 00:06:03,784 --> 00:06:07,877 be differentiable,. I would have totally missed out on finding 80 00:06:07,877 --> 00:06:12,511 the maximum value of this function. It's really easy to see why this is so 81 00:06:12,511 --> 00:06:17,525 important by taking a look at a graph. We'll use the graph of this function x 82 00:06:17,525 --> 00:06:22,316 minus absolute value of x squared minus 2 x on the intervals 0 to 3. 83 00:06:22,316 --> 00:06:27,966 And you can see the minimum value occurs when x is equal to 1 half and the maximum 84 00:06:27,966 --> 00:06:32,918 value occurs when x is equal to 2. And that point really is a place where the 85 00:06:32,918 --> 00:06:37,818 function's not differentiable. I mean, that's exactly why I see a corner 86 00:06:37,818 --> 00:06:40,464 there. The upshot here is that a point of 87 00:06:40,464 --> 00:06:46,152 non-differentiability, a place where the function fails to be differentiable could 88 00:06:46,152 --> 00:06:49,164 very well be where the maximum value occurs. 89 00:06:49,164 --> 00:06:55,638 You can think of calculus as a maximum finding machine and you're trying to find 90 00:06:55,638 --> 00:07:01,355 those maximum values. So, if Calculus fails you at some place, 91 00:07:01,355 --> 00:07:09,475 if the maximum finding machine is broken for some particular input, that could very 92 00:07:09,475 --> 00:07:17,045 well be where the maximum value is hiding. So, you're going to need to check there.