Mathematics - Multivariable Calculus - Lecture 17


Uploaded by UCBerkeley on 04.11.2009

Transcript:
Next Thursday is the big day, next Thursday.
OK?
Every day is a big day.
But next Thursday's a bigger day then some.
I'm sorry, this Thursday.
What did I say?

Well you know that different countries say next
in a different way.
So yes, the Thursday of this week.
So let me correct that.

I said it in the European way, OK?
But I'm glad you know.
I don't have to tell you.
OK, settle down.
Don't you wish it were next Thursday though?

Well you shouldn't have corrected me.
OK, so the exam will be here for everybody except for
the students of Dario.
If your TA's name is not Dario, then you should be here.
And if you don't know the name of your TA, then
you shouldn't be here.
By now, you should remember the name of your TA.
And this concerns only the students which attend
the sections of Dario.
And they will meet in a different place, OK?
Now there's a lot of information which I posted
online, on the class homepage.
Which you have a link on this space.
This space is really the master page for which you have
a link to everything.
So in particular, you have the information about
the midterm exam.
You have the mock midterm exam.
You have review problems.
OK?
And after the class today, I will post the solutions to the
review problems for the midterm exam as well as the solutions
for the last homework assignment.
OK?

I just want to mention, I want to emphasize one thing, which I
already mentioned last time.
Which is that you will be allowed to have one page
of formulas like before-- standard size, on one side--
exactly the same drill.
Don't use the one which you used last time, because that
would make it two-sided.

You can use whatever you want.
You could even write your favorite poetry
for inspiration.
As long as it's hand-written and on one side of a standard
size sheet of paper.
But don't take your old cheat sheet and then
write on the back.
That's not acceptable.
Any questions about the logistics?
I'm sorry?
Yes.
If you have room on the same side, yeah sure.
But don't write on the back of the cheat sheet
that you had before.
One side should be empty.
It should be blank, written with invisible ink perhaps.
Any other questions about the logistics?
Everybody's very excited about Thursday, this Thursday,
next Thursday?
OK no more questions?
You have a question?

How is the class curved?
It's all explained here.

Well it's not strictly speaking, a question about
the upcoming midterm.
So let me just say this.
If there is a difference between sections we will
make adjustments for this.
Don't worry about it.
My experience though, is that it almost never happens.
The way it's set up is it's set up in such a way so as
not to let that happen.
So don't worry.
Everybody is in the same boat.
Everyone is in the same position, on equal footing.
The question was about quizzes, how quizzes in different
sections, how are they going to be a accounted if
there's a difference?
And I said that if there's a difference in quiz scores in
different sections, we'll make adjustments for it.
But in my experience, that almost never happens.
Because we actually take precautions for that.
Alright, now a review of the material for the midterm.

The midterm will cover the material after the
first midterm exam.
This is not to say that you should forget everything you
knew before the first midterm.
Because, of course, some of that material is
used implicitly.
We are building on a lot of things that we've learned
before the first midterm, like equations of planes, equations
of lines, and things like that, parameter curves, and so on.
OK?
But there will be no focus on the material before
the first midterm.
In other words, there wouldn't be a problem which is going to
be solely solved by means of the material that was learned
before the first midterm.
Yes?

You wouldn't need to like, parameterize?

If that is something which was discussed after the first
midterm, than perhaps yes.
But in a way it was discussed before the first midterm.
Do you see what I mean?
Okay so now let me go over this is material.
Let me summarize it, and kind of give an overview.
As I said many times, you can break calculus into two big
parts: differential calculus and the integral calculus,
or integration calculus.
Which are in some sense, opposites to each other.
So this material that we are talking about now can also be
broken into two big parts.
One is about differential calculus and the other one
is integral calculus.

Differential calculus came first.
We first talked about that.
And then the most recent lectures we devoted to
the integral calculus.
Let me first talk about the differential calculus.
What are the main points here that you need to know?
OK, the first one is the directional derivative.

If you have a function in two variables, and you fix the
point, then you have many different derivatives that
you can take of this function at this point.
The derivatives are parameterized by the choice
of a direction vector.
And the direction vector, which we usually denote by u, has two
components ab, is the unit vector.

Which is to say that it's norm, or length-- which is just a
squared plus b squared, square root is 1.
And the directional derivative of the function f, with respect
to such a vector at this point, can be given by
different formulas.
But the one which we use the most is a formula as a dot
product, between u and another vector, which is determined by
the function and the point, which is called a
gradient vector.

What is a gradient vector?
It's a vector which has two components.
And the first one is a derivative, or the partial
derivative of this function at this point, with respect to x.
And the second one is the derivative with respect to y.
So we put two partial derivatives together as
components of a vector.
And that's what we call the gradient vector.
And the directional derivative was best understood as a dot
product between that gradient vector and the direction
vector, which in the usual sense.
OK, so what can we learn from this formula?
So first of all, what is the meaning of this
directional derivative?
The meaning is it gives us the rate of change,
over function f.
Add the point x 0, y 0 in the direction of u.

And from this formula, we can obtain information about
the directional derivative.
For example, we can find out in what direction we can achieve
the maximum possible rate of change, the maximum possible
direction of the derivative.
So the maximum value of this directional derivative is
achieved when we take vector u to go in the direction
of the gradient.
Now naively, we will just say that it is equal
to the gradient.
But we don't want to do that because this is not
necessarily a unit vector.
The convention is that the direction vector-- it's called
a direction vector-- the direction vector has
to be a unit vector.
So what we need to do is we need to normalize this.
We have to divide by the lengths of this.
I'm skipping the x 0, y 0, to just simplifying notation.
So we have to divide by the length.
If we devide by the length-- the resulting length--
the resulting vector will have length 1.
So it will be a unit vector.
So that's the maximum value.
Maybe I should say that maximum value is achieved
if u is equal to this.
And what is that value?
And the directional derivative, with respect to u, is equal to
just the absolute value, the norm of the gradient vector.
Because when you take the dot product, you're going to get
in the numerator, the square of the norm.
And then you'll divide by the norm, so you'll
end up with the norm.
That's the maximum value.
Now the minimum value, minimum value is when you take
the opposite direction.
Which it kind of makes sense.
You achieve the steepest ascent in one direction, and the
steepest descent will be achieved in the
opposite direction.
So this will be minus.

OK?
And what is the value?
It's going to be minus, nabla.
And finally, you can get zero value, if u is perpendicular--
is this clear, perpendicular-- to the gradient vector.
By the way, how do you find a perpendicular vector?
Suppose you have a vector ab.

And you want to find a vector which is perpendicular to it.
You just take negative ba.
Because then if you multiply, if you take the dot product,
you get negative ba plus ba, which is zero.
So it is a very simple rule to find a perpendicular vector.
But of course, keep in mind, that what we need to do here
to find u, we have to take the gradient.
Let's call it alpha beta because I don't want to
confuse it with u, itself.
OK?
And so we just switch them and put a negative sign
in front of one of them.

But then you have to normalize it.
So you have to divide this.
Divide the square root of alpha squared plus beta squared.
So for the maximum and the minimum, there is
a unique solution.
It's the gradient vector divided by it's norm, and
minus the gradient vector divided by it's norm.
But for the direction for which there derivative is zero,
there are two solutions.
Because if this is u, then you have two different-- sorry if
this is nabla f if this nabla f, there are vectors, which are
unit vectors and are perpendicular to it--
this one and this one.
This is u 1, and this is u 2.
So if you have a question on the test to find the directions
in which the directional derivative is equal to zero,
you have to give two answers, right?
You have
to give this one, and this one.
So in fact, it's this vector.
And it's negative, it's plus, minus.
For both of these, the dot product is zero.
OK.
And we talked about the meaning of directional derivative,
what it presents.
It presents the rate of change.
And the fact that the gradient vector, the vector of steepest
discent is actually a vector perpendicular to
the level curve.
Which brings us to the next topic, which is tangents
and normals to level curves and surfaces.

So a level curve is a curve on the plane which is given by the
equation f of xy equals some k.
So that's level curve, right?
And the level surface is something like this, but when
you have three variables.
So it's a surface in a 3-dimensional space.
This is level surface.
In most cases, k is a number.
So this is a number.
And you look at all solutions.

For example, if f is x squared plus y squared, this would
present circles, if k is positve.
And likewise if here, say, if you have x squared plus y
squared plus z squared, this will be spheres,
centered at the origin.
And so now, suppose you have a point on this level curve, this
level surface, then we can talk about tangent lines here,
tangent planes here, normal lines in both cases.
So say x zero, y zero is a point on this level curve.

So then the normal vector is the gradient vector.
So this is closely related, in fact, to the discussion of the
rate of change, or the directional derivatives.
Because the best way to think about the level curves, is
to think in terms of maps.
On the maps, usually, or often times, you have these curves.
And we've gotten really used to this.
It gives us a good understanding of the landscape.
Because each curve responds to the points of equal height
over the sea level.
And so you can think of this as a picture of a mountain.
And the climber could be somewhere here.
Function f would be the contour of the mountain.
More precisely, the graph of the function f, would be the
entire contour of the mountain.
Which would be something like this.
And here we're just looking at the level curves
of that mountain.
So finding directional derivative would be a question
of finding how quickly a climber would be climbing or
discending, if he or she were going in a certain direction.
So that would be vector u.
So if you were given vector u, you can ask, what
is rate of change?
What is the rate of climb?
And, of course, from this point of view, it's clear how you
would achieve the highest, the steepest ascent, the steepest
climb exactly, if you would go perpendicular to
the level curve.
And so a vector perpendicular to a level curve, is
a gradient vector.
Or if you want the steepest discent, it would
have to be negative.
It's negative, so that's nabla f.
And so everything is consistent because we know just
algebraically from this calculation, we know that the
maximum rate of change, the maximum directional derivative,
is achieved in the direction of the gradient.
And geometrically we know that the gradient is the normal, or
perpendicular vector, to the level curve.
So both of those two statements fit very well together, right?
Because, intuitively, it's clear that you will achieve
the maximum rate of change precisely as you go
perpendicular to the level.
And also the zero directional derivative would correspond
going along the slope, which would be parallel to the slope.
It would be perpendicular to the gradient.
So if you have this picture in mind, then all of this becomes
very real-- not abstract, but real-- very concrete.
OK?

So what does it mean, it's a normal vector?
So for example, you could be asked to write down the
equation of a normal line to the level curve.
So you can write the equation of the normal line just simply
by using the way in which we learned before, at the very
beginning of this course.
So the equation of the normal line would be the easiest to
write it in parametric form.
So sometimes you may be asked to parameterize something.
But in conjunction with some higher math, if you will,
finding gradient vectors and normal lines so that would be x
0 plus, let's say this is alpha beta just as before-- so this
would be alpha t, and this would be y 0 plus beta t.
And also you can be asked to write the equation
of the tangent line.
Which you can easily write by using this information.
And likewise, here, if you have a function in three variables,
you also have a gradient vector, which now has
three components.
So it's f sub x, f sub y, and f sub z, evaluated
at those points.
And this is, again, the normal vector.
And so, for example, again you can be asked to write an
equation of a normal line.
And you do it in exactly the same way as here.
And you can also be asked to write the equation
of the tangent plane.
And the equation of the tangent plane would be simply f sub x
times x minus x 0, plus f sub y, y minus y 0 plus f
sub z, z minus z 0.

So here we kind of encroach on the territory of
the previous midterm.
Because at the very end of that segment of the course, just
before the first midterm, we discussed the differential and
the tangent planes, to graph the functions.
And this can be viewed as a special case of this
finding tangent planes to general level surfaces.

Tangent plane to the graph, to the level surface.

So in fact, I devoted quite a bit of time at one of the
lectures about a month ago, explaining the connection
between tangent planes for levels surfaces in general,
and tangent planes to graph the functions.
And at that time, I explained that graphs respond to a
special case of level surfaces.
The case where-- let me erase something.
So for graphs, graph f is equal to some function f of xy.
Let me write it this way.
You have a function of three variables which, in fact, is
determined by a function of two variables, f xy minus z.
So the level surface for this, simply corresponds
to z equals f of xy.
So it gives you the graph of the functions F capital.
And so, being a special case, you can also use this general
formula to describe the tangent plane.
So what will happen is that here you will get negative 1.
This will be-- in this special case-- it will be negative 1.
So the question will simplify.
OK?
So that's what you need to know essentially.
By the way, when I talk about the rate of change and
directional derivatives here, I talk about functions
in two variables.
But in fact, the same analysis can be applied to functions
in three variables.
You just need a unit vector in three space as u.
And then the same formula would define the directional
derivative for a function in three variables.
Again it will involve the gradient, which is now given
by this formula, these three components, and so on.
And again the maximum will be achieved in the direction
of the gradient, the minimum in the opposite
direction, and so on.
There will be more than two vectors now for
this last condition.
There will be a whole variety of vectors which are
perpendicular to the gradient.
Any questions about this?

OK.
Suppose that f is given by this formula.
In this case, what is f sub z?
The partial derivative of z is negative 1, right?
So that means, in this case, the equation for the tangent
plane, will be like this.
Where instead of this, you'll just have negative 1.
So it will then take the usual form: z minus z
0 is equal to this.
And that's the formula for the equation of the tangent
plane to graph a function.
Which we studied just before the first midterm was done.
So maybe it's a good idea to review that, just in case.
Because it's an important special case of the story.
It was kind of a slight and natural break.
The first midterm came just after we did this, but before
we talked about tangent planes to general surfaces.
So it probably makes sense.
It would probably be a good idea to review those couple
of sections just before the first midterm.
OK.
And other questions?
I'm a little pressed on time.
So I'm a little worried that I will not be able to talk
about some other focus.
If I have time left then I'll come back to this.
Is that OK?
So what's next?
The next big topic here is maximum and minimum, the
maximum minimum of functions.
And this can be viewed as an obligation of the
differential calculus.
So what do you need to know here?
First of all, you have to remember that there are
two types of maximum and minimum-- the local ones
and the global ones.
And there's a totally different game, finding the local ones
and finding global ones.
So let's talk about the local first.
The local ones are the ones which are just kind of
little bumps, could be just little bumps.
They're not necessarily Kilimanjaro, you know,
or a big mountain.
And it could be just a little bump somewhere on the street.
That's what the local maximum is, or likewise,
minimum-- a little bit.
So, in other words, the value at that point should be greater
than values that are even in a very, very small
neighborhood of that point.
And that's where we could do well, by simply
applying derivatives.
And by analogy with 1-dimensional case.
So the first criterion that we have, for having a local
maximum or minimum, is the first derivative criterion.
Simply put, if they're saying the falling, that suppose
if f of xy has local maximum or minimum.
So there's a word for this: extremum, plural
would be extrema.
So let's call it extremum.
Because otherwise I have to say always maximum,
minimum, maximum, minimum.
It's too much.
So as local extremum, at some point x 0, y 0, and its partial
derivatives at this point exist, then they have
to be equal to zero.
They have to equal zero.
So this is the first test.
In other words, if it is a local minimum or maximum, and
the partial derivatives exist, then they both have to vanish.
The converse, however, is not true.
If both partial derivatives vanish, it does not
mean that it is a local maximum or minimum.
You have a question?
Yeah I knew that.
It's always the case.
I try to save some space, but then I have to
go and do it again.
So I lost more time and more space.
So I mean the two partial derivatives, this f of x.
Let's just do it that way.

Is that better?
OK.

So converse is not true, which we discussed in even
the 1-dimensional case.
Think of y equals x cubed.
The function x cubed has a vanishing derivative, but
the graph looks like this.
Point zero is not the point of maximum or minimum.
But there is a test which involves second derivatives.

So there's a second derivative that mainly we form
as a fallen quantity.
We think the xx of 0 y 0 times fyy of 0 y 0 minus fxy.

This is assuming, of course, that all of this exists.
All of the derivatives exist.
They're not continuous at this point.
So the test is the following: that if D is greater than zero
and fxx x 0 y 0, it's a minimum.
OK I'm abbreviating.
Then x 0 y 0 is a minimum.
If D is greater than zero and fxx x 0 y 0 is less than
zero, than it's a maximum.
Right?
I mean x 0 y 0 is local-- local minimum, local maximum.
And if D is less than zero, then it's what's called a
saddle point, so neither maximum or minimum.
And the saddle is what you get when you look at what is
called hyperbolic paraboloid.
Yes?
Yes it is.
So if you remember, we had this figure, one of the fanciest
quadric surface that we discussed, the hyperbolic
paraboloid, which looks like a saddle.
So if you go in some direction, you fall down.
But if you go in other directions, you go up.
So it's neither maximum nor minimum, locally.
So if D is less than zero than that's the kind
of point you have.
So that's how you know it's not.
But otherwise there is no information if D is zero.
If D is zero, it could go either way.

We didn't talk much about why this criteria is true.
I only made a few comments.
The point is that to understand it you should really look
at just quadric surfaces.
Because, as we discussed, the first approximation to
function, is a linear function.
In the words, you approximate it by the first derivatives.
And the next level of approximation is given by
quadratic derivatives.
But two functions have the same quadratic derivatives if they
have the same sort of tailored expansion in degrees 1 and 2.
And the higher order, in terms of an expansion, they don't
really matter locally.
When you look at it locally.
So to understand what's going on here, you should look
no further than quadratic functions-- functions which
are polynomials of degree 2.
Combine degree 2 in x and y.
And for such functions this expression is
actually a number.
And if you just plug this formula, some of your favorite
examples, like an elliptic paraboloid and hyperboloids in
these kinds of functions, you will see how these
criteria work.
And the reason why we choose this fancy combination of
second derivatives, the point is that the behavior of the
graph is not necessarily determined by the coefficients
of the polynomial, but they're determined by, sort
of, the main axis.
When we talked about quadratic functions and quadric surfaces,
we talked about the fact that you can always make a change of
variables to bring it to a nice form.
Well when you bring it to a nice form, you will get a
very simple expression for the second derivatives.
And then this will become simple form meaning, ax
squared plus by squared.
If you bring it to such a form, you will see that this is a,
and this is b, and this is zero.
because there's no cross term.
So for such a function, if f is this function,
D is equal to ab.
And so then you can very easily see what those scenarios
correspond to.
Because D greater than zero, and fxx greater than zero,
means that a is positive and b is positve.
So we're dealing with the paraboloid.
The graph of this function is a paraboloid, it is
an elliptic paraboloid, which it goes like this.
So clearly we have a minimum.
This case corresponds to both a and b being negative.
So that's an upside down paraboloid, maximum.
And when it's less than zero, it means that one of them is
positive and one of them is negative.
And that gives you the hyperbolic parabola.
So this is a way to understands this criteria, by simply
looking at such expressions, at such functions.
And then a more general quadratic function can be
always brought to this form.
And what tells you what the D is for that form,
is this expression.
Anyway we don't need to get too much into detail
of this criterion.
You just have to know this criterion.
And you should understand it for this particular function--
how it works, ax squared plus by squared.
OK, so that takes care of the local maximum and minimum.
And in some sense, it's a little bit disappointing
because we don't have a conclusive criteria.
But the same is true also for functions in one variable.

If you just use first and second derivatives, you cannot
really make a conclusive statement, in general, whether
it has local maximum or minimum.
So it's not so surprising.
So what's more pleasant in some sense, is the case of
global maximum and minimum.
In this case we can usually find the complete solution by
following a basic algorithm.
So let's talk about this, global.
So global maximum and minimum is a totally different game.
Where you are actually given the certain region, say if it's
a function and two variables, you are given the region in R2.
Or if it's a function in 3 variables it would
be a region in R3.

You have to find points within that region only.
You don't care about what happens outside, only within
that region where the function takes the maximum
and minimum values.
So the algorithm here, consists of essentially two steps.
Although you can sometimes phrase it in terms of two
steps, sometimes in terms of two steps.
But basically, the first step would be to
find global extrema.
First of all, you have to find points in D where both
partial derivatives vanish.
These are the points which are suspicious because of the
first derivative criterion.
Because those could be the points of local
maximum and minimum.
And local maximum and minimum could put that, and should be
global maximum and minimum as well.
So we have to find all of those points.
In fact, you don't have to look at-- in this part of the
algorithm-- you don't have to look at the boundary.
Because the second part of the algorithm takes care
specifically of the boundary.
When you write theses formulas, if you get a
point on the boundary, you include it as well.
And so the second part is to focus exclusively
on the boundary.
To focus on the boundary and find extrema on the boundary--
to find the extrema of the function restricted
to this boundary.
So here there are basically, essentially two different ways,
two different approaches.
If the boundary is linear, in other words, if it is given by
a linear equation, like x equals 5, or x plus
y equals zero.
You can simply substitute this equation into the function and
get a function in 1 variable.
And then solve the problem by doing functions in 1 variable.
So the first possibility is boundaries given
by linear equations.
What linear really means is degree 1 in x and y.
Example: let's say f is equal to x squared plus y squared,
and the boundary, 1 component or 1 segment of the boundary,
is say x plus y equals zero.
Well, then you can simply express y in terms of
x, y equals negative x.
And you can substitute it into this formula.
So instead of a function in two variables, which you originally
have, you will see that when this function is restricted to
the boundary, it effectively becomes a function in
1 variable, namely x.
So you get that this restriction to this x plus y
equals zero is just, you know, x squared plus negative x
squared, which is 2x squared.
So you had a function in two variables, but on the boundary,
it becomes an effective function in 1 varible.
If you have a very complicated equation for the boundary, you
may not be able to easily express y in terms of x, or
x in terms y, and then substitute.
But if it's a linear equation, you can always express easily,
one the one in terms of the other.
And then you simply substitute.
and then the remaining variable will be the only variable left.
You'll get a function in 1 variable.
So then, just solve the problem by using the methods of the
calculus of 1 variable.
You just look at where the derivative of the function
vanishes on that.
Well in general it's not going to be this entire line.
It's going to be some interval of this line.
Like I said, it's only a component of the boundary.
In general the boundary is going to have many components.
For example, a boundary could have this, a component.
And then it could have part of a circle as another component.
So except, of course, I didn't draw the right thing.
This is not x plus y equals zero, but x equals y.
OK, let's do it the right way.
This is x plus y equals zero.

OK?
So maybe this is not good, because I don't want to write
it like it's-- my function is x squared plus y squared.
Let's just make it something complicated.
It could be something like this.
I'm not saying I will put exactly this one on the exam.
I'm just saying, for the sake of the argument,
just as an example.
So you could have this very simple component, like this.
When you restate your function, and it becomes a function one
variable, you can choose which one, x or y.
You express the other one in terms of this.
The original one, so y in terms of x.
Substitute, get a function in one variable.
Solve the problem.
Namely find the extreme of the function on this interval
by using methods of one-variable calculus.

That's the first possibility.
The second possibility, you have something like this.
Which is given by a much more complicated function.
Rather than x plus y, it could be something with higher
degrees or even some more complicated functions
altogether.
In this case, this method will not work, because you will not
be able to easily express one variable in terms of the
other, and substitute.
So you have to use something else.
That something else is Lagrange Method.
So I would say this is what I call, 2a.
So that's the easy method.
And the slightly more complicated method,
is Lagrange Method.

So Lagrange Method is about, in this case, is about solving
a system of equations.
So in this case, your component of the boundary would be given
by the equations g of xy equals k.
Reduce the function.
You will write the following equations.
You will write nabla f-- f is the function which you tried
to maximize or minimize-- is lamda nabla g.
And then you also have g of xy equals k.
So solve this system.
And then of course there is an additional issue, which is,
that there could be corners.
There could be points which are not smooth on the boundary.
And these have to be treated separately.
I mean you can think of treating not separately, but
you can think of treating them within the context of 2a or 2b.
Because when you do that, you have to take care of
the endpoints anyway.
Or you can just think of corners as a separate entity,
a completely separate entity, and just put them on the
list at the very end.
But you have to include them.
So the way I explained it, is you do the corners.
Which by corners, I mean points which are not smooth points.
Like in this case, these two.
So basically it boils down to the full length.
You might have a sort of an easy case where the
boundaries are smooth.
For example the boundary could be an ellipse.
This is exactly the example which we studied
originally in class.
And in this case, there are no corners.

There are no corners so you don't have to worry about it.
You just do Lagrange Method here.
OK?
But if you have something like this, then you have corners.
And you have to take care of them separately.
Or you can think of that, of taking care of them, as part
of analyzing the segments of the boundary.
Is that clear?

Will Lagrange point find them for us?
That's a very good question.
Lagrange will not necessarily find them for us.
For exactly the same reason why the endpoints would not
necessarily be found just from the one-variable calculus,
from finding points with the derivative zero.
What was the issue if you had a function in one variable?
Let's say you have a graph of a function.
Let me do it in this way.
Here is a very good illustration.
Here, this, is the maximum point.
Which is also a local maximum.
So we will catch it at the first step if we were doing it
for a one-variable function.
But this is a minimum.
And its a minimum not because the derivative vanishes.
The derivative is not zero.
But because it's the endpoint.
Because we can't go any further.
Likewise, here, remember we had a discussion about how there
were two points, which were the points where the level curve of
the function f, were tangent.
Level curves of the functions f-- which in my example back
then was a linear function we're touching-- were tangent
to the level curve, to the constraint to this curve.
OK, great.
But what if my curve ended here?
With if my curve was just like this?
From here, to here.
Then, OK, I would catch this one as the minimum,
just like here.
So it would actually be given to me by Lagrange.
But what about maximum?
Lagrange would give me this.
Which is actually part of a statement.
Because my picture could be like this.
My domain could be like this.
And what would happen in this case, actually, is that
the maximum would be achieved at the corner.
So just because it's Lagrange Method, it doesn't mean that
it doesn't have its own limitations.
It has the same limitations as other methods, that
we have studied, which involve derivatives.
It's a very good question.
It's a very good point.
Yes?
That's a good question.
So the question is do we have to worry about saddle points
when we're doing global maximum and minimum.
And the answer is no.
Precisely because it's a different sort of a game.

We'll certainly catch them in part one.
Because in part one, we are just grabbing all the points
we can get, where the derivatives are zero.
So in particular we'll get a lot of saddle
points in general.
I guess I didn't finish the algorithm.
The point is that, of course, at the end of the day, we're
going to just evaluate our function as all
of these points.
That's saddle points, we'll just get rid of them
in a natural way.
Because they will just turn out to be fake.
They will not be maximum or minimum.
So maybe I should say that the end of the algorithm is to
evaluate function f at all of these points, and find
maximum and minimum-- possibly multiple.
It could be that there are two different points where
you'd get the same values.
So you have to list them all.
So if a question on the test is, give all of the maximum
and minimum of this function on this domain.
And let's say this function has two maximum-- two points where
it takes the same maximum value-- and you only give one.
Then obviously you will lose some points on this.
Because this would not be a complete answer.
A complete answer would have to include all of the points with
maximum value, as well as points with minimum value.
Now there are a couple the tricky points here, as far as
Lagrange Method is concerned, which I wanted to emphasize.
Well first of all, I want to stress that Lagrange Method
is used in two entirely different types of problems.
The first problem is a problem like I just described.
Where you have a 2-dimensional domain, and you want to find
global maximum and minimum.
And then you have worry about the interior of this domain.
And then you worry about the boundary.
And when you get to the boundary, if the boundary
is complicated, you have to use Lagrange Method.
But there's a different type of problem altogether, where you
just are asked to find maximum and minimum on a level curve.
In other words, you don't have the interior.
You don't have a 2-dimensional region with a boundary.
But you just have a curve.
In that case, of course, you don't need to do part one.
You just do the Lagrange Method for this curve, and that's it.
See so that's an important thing to remember.
You have to understand what the problem is.
If you are asked to just analyze the curve, you don't
have to see what happens in the interior.
In all of this discussion, I assumed-- so maybe
I will write it.
Lagrange Method can also be used to find maximum and
minimum on the curve, like this, g of xy equals k.
So in this case, there's no interior.

So you don't have to deal with the partial derivatives in
the interior, and so on.
Just apply Lagrange Method to this.
And there are actually, a couple of tricky points which
we did not talk about in class, but which were part of some of
the homework exercises which I wanted to draw your
attention to.
So the tricky points are-- there are two tricky points--
where the Lagrange Method doesn't work in the best
possible way as explained here.
And the tricky points are, first of all this works.
Maybe I will just say it in one sentence.
This works well, the method works well if first of all,
this curve is bounded-- if the curve does not go to infinite.
This is actually something we did talk about in class.
I did give an example like this.
If, number 1, the curve is bounded.
Bounded means that it is like this, as opposed to something
which goes to infinite.
But more precisely, bounded means that you can cover it by
a sufficiently large radius.
On the homework, there was actually kind of
a tricky exercise.
Which, I think it was something like x cubed plus y cubed
equals 1, or something.
And it looks deceptively simple because it looks almost
like x squared plus y squared equals 1.
So this is bounded.
This is bounded because it's a circle of radius 1.
But this is not bounded.
So this is an important point.
And the reason is, of course, that here you have a sum of
squares, and squares are always positive, or zero, if the sum
of squares is equal to 1.
This is the sum of 2 numbers which are
positive and equal to 1.
This means that each of them has to be less than 1,
between zero and 1.
And that puts the bounds, of course x and y, can on be
between 1 and negative 1.
That's why it's bounded.
But here you have cubes.
And cubes can be both positive and negative.
So x could go to plus infinite and y go to minus infinite, as
long they adapt to 1, which is very easy to find.
So I'm not going to try to draw this.
But this is not bounded for sure.
Because x could be arbitrarily large.
And then y would be just the negative of that.
So for such a curve, all bets are off.
In the sense that it may not have a maximum or a minimum.
Or it may not even have either.
We talked about this.
So be careful when you apply Lagrange Method.
For example, it is very tempting-- say
you get 2 points.
And it's very tempting to say that one of them is a maximum
and the other one is a minimum.
That would be true if, in fact, the curve is bounded.
On the bounded curve, it has to have a maximum and it
has to have a minimum.
And if you got 2 solutions for the Lagrange Method, that
means, 1 of them has to be maximum and 1 of them
has to be minimum.
You just evaluated.
They would have to have different values, so you will
know which one is which.
But I think in this problem, I forgot, either there was only
1 point, you got 1 point.
Which is like wow, why do I get only one point?
If it's a maximum, where is the minimum?
If it's a minimum, where is the maximum?
Or maybe there were 2 points, but you had the same value.
Which is like, even worse because what does it mean?
So if they're both maximum and minimum, does it mean the
function is constant.
Well it's not constant.
So the solution of this, the resolution of this paradox, is
that when the curve is not bounded, which is in this
case, you may not have a maximum or minimum.
Or you may be in a situation where you don't have either.
So you have to take this into account.
That's number 1.
And there is one more little trick, which is the other
thing that could happen.
This is that in this equation, the equation which we use for
Lagrange Method, it is perfectly OK for
nabla f to be zero.
Because that would correspond to the solution where
lambda is equal to zero.
But it could happen, also, that nabla g is zero.
And if nabla g is zero and nabla f is not zero,
that would correspond to lambda equaling infinite.
So you wouldn't be able to solve this.
So this is one remaining possibility which we haven't
really talked about.
But there was at least one exercise on our homework
where this was the case.
So you have to also be careful about this.
In fact, this point, where nabla g is zero, and also this
equation still satisfies, there are actually corners.
There are actually singular points of this curve.
So in that sense, they kind of get under the rubric of
corners so they have to be analyzed separately.
But by just looking at the equations, you may not
realize it right away.
Because you have to really visualize it.
So just keep in mind, that if something's going funny, like
if the method doesn't work quite the right way-- if you
get only one solution, or you get two solutions with the same
value of the function-- see if the curve is bounded.
See if there is a possibility that this is equal to zero.
Because you have to include those points separately.
And then of course, when you are solving this kind of
equation, you have to be always careful when you cancel out
things from both sides of the equation.
You know that, right?
If you cancel things out, it means that they are not zero.
It means you're dividing by these quantities.
So you have to allow for the possibility that
they are equal to zero.
And this may be where your lost solutions are.
I'm purposefully spending more time on this differential
part of that.
Because we talked about integrals for the
last three weeks.
And this is something which came earlier, so I kind
of wanted to make more emphasis on that part.
But the good news for you, is that you are not responsible
for the case when there are two constraints.
Somehow I expected a more enthusiastic response.
OK, thank you.
Because I was thinking, why am I even bothering saying this?
Maybe they should be responsible for it.
No?
OK.
All right.

That's right, well that's the problem.
So if you didn't know what I meant, then that's a
problem for everybody.
In the book-- let me explain.
Don't explain it to your neighbor.
In the book, at the very end of the chapter, a section
on Lagrange multipliers.
There is a discussion on two constraints.
This is called constraint.

This is called constraint.
And this is Lagrange Method of a single constant.
Because here we have two variables, and we impose one
equation or constraint.
So we end up with a curve.
If we impose a second constraint here, we'll get
a finite number of points.
This is not interesting.
With a finite number of points, there will be no derivatives.
You just evaluated those points and that's it.
But if you consider the case of 3 variables, then you could
have 2 possible choices.
If you could have a situation like this, where simply you
would just have a third variable.
That's a single constraint.
And 2 constraints means you have another age of xyz.
And then what you need to do, is you need to write lambda
nabla g plus mu nabla h.
So it becomes much more complicated.
And actually I did not put any problems of this
type on the homework.
And you are actually not responsible for this.
So maybe I shouldn't have even mentioned it.
Now maybe people what will get more worried about
it, just to be clear.
Any questions about this?
Any other questions about maximum or minimum?
Yes?

Very good.
So the question is, if the curve is now bounded,
how do we see if it's a maximum or a minimum?
Well in this example, I forgot already now-- but I did this
example I think, or something very similar in class.
And in that case, you just have to look in the neighborhood
of this point.
If you move slightly away from the point you have found, does
the function grow, or decrease?
Does it increase or decrease?
And that's how you know.
If you move a little bit and the value of the function
becomes larger, OK, that's the minimum.
Do you see what I mean?
So that's how we do it.
OK, so let's now spend the remaining time to talk about
the integral calculus.
This is something which we have been doing just
in the last few weeks.
But it's a good idea to briefly summarize stuff as well.
So what do we need to know about integrals?

So we studied integrals of 2 different kinds.
There are double integrals and there are triple
integrals, right?
So double integrals.
There are integrals over 2-dimensional domain of a
functions of 2 variables.
And triple integrals are integrals of functions in 3
variables over 3-dimensional regions, like a box like this--
the interior of this box.
So what is the main idea?
The main idea is to calculate it by using nothing
but single integrals.

In other words, in single variable calculus, you spent a
lot of time learning how to calculate integrals of
functions in 1 variable.
And there's a very efficient tool for doing that-- mainly
finding an anti-derivative.
What's called the Fundamental Theorem of Calculus in
1 variable, or the Newton-Leibnitz formula.
It's a very efficient tool.
You just have to take a function, and you have to take
it times the derivative, and evaluate at the endpoints,
and that's it.
For functions in 2 variables, you cannot evaluate the
integral in one shot.
Because there is no anti-derivative as such.
Because there's not a derivative of such.
There are many different derivatives.
So that's why there are also many anti-derivatives.
So in some sense, what we need to do, is we need to take first
anti-derivatives with respect to 1 variable, and then
anti-derivative with respect to the other variable.
That's what we need to do, roughly.
But there are different choices.
We can first do x than y, or y and then x.
OK?
And that's what sort of complicates methods.
But the basic structure of this calculations
is always the same.
You break the calculations of a double integral or a triple
integral into a sequence of single integrals.
This is called iterated integration.
You do it [UNINTELLIGIBLE PHRASE]
with 1 variable, followed by integration with respect
to the other variable.
So we talked about this a lot, and the important point here,
is to find the correct order, right, the correct
order of integration.
Which is essentially finding the best possible way of sort
of slicing your, say 3-dimensional domain or
2-dimensional domain, in such a way that the resulting
integration will be the easiest to handle.
Because there is multiple choices, sometimes you'll get
something easy and sometimes you'll get something hard.
So if you're getting something which looks very hard,
something which involves anti-derivative of some really
complicated function, chances are you're not using
the most optimal way.
I'm talking about the midterm.
It's not my goal, on the midterm, to test your knowledge
of single variable integrals.
My goal is to test you understanding of how to
calculate double and triple integrals.
So if you encounter some really complicated single integrals,
try a different way.
So what are these different ways?
First of all, changing the order with integration.
Right?
So first of all, changing the order of integration: this is
where you can already achieve quite a lot.

So change the order of integration.
And I think that 1 of the problems on the mock
midterm is like this.
Maybe not.
Changing the order of integration, that's number one.
So for that you actually say, if you're given an integral,
which is already given as an integrated integral, you have
to first reconstruct the domain which it represents, or
integration for which it represents.
And then you have to figure out how to slice it in a different
way to get a different integral in the opposite direction.
So that's the first trick.
And the second trick which is slightly more advanced--
something which we studied at the very end last week and so
on-- is using a different coordinate system.

So here you have some basic coordinate systems.
Which, of course, you should always keep in mind.
And the basic ones are the polar, cylindrical,
and spherical.
So these are always polar-- polar, cylindrical
and spherical.
But you should also always be able to devise your own
coordinate system by looking at the problem itself.
And so I'm talking about the material of last week.
So if you look in the book, if you look at the last homework
exercise, you know, it sort of leaps in your eyes.
For example you look at problem number 19.
It says, the function that needs to be integrated is x
minus 2y divided by 3x minus y.
And then you have the region that is bounded
by lines, you know?
x minus 2y equals something.
And 3x minus y equals something.
So if you look at this, it should be clear to you
what coordinates you use.
This should be your coordinate u, and this should be
your coordinate v.
Because then everything simplifies.
First of all, the function becomes u over v.
The region becomes, you know, a box in u and v and so on.
So things becomes much simpler.
So usually it should be clear from the context.
So if you notice sort of the same pattern for function, and
for the region, chances are you should change variables.
You have a questions?

Should we simplify based on the bounds or based
on the function?
Both.
I mean in this case, it's sort of, it's almost too easy.
It's almost too easy because they're the same.
They send the same message.
But, in fact, what if this was more complicated?
Let's say it was x and this was y.
It's not a big deal.
In this case, it would pay off more to simplify on the basis
of the function, because instead of this very
complicated thing, you will have just u over v, which you
can very easily find anti-derivatives.
Right?
And then x and y, you can easily express in terms
of u and v anyway.
So you would have some very simple region on the
uv plane, in any case.
But if, of course, if both the boundaries-- the bounds and
the function-- involve the same functions, then OK.
It shouldn't be too difficult to get what the variables are.
Yes?

Right.
Well you know this expression, use at your own risk.
Which means, in this case, that for example, if the Jacobian is
constant, is a number, then it's easy because you
take the inverse.
If the Jacobian is not constant, if you do it in the
opposite direction instead of getting a function u and v,
you'll get a function x and y.
So first of all, you'll have to invert, write it, and then
you'll have to express x and y in terms of u and v.
And so then it sort of defeats the purpose of why do I bother?
Why not just do it in the right way?
Do you see what I mean?
For linear changes of variables like this, sometimes it's
easier to do it like you said.
The question is really the following.
To explain the question, I should remind you
what the formula is.
So let's say for a function in 2 variables, it's like this.
You can write it as f-- let's say you write x as a function
of u and v, and you write y as a function of u and v.
And then what you do is you substitute this.
And then you write dudv, and then you have this
additional factor which is called the Jacobian.
I'll just leave it as a question mark.
The question mark is equal to the Jacobian is d of xy over
d of uv, absolute value.
Well, OK.
I will not write the formula, but it's a formula which was
given last time, which was used in the homework and so on.
So just to gime I will not write it.
But the question which was asked just now,
is what about d?
You can also calculate d?
uv over d xy.
In fact, this is inverse of this.
This is the inverse of this, but understood
in the right way.
Because the point is that this is a function of u and v, and
this is a function of x and y.
But if you take this function and substitute x equals
function of uv and y equals uv, then it will
become the inverse.
So sometimes it could simplify matters for
you but sometimes not.
So I would suggest just doing it the direct way, like this.
But here there's a very important point.
Which is that you have to put this absolute value.
I think I mentioned it last time, but maybe too briefly.
So I want to really, really emphasize it by very,
very thick symbols.
So this is absolute value.
Or put in plain English, it has to be positive.
Because it could not be negative.
Because if you're calculating the integral function
1, for example, you are calculating the area.
And so that means that whatever you insert here
will have to be positive.
So, in fact, there is a very simple way to keep track of
when it is positive and when this is not positive,
when it's negative.
The point is that if you switch u and v, which in the set-up,
which I explained, you can easily do.
There is no reason to take u over v, or v over u.
You will get an opposite sign.
So you should be aware of this.
Maybe I should write it after all.
It's like this, right?
This minus this.
If you switch, u and v, you'll have to switch the 2 roles.
And if you switch the roles, you get a negative sign.
Since we did not keep track which order, uv or vu is the
right one, you can get a positive answer or
a negative answer.
That's why we just say put absolute value, and
not worry about it.
Yes?
Sorry, will you be responsible for 3 variables--
change of variables?
Well on the midterm, probably not because
it's highly involved.
You're certainly not responsible for spherical, but
more generally, probably not because it would be a very
hard problem to do in a short period of time.
Oh, and I have one more gift for you.
Which is that you are not responsible for
probability also.

I guess, finally I strike the cord.
[APPLAUSE]
All right, very good.
Hold on.
Hold on.
So I'm almost done, just a couple more remarks.
So absolute value, and one other thing which
I wanted to say.
I said it already last time, about calculating volumes.
You should really have a good understanding of what we're
talking about when we talk about volumes.
One more time, when you do a double integral like this,
you're computing the volume of the region onto the
graph. z equals f of xy.
So, if you're asked to calculate the volume of
something, and this something looks like the region under
the graph, you can do it by double integral.
But if you are asked to calculate the volume of some
region, which does not necessarily look like the
region under the graph, and when I say under the graph,
I put in quotation marks.
You know what I mean.
It's under the graphs, but above the xy plane, and so on.
You could also compute it by doing the integral
of the function 1.
So this is the volume.
This is the most general formula.
The most general formula for the volume of a region in
3-dimensional space, is the triple integral of function 1.
Last time I explained how, in the case when this region is
the region under the graph, you can also express it
as a double integral.
But keep in mind, there's a difference.
OK?
That sometimes the volume is best by a double integral and
sometimes by a triple integral.
And then, of course, you also have obligations of double and
triple integrals to computing the mass and center of mass.
You're not responsible for the momenta of momenta of inertia.
You're not responsible for those.
But you are responsible for, you should be able to find the
mass, or the total charge, when you have a region with
a density function as a double or triple integral.
You should also be able to find a center of mass.
OK, these are the applications of double and triple integrals.
Any other questions?
Charge, well charge is like mass.
It's also an integral of the density function.
So we'll have office hours now.
So you can ask me more questions now.