 One of the more common uses of calculus is in solving what's called an optimization problem. And this is a problem that shows up when we might be interested in when the greatest or the least value of a function describing a quantity is going to occur. So, for example, if the number of units sold decreases as we raise the price, what price should be charged to maximize our revenue? If fuel economy decreases as velocity increases, what velocity will give us the greatest cruising range of a vehicle? Or if an object moves under the influence of a force field, how far will that object get from the center? And in all of these cases, what we're looking for are the greatest or the least values of some function. And we call these the extrema of that function. Now, before we actually solve optimization problems, we have to talk about grammar and syntax. Grammar and syntax is half the battle. In general, if we have some objective function that we're trying to maximize or minimize, we say the following. The function has a maximum value at x equals a. The maximum occurs at x equals a. The maximum value is equal to the function value. And so here's an important distinction. If you want to think about this, we can talk about location. The x value always corresponds to what you might think about as a location. It's where the maximum occurs. At x equals a, it's located here. The actual value itself is always referring to the function value. The maximum value is a function value. Now, we have to go a little bit farther. The extreme value, the maximum or minimum value, is what's called a relative or local maximum or minimum value, if it's greater than any of the things that are close by. And it's an absolute maximum if it's greater than any actual value of the function. And likewise, we flipped the verbs for if we have local or relative minimums and absolute maximums. Absolute minimums. So here's a good way of getting an understanding of the difference between the two of them. Suppose you're in a race, and if you're the winner of the race, you have the least time, the minimum time of anybody else who's run that race that day. And so this is a local, this is a relative minimum, because your time is less than anybody else who's run the race around you. On the other hand, it might not be the fastest the race has ever been run. And so you might not have the absolute minimum time. This is world record time. This is nobody has ever run the race faster. And that may or may not be your time. Well, here's a useful idea to keep in mind. What's important? So in terms of who wins the race, well, what really matters is the relative, the local minimum value. And it doesn't really matter that if somebody in 1973 had a better time that they ran the race faster, that really doesn't affect whether you win the race today. Now those absolute minimums are useful, because again what they do is they correspond to the world record times, the best ever times. But again, the important thing if you're looking at what's going on right in front of you, those relative minimums are the starting point. And only later on do we have to worry about whether we're dealing with absolute extreme values. So here's a general approach. If I consider the graph of y equals f of x, then the extreme values of f of x correspond to the highest or lowest values of, well, y is the same as f of x. So they also correspond to the highest or lowest values of y, which correspond to the highest or lowest points on the graph. So that means if I can get an idea of what the graph looks like, I can get a good sense of where those extreme values are located and what they are. So that suggests the following. First off, we want to find the objective function that we're going to optimize. This is usually the hardest step of the problem. The calculus is easy. This step here is an algebra step. This is a precalculus step. The calculus is easy. The algebra of the precalculus, that's where the difficulty tends to be. Next, I want to find the critical points, and these are going to be the places where the derivative is zero or the derivative fails to exist. And we'll see why those are important. And the reason that we look for these is they are candidates for where the maximum or minimum values are going to occur. We can use this information to find the graph of y equals f of x and determine which of the critical points correspond to a relative extreme value. And then we may have end points, and we might want to determine whether the end points have higher or lower function values than our relative extremes. So let's take a simple example. We want to find the maximum and minimum values of a function over some interval zero to ten. And so I want to begin by differentiating and finding the critical points where the derivative is zero or where the derivative fails to exist. So I'll take my function, find the derivative, and the note that I want to make, the derivative is actually defined everywhere. So there's no place it's undefined. On the other hand, the derivative is zero whenever 3x squared plus 16x minus 12 is equal to zero. So I'll solve that equation, find by using the quadratic formula, I have solutions x equals two-thirds of negative six, and this is just a graphing problem. So I'll plot the critical points. I'll find the sign of the derivatives in each of the intervals, and at this point I can draw my straight line stick figure sketch of the graph. It's going to look something like that. Now, we are interested only in the portion of the graph that exists between x equals ten and x equals zero. So let's go ahead and put in those limits. And the way to read this is nothing outside this interval really matters. I can ignore the section of the graph. I can ignore the section of the graph. I don't have to worry about anything outside those intervals. And so I'm going to look here, and I can see that the lowest point on the graph, the least value of y, and so the least value of my function, is going to occur right here where x is equal to two-thirds. And I can evaluate my function. It's 123, 27, and that's actually the lowest point anywhere in this interval. So there's my absolute minimum. How about the maximum values? Well, I can see from the stick figure sketch that x equals zero, x equals ten are relative maxima on the interval. This x equals zero is higher than any point around it. This point here, x equals ten, is higher than any point around it. Again, the interval outside doesn't exist. But which of those two is higher? Well, I can't judge it based on how I drew the graph. Remember, this is a stick figure. So what do I have to do? Well, I have to actually find the function values. At zero, my function value is 105. At ten, my function value is 1785. And so that tells me that f of ten is the absolute maximum, and f of zero is just going to be the relative or local maximum value. Now this is the first derivative approach. We can actually solve this problem using the second derivative, and this goes back to the idea that you can graph using the first and second derivative. So I am going to start out in the same way. I do need to find the first derivative, find the critical points, and plot them. So that's the same function, so none of those things change. And then I can find the second derivative and evaluate that second derivative at the critical point. So second derivative 6x plus 16 is positive, and this is enough information to sketch the graph. Second derivative positive, first derivative zero, that tells me that the graph is concave up, and this point where the derivative is zero is our low point there, and so our graph looks something like that. And again, I can see we have a relative absolute minimum value here, two relative maximums here and here, and we have to decide which one is going to be our absolute maximum and which one is going to just be a local maximum value. And this is our second derivative approach. Now the important thing to remember is this might seem easier, but the only reason it's easier is that the second derivative is easy to find and evaluate. If I have a more complicated function, the first derivative test may be the easier one. So here's the first derivative test for this function. First find the derivative, and part of what's making this problem challenging is the derivative itself is fairly messy. Now if I want to find the critical points, I'm going to solve this equation, derivative equal to zero, and if I want to make my life easier, I will start by noting that there's a factor that appears in every one of these. Both of them have a 4x minus 7 squared and a 3x minus 8 to the fourth. So I can remove that factor and do a little bit of algebraic simplification, and now I have product equal to zero, and so product equal to zero has solutions when any one of the factors are zero. Now, it's worth pointing out, you have to do this whether or not you're using the first or second derivative approach. The nice thing is that if you do this for the first derivative approach, you actually have everything you need to complete the problem. So let's go ahead and plot those critical points, and it's worth remembering that however messy the derivative looked, we actually factored the derivative as this expression here, and given that we have our derivative in factored form, it's a lot easier to figure out the difference of the derivative in each of the 1, 2, 3, 4 intervals, and so we can figure out those signs, and that's enough to give us our stick figure graph. Looks something like that. Absolute minimum here, and there are no relative or absolute maximum values of our graph. Now, one last thing to note, it doesn't make too much of a difference, but here we're just interested in the locations of the maximum and minimum values. Remember, maximum and minimum values are located at x values, so x equals 6732nd being a local minimum is actually a sufficient answer to this question. We don't need to figure out what the actual function value is as the question is stated. But that's the easy part, so we'll just go ahead and substitute that in, and we find that our local minimum is around negative 38.99. So you say that's a lot of work. Don't be fooled into thinking that the second derivative approach is easier, because the first thing that the second derivative approach has you do is find the derivative, find the critical points, solve derivative equal to 0, and get this solution. Then you need to plot the critical points, and at this point, the second derivative test requires us to actually find the second derivative. So remember our factored form of the first derivative looks something like that, so I can differentiate that, and here it goes, that's what we end up with, and there's my second derivative in a somewhat unsimplified form, but this is how we would actually obtain it if we were to differentiate this expression, and not only that, at this point I now need to evaluate this expression at those critical points. I need to find the value of this thing at x equals 8 thirds, I need to find the value of this at x equals 67 30 seconds, and that's, I would say that's a lot more work, so good luck with it, I'm not going to do that in this video, which is already long enough.