 So it turns out that extreme points come in one of a few different ways from the examples we saw before we see a couple of pictures here. So the one we're going to see the most often is going to be something like this that you have like we'll just focus on maximum for a moment. Similar examples could be drawn for minimum, minimum values. So if you have a maximum value, what likely is going to happen is you get this graph with this nice rounded term. The function goes from increasing on the left hand side to decreasing on the right hand side. And in particular, at the point where it switches from increasing to decreasing, you see that there's this horizontal tangent line. The tangent line is very flat. It's perfectly flat at the top at this maximum value. And this happens exactly when the derivative is equal to zero. But on the other hand, like we saw with the absolute value, it could be that you go from increasing to decreasing. You know, I went from increasing to decreasing. You see that shift that makes it a maximum value, but it wasn't in a smooth transition. There was a sharp corner. There's some type of ouch, you touch it and then, you know, sleeping beauty goes to sleep for a hundred years. You got to watch out for those things. Well, because there's a sharp corner, this actually means that the derivative is undefined. The derivative doesn't exist at that point. So for searching for extreme, we can find them with horizontal tangent lines when the derivative is equal to zero or we can find them when the derivative is undefined. And then because of the boundary, we see that if you are on the boundary of the curve, there was no increasing. But if you start to decrease, that would give you a local maximum. And if you're on the right side of the boundary, if you were increasing, but then suddenly stop at this boundary point, that also would be a maximum. So boundary points make sense because of the sudden start or stop. Those could easily be extrema. But what about these places in the middle which have horizontal tangent lines or no tangent lines? In fact, turns out these ones will be hiding inside the middle of the domain. So that leads us to our next definition. We say that a critical point of a function is a point C comma F of C. So this has the X and Y coordinates there. It's a critical point if the derivative is zero at that point or the derivative is undefined at that point. So those are like the pictures we saw earlier. Does it have a rounds transition or a sudden transition because of sharp point? Turns out that if your derivative is undefined, a lot of other weird stuff can be going on as well. Now, because of a theorem due to Fermat, if a function F has a relative extrema at C, then it turns out that this C corresponds to a critical point or a coincides with the endpoint of the domain. So it turns out the only way you can get an extrema where the four pictures we saw before, your derivative is zero, your derivative is undefined or you're on the boundary is the only way we can get an extreme value. So let's consider those for examples. So definitely if you're on the boundary, we can see where that can be an extrema. That doesn't have to be an extrema, right? This is something we have to be very cautious about. If a number is on the boundary, it doesn't mean it's an extrema. If a number is a critical number, that doesn't mean it's necessary on the extrema. Take, for example, the function Y equals X cubed, for which if we graph that real quick, its graph would look something like the following. This graph has no extrema, Y equals X cubed. Notice if I take the first derivative, you're going to get 3X squared. When is this thing equal to zero? That happens exactly when X equals zero. So the origin represents a critical point on the graph. It's critical, but it's not an extreme value. It's not an extreme point. So we see why if a point is critical, then it's not necessarily an extrema. What we're saying, though, is if you have an extrema, it has to be on the boundary or it has to be a critical point. So let's assume it's not a boundary point. We can see how that's taken care of. Well, what if it's a critical point? Critical points mean the derivative is either zero or the derivative is undefined. So let's throw out that possibility. Let's assume that the derivative does exist at C. We then have to argue that if it's an extreme value and the derivative exists, then the derivative has to equal zero. And for the sake of argument, let's assume that C is a local maximum. The case of a local minimum is handled similarly. And so what we anticipate, our graph is on the graph. We anticipate something like the following. We have some maximum value for which there's a neighborhood. So we have our maximum value here, C comma F of C, right? My picture seems to suggest that it should have a horizontal tangent line, but I'll show you exactly why that is from this theoretical point of view. So we have these other points, A comma F of A. And then we have this point right here, B comma F of B, F of B. All right. So if you, in terms of the X coordinate, if you are somewhere in this neighborhood, let's just say that it's a delta neighborhood. So this is a circle, a circle whose radius is equal to delta. So if the distance between X to C is less than delta, then because it's a local maximum, that implies that the Y coordinate will be less than F of C for all numbers inside of this neighborhood right here. Now, if F of X is less than F of C, less than or equal to F of C, you could subtract F of C from both sides. We're going to get that F of X minus F of C is less than or equal to zero. So it's non positive, it's zero, or it's a negative number. Now, if X is bigger than C, so it's to the right of C, that means X minus C is positive, and if you take a negative divided by a positive, that'll be a negative value. So F of X minus F of C over X minus C is less than or equal to zero. Notice we have a difference quotient right here. If I take the limit as X approaches C from the right, because again, we're considering we're a little bit bigger than C, if we take the limit of the difference quotient, because the difference quotient is less than or equal to zero, the limit of the difference quotient will be less than the limit of zero, which since it's a constant, it has to be zero. This is the right handed limit. But of course, if we consider the other side, what if X is a little bit less than C? Well, that means X minus C will be negative. And if you take a negative value and divided by a negative, that actually gives you a positive. So F of X minus F of C over X minus C is greater than or equal to zero. So we this time get that the difference quotient is positive. If we take the limit of the difference quotient, that should be greater than or equal to the limit of zero, which must necessarily is equal to zero. So notice what we see here is that the right handed limit of the difference quotient is zero, the left handed limit of the difference quotient is zero. And since the limit of the difference quotient exists, because that's the derivative, F is differentiable at C, we see that the two-sided limit of the difference quotient must be less than or equal to zero and greater than or equal to zero. How many numbers can you think of that are less than or equal to zero and greater than or equal to zero? Oh, there's not a lot. F prime of C has to be between sandwiched between zero. Oh, it's equal to zero itself. And that improves that the derivative of an extreme value, if it exists, must equal zero. That is, you must have a horizontal tangent line at an extreme value. If the derivative exists.