0:00

Welcome to calculus. I'm Professor Griest, and we're about to

begin lecture 14 on optimization. One of the best applications of

derivatives is to a class of problems you may have called max min.

The modern terminology is optimization. In this lesson we'll use derivatives to

compute maxima and minima for optimization problems, solving some that

are simple, and some not so simple. Optimization theory is a wonderful class

of problems to which calculus applies. In optimization you ask, what is the

best? How do you maximize profit?

How do you minimize drag on an airplane wing?

How do you find the best route through a complex network?" These are all aspects

of optimization. A simple question to which calculus can

be applied is, given a function, what is its maximum, or minimum value?

Well, I'm sure you've seen something along these lines before, but let's step

back and think for a moment. If we have a function and we take a close

look at its graph, then one of the things we can observe is that if we are at a

place where the derivative is non-zero, then we are certainly not at a maximum or

a minimum, because if we zoom in and look at the local behavior at a point where

the derivative is not zero. Then, because, derivatives can note rates

of change. Then, if the derivative is negative, that

means the function is, decreasing, locally.

On the other hand, if the derivative is a positive value, then the function is

increasing, locally, as we increase. The input.

Now of course we can run that observation in reverse if we do have a maximum or a

minimum and the derivative exists there. Then it must be equal to 0.

This motivates the following definition. A critical point of a function f is an

input a at which the derivative vanishes. So for example if we look at a location

where there is a minimum that's a critical point, if we look at a location

where there is a maximum that too. Is a critical point.

However, there are critical points that are neither maxima nor minima, such as an

inflection point. And, in general, the collection of

critical points for a function is strictly larger than the collection of

extrema. Places where you have a max or a min.

Now, things are a bit more complex than this, really.

What happens if we have a function that is discontinuous, or not differentiable

at a point, or not defined at a certain input?

Well, a lot of different things can happen: maxima, minima, neither.

We want to expand our definition of a critical point to include, as well, those

locations at which things go bad, such as where the derivative is undefined.

The classification of critical points into maxima, minima, or neither, is

subtle. You may recall the wonderful second

derivative test that is so helpful. Recall that at a critical point, x equals

a, you have a minimum if the second derivative at a is bigger than zero.

You have a maximum if that second derivative at A is less than 0.

If your second derivative is 0, or is undefined, then you have a fail.

The test does not tell you whether it's a minimum or a maximum or neither.

4:24

Now these are only local minima or maxima since we're just using derivative

information. And some students get things mixed up.

What do you do? Is it positive for a minimum or positive

for a maximum? Negative?

Which is it? I'll leave it to you to come up with a

way to remember how this goes. Now, why is it that the second derivative

test works? Well, as with the case of L'Hopital's

rule, there's a good reason. And Taylor series allow us to see that

reason transparently. Consider what happens at a critical

point, x equals a. If we Taylor expand f about that point.

Then what can we say? Well, because we have a critical point.

The first derivative vanishes. Then with that gone away and ignoring all

of the higher order terms that is terms of degree 3 and greater what do we see f

looks like quadratic, you have a constant term and them the leading term after that

is quadratic. In x minus a.

That means, ignoring the higher order terms, that the graph looks locally like

a parabola. The parabola would open up if the

coefficient in front of the second degree term, is positive.

That would open down, if the coefficient is negative.

Therefore we see that the sign of that second derivative at A, tells us whether

we have a local maximum or a local minimum.

Let's consider the simple example, sine squared to x times log of cosine of x.

This has a critical point at x equals zero.

What happens when we Taylor expand? Sine of x becomes x plus big O of x

cubed. We square that, and then multiply it by

the log of what? Well 1 minus x squared over 2 plus big O

of x to the 4th. We have a little bit more expansion to

do. Taking the sign squared term, and

expanding that out. And then, expanding log of 1 plus

something into, in this case. Negative x squared over two plus big 0 of

x to the fourth. Now when we multiply these three

expansions out, the leading order term is given by the product of x, x, and

negative x squared over 2. That is, we get a negative one-half x to

the 4th plus big O x to the 6th. And we can see why we didn't use the

second derivative test here, because it would've given us a 0, a fail.

However, we can conclude that this really is a local maximum at 0.

Because of this coefficient, negative one half in front of x to the 4th.

So what does that mean? Have we, have we just invented the fourth

derivative test? No, nothing that exciting.

We've just done Taylor Expansion. Instead of relying on specialized tasks,

rely on the principles. In this case, taylor expand to see what's

happening. Let's do a simple example.

Consider a square of side length l out of which cut the four corners we remove four

square of equal size and then fold at the internal edges to get an open topped box.

I want you to maximize the volume of that box with respect to what we remove.

If we remove larger squares we might get a smaller volume box.

If we remove smaller squares, then we might get a smaller volume Box.

What is the maximal volume? Well in this case, we better set x to be

a variable; in this case, the side length of the corners that we remove.

Then in this case, the volume is what? Well when we fold it up, the height of

the box is x. And the length of the base is quantity L

minus 2 X. So the volume is X times L minus 2 X

quantity squared. Multiplying that out gives 4 X cubed

minus 4 L X squared, plus L squared times X.

Now remember, x is the variable and l is a constant.

So that when we differentiate with respect to x, we get 12 x squared minus 8

l x plus l squared. This factors nicely as 6 x minus l times

2 x minus l. And we wanta factor that because we're

going to compute the critical points. Setting that directive equal to zero

solving get us two critical points. One that x equals L over 2 and the other

that x equals L over 6. We must classify these as maxima or

minima, or neither. At best we can, so we'll take the second

derivative, which we can compute to be 24x minus 8l.

Evaluating that second erivative at the ritical points gives us what...

At L over 2, it gives us 4 L. That's a positive number and that means

that we have a minimum or a local minimum at that point at x equals l over 6.

The second derivative is negative 4 L. That gives us local maximum.

Of course this fits with your intuition if X is equal to L over 2.

Then what is happening when you fold up that box?

Oh well you're getting something with volume 0.

That's clearly a minimum. We therefore conclude that the volume is

maximized. At x equals l over six but notice the

problem is asking us for the maximum volume not the value of x at which the

volume is maximized. So we need to substitute back in x equals

l over six into v. To get 2l over 3, that's l minus 2x,

squared, times x, or l over 6. Simplifying that gives us 2l cubed over

27. That is the maximum volume.

11:56

Let's look at another example. In this case, extremize the function f of

x equals x cubed over 3, minus 3 x squared, plus 8 x minus 2.

And here the extremization is with some constraint, mainly we want x to be bigger

than or equal to 0. So no negative values.

Let's proceed the same way that we compute the derivative of f then we get x

squared minus 6 x plus 8 to compute the critical points we're going to want to

factor this as x minus 2 times x minus 4. And so, setting that equal to 0 gives us

a pair of critical points, x equals 2 and x equals 4.

To classify them, let's compute the second derivative of f.

That is simply 2x minus 6. And so we see that at x equals 2, we have

a maximum with a value of 14 thirds. At x equals 4, the second derivative, is

positive. So we have a minimum, a minimum at a

value of 10 3rds. However, that is not the end.

These are local extrema. The problem is to find the global maximum

and minimum. When you're asked to find a global max or

min. You must check the endpoints of your

domain. These endpoints are critical points since

the function and/or its derivative may not exist there.

Let us therefore check the endpoints of our domain.

Remember our constraint is that x must be bigger than or equal to zero.

Therefore the left hand end point is at x equals zero.

What do we see there? Well, the value that the function takes

on is negative 2. This is a minimum, since it is less than

the other critical values that we have computed.

In fact, this is the global minimum for the function.

Are there any other critical points that we have to look at?

Well there's not really a right hand end point to the domain, since it is

unbounded. But if we tweak the language a little

bit, we can say that infinity is a critical point.

What is the function doing at infinity or more properly, as x goes to infinity?

Well, you can see that because the leading order term is x cubed over 3, the

function tends to infinity. And therefore, we have a maximum, a

global maximum. Taking on the value of infinity at this

right hand endpoint. Now of course, all of this would be

fairly obvious if you drew the graph of the function.

You would see the difference between the local max and the local min that we have

computed. And the global minimum and maximum at the

left and right hand endpoints respectively.

Always check your endpoints. This lecture was the best, or maybe it

was the worst. You're going to have to compute a few

derivatives to find out for sure. In our next lesson, we're going to turn

from the concrete notion of a dirivative to the suttly different idea of a

differencial.