 next Thursday It's a big day next Thursday, okay Every day is a big day, but the next Thursday is a bigger day than 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. Okay, so let me correct that. I said it in a European way, okay But I'm glad I'm glad you know that I don't have to tell you Okay, settle down Don't you wish it were next Thursday though? But well, you shouldn't have corrected me Okay, so the exam will be here for everybody except for the students of Dario If your ta's name is not Dario, you should be here and If you don't know the name of your ta Then you shouldn't be here, you know by now you shouldn't remember the name of your ta and this concerns only students of Which which attend the sections of Dario two sections And they will meet in a different place Okay. Now there is a lot of information Which I have posted on online on my on the class home page Which you have a link on B-space the B-space is really the master the master page from which you have a link to everything Okay, so in particular you have information about the midterm exam you have the mock midterm exam you have to review problems, okay, and After the class today, I will post the solutions to the to the review problems for the midterm exam as well as Solutions to the last homework assignment Okay Now just want to mention one to emphasize one thing which I already mentioned last time which is which is that You will be allowed to have one page of formulas like before Standard size on one on one side. Okay, exactly the same drill. Don't use the one which you use last time Because that would make a two-sided, right? I mean if you you can use whatever you want You can even write your favorite poetry for inspiration as long as it's handwritten and On one side of a standard size sheet of paper. All right, but don't use your old Don't take your old cheat sheet and then write on the back. That's not acceptable Okay Any questions about the logistics? I'm sorry Yes, if there is if you have room on the same side. Yes, sure but don't write on up on the back of The cheat sheet that you had before it has to one side should be empty should be blank Written with invisible ink perhaps Any other questions about the logistics? Everybody's very excited about the Thursday this Thursday next Thursday Okay, no more questions All right, so today we'll have a you have a question. All right, how is what? How is the class curve? It's all explained here. Well, it's not strictly speaking question about the upcoming midterm. Okay, but So, let me just say this The if there is a difference between sections we will make we will make adjustments for this Okay, don't worry about My experience though is that it almost never happens because the way it's set up the way it's set up is It's set up in such a way. So it's not to not to let that happen Okay, so don't worry. Everybody's in the same in the same boat. Everybody's in the same position on equal footing The question was about quizzes how quizzes the different sections How are they going to be accounted if there is a difference and I said that if there is a difference in quiz scores in different sections We'll make adjustments for it But my experience that almost never happened because we actually take precautions for that All right now review review of the material for the for the midterm We will be the midterm will cover the material after the first the first midterm exam This is not to say that you should forget everything you knew before the first midterm Okay, because of course some of that material will be 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 parametric curves and so on okay But there will be no focus on the material before the first midterm in other words There wouldn't be a problem which is can be solely solved by means of the material that was learned before the first midterm Yes You wouldn't need to like parametrize If if that if that is something which was covered which was discussed after the first midterm then perhaps yes But not in a way. It was discussed before the first midterm. You see what I mean. All right Okay, so now let me go over this this material Let me summarize it and kind of given an overview as I said many times You can break calculus into two big parts of differential calculus in the integral Calculus or integration calculus which are in some sense opposite to each other okay, and So this material that we are talking about now can also be broken into two big parts One is about differential calculus differential calculus and the other one is integral calculus differential calculus was we came first We first talked about that and then we The most recent lectures we devoted to the integral calculus So let me first talk about the differential calculus. What are the main points here that you need to know? Okay, the first one is Directional derivative If you have a function in two variables And you fix a point Then you have many different derivatives that you can take of this function at this point This derivatives are parameterized by the choice of a direction vector and the direction vector Which we usually denote by you? There's two components a b is the unit vector Which is to say that it's norm or length which is just you know a square plus b square square root is one and the directional derivative of the function f with respect to such a vector at this point is Can be given by in the by different formulas But the one which we use the most is is the formula as a dot product between you and another vector Which is determined by the function and the points Which is called a gradient vector. What is a gradient vector? It's a vector which has two components and the first one is the derivative is a partial derivative of This function at this point With respect to x And the second one is Derivatives respect to y so we put We put two partial derivatives together as components of a vector That's what we call the gradient vector and the directional derivative is best understood as a dot product between that Gradient vector and the direction vector Which in the usual sense? Okay, 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? Rate of change of a function f At the point x Zero y zero in the direction of you and from this formula we can find various I can obtain information about About the direction of derivative for example, we can find out in what direction We can achieve the maximum possible rate of change or the maximum possible direction of derivative so the maximum maximum value for this direction derivative Is achieved when we take vector u to be to go in the direction of the gradient Now naively we would just say that it is equal to the gradient But we don't want to do that because this is not necessarily unit vector And we have the convention is that the direction the direction vector is called a direction vector The direction vector has to be 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 zero y zero just to simplify notation So we have to divide by the length if we divide by the length the resulting vector will have lengths one so it will be unit vector So that's that's the maximum value. Maybe I should say maximum value is achieved if U is equal to this and what is that value then the direction derivative with respect to this u is equal to just the The absolute value of norm the norm of the gradient vector because when you take the dot product You are 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. Okay, that's the maximum value a minimal value Minimal value is when we take the opposite direction, which is kind of makes sense You achieve the steepest ascent in one direction and steepest descent will be achieved in the opposite direction So this will be minus and what is the value is It's going to be minus And finally you can get zero value if u is perpendicular as this is clear perpendicular to the gradient vector By the way, how do you find the 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's a very simple rule to find perpendicular vector But of course keep in mind that we are finding the prep we are so what we need to do here to find you we have to take the The the gradient let's call it alpha beta because I don't want to confuse it with you itself Okay, and so we just switch switch them and put a negative sign in front of one of them and and But then you have to normalize it. So you have to have to divide this by the square root of also square plus beta But so for the maximum and minimum there is a unique solution it's a it's the gradient vector divided by its norm and minus gradient vector divided by its norm, but for the direction for which the The derivative is zero. There are two solutions because that too if this is you Then you have two different Sorry, if this is nubla f if this is nubla f There are two there are two vectors which are unit vectors and perpendicular to it this one and this one This is you one and this is you two So if you have a question on the test which to find the directions in which the direction 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 plus minus For both of these the dot product is zero Okay, and we talked about the meaning of directional derivative what it represents it presents a rate of change and The fact that there's the gradient vector The the vector of steepest ascent is actually vector perpendicular to the level curve which brings us to to another to the next to the next topic which is tangent Tangents and normals to level curves and surfaces Level curves and surfaces. So a level curve is a Is a curve on the plane Which is given by the equation f of x y 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 three-dimensional space This is level surface in both cases k is a number. So this is a number and you look at all solutions for example if If x if f is x squared plus y squared This will this will represent circles if k is positive and likewise if here say if you have x squared plus y squared plus z squared This will be sort of the spheres Center to the origin and So now suppose you have a point on this on this level curve level surface Then we can talk about Tangent lines and tangent tangent lines here tangent planes here normal lines in both cases Say x zero y zero is a point on this level curve. So then the normal vector Normal vector Is the gradient vector? So this is closely related in fact to the discussion of Of the rate of change or direction derivatives because The best way to think about level curves is to think in terms of maps on the maps Usually or oftentimes you have these curves and we kind of really used to this It gives us a good understanding of the over the landscape because each curve corresponds to you know the points of equal height over the sea level and so you can think of this as a picture of a mountain and And say climber could be somewhere here and Function f would be the contour of the mountain So 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 of that mountain, right? So so finding directional derivative would be a question of finding how quickly a climber would be climbing or descending if He or she you are going in a certain direction So that would be a vector you so you for given vector you you can ask what is the rate of change of that? What is this? What is it? rate of climb and Of course from this point of view, it's 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 level curve is a is a gradient vector And or if you want to steep as descent it would have to be negative. It's negative right, so that's not life and So everything is consistent because we know from the just algebraically from this calculation We know that the maximum rate of change maximum direction derivative is achieved in the direction of the gradient and Geometrically, we know that the gradient is a normal or perpendicular vector to the level curve So both of those to those two statements feed 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 to the level and also if you The zero level the zero directional derivative would correspond going along the along the slope Which would be parallel parallel to the slope so it would be perpendicular to the gradient If you have this picture in mind, then all of this becomes very real Not abstract but real very concrete okay, so What does it mean? It's a normal vector. So for example, you can be asked What is right down the equation of a normal line to the to the level curve? So you can write the equation of the normal line Just simply by and the usual in the way which we learned before at the very beginning of this course, right? so the equation of Normal line would be the easiest would be to write it in In parametric form So sometimes you may be asked to parameterize something But in conjunction with sort of some higher math if you will Finding a gradient vectors and normal normal lines. So that would be x0 plus let's say this is alpha beta As before so this would be alpha t and then this will be Y0 plus beta t and also you can write it can be asked to write the equation of the tangent of the tangent Line, which you can easily write by using this information And likewise here to if you have a function in three variables. You also have the gradient vector Which now has three components, right? So it's F sub x F sub y and F sub z and At evaluated at those points and this is again the normal vector And so for example again, you can be asked to write the 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 x0 plus f sub y y minus y0 plus f sub z minus z0 So here we kind of encroach on the territory of the previous of the previous midterm because at the very end of the That's of that segment of the course just before the first midterm We discussed the differential and the tangent planes to graphs of functions And this can be viewed as a special case of this Finding tangent planes to general level surfaces Tangent plane to the ground to this 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 line tangent planes for level surfaces in general and tangent planes to graphs of functions and at that time I explained that that Graphs correspond to a very special case of level surfaces the case where So for graphs graph For graphs f is equal to some function f of x y You have a function in three variables which in fact is determined by a function two variables f x y minus z So the level surface for this Simply corresponds to z equals f of x y so it gives you the graph of the function f capital And so being a special case you can so you can also use this general formula to describe the tangent plane So what will happen is that here you'll get negative ones? This will be in this special case. It will be negative one. So the equation will simplify Okay, so that's what you need to know essentially By the way when I talk about Rate of change in directional derivatives here I talk about functions in two variables But in fact the same analysis cannot be applied to function in three variables You just need a unit vector in three space as you right and then you can The same formula would define the direction derivative for a function in three variables Again, it will involve the gradient Which is now given by this formula with three components and so on and again The maximum will be achieved in the direction of the gradient the minimum and the opposite direction and so on okay There will be more than two vectors now For this last condition there will be a whole variety of vectors which are perpendicular to To the gradient any questions about this Yes Okay Suppose that f is given by this formula In this case that what is what is f sub z the Partial derivative is back to z it's negative one 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 one so it will then take the usual form Z equals z minus the zero is equal to this That's the formula for the the equation of the tangent plane to graph of function Which we studied just before the first mid-term So I maybe it's a good idea to review that just in case because it's even important It's an important special case of the story It was kind of a slightly a natural break You know the first midterm came just after we did this but before we talked about tangent planes to general surfaces So it's it probably makes sense It would probably be a good idea to review those couple of sections just before the first midterm Okay, any other questions I'm I'm a little pressed on time So I'm a little worried that I will not be able to if I do that I would be not be able to talk about some other topic So if I have time left, then I'll come back to this. It's okay. All right so What's next? Next Next big topic here is Is maximum and minimum? Maximum or functions and this can be viewed as an application of the of the differential calculus So what is what do you need to know here? First of all, you have to remember that there are there are two types of Maximum and minima there are local ones and the global ones and there is a totally different game Finding the local ones and finding the 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 Kalimantjaro, you know Big mountain it could be just a little bump somewhere on the street. That's a that's a local That's what the local maximum is or likewise minimum a little pit. You know, so In other words, the value at that point should be greater than values even in a very very small neighborhood of that point and That's where we can do well by simply by by simply applying derivatives by analogy with one dimensional case so that the first the first criterion that we have for having a Local maximum and minimum is that the first derivative criterion simply put it is saying the following that suppose Yeah, or if f of x y has local has local maximum or minimum so There is a word for this extremum Extremum plural plural would be extrema So let's call it extremum because otherwise I have to say always a maximum minimum maximum minimum and it's too much so as local extremum at some point x zero y zero and It's partial derivatives Partial derivatives at this point exist Exist then they have to be equal to zero. They have to equal zero So this is the first 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 the converse however is not true if both partial derivatives vanish It does not mean that it is a local maximum minimum. You have a question. Yeah, I knew I knew that It's always the case. I try to save some space, but then I have to go over it again So I lose more time right a more space. So I mean the two partial derivatives this FX Let's just do it so Converse is not true It could be which we discussed even in the one-dimensional case Think of the y equals x cube function x cube has vanishing derivative But the graph looks like this point zero is not it's not a point of maximum or minimum But there is a test Which involves second derivatives? So there is a second derivative Namely, we form the following quantity. We take the xx 0 y 0 Times f y y at x 0 y 0 minus f x y This assuming of course that all of this exist All of these derivatives exist and are continuous at this point So the test is the following that if D is greater than if D is greater than zero and F's x x At x 0 y 0 is greater than 0 Then it's a minimum then okay. I'm abbreviating then x 0 y 0 is a minimum if D is greater than 0 and f x let's Say less than zero then maximum Then maximum in x 0 y 0 is Local is local local local minimum local maximum and If D is less than zero Then it's a what's called a saddle point is a saddle point Like a saddle Point so neither Neither maximum nor minimum and the saddle is what you get when you look at the what is called Hyperbolic paraboloid Yes, yes it is That's right. So you remember we had this there's this figure one of kind of the fanciest Quadric surface that we discussed hyperbolic paraboloid which looks like a saddle So if you go in some direction you fall you fall fall down But if you go in other directions you go up. So it's neither maximum nor minimum locally, okay, so that's If D is less than zero then that's that's the kind of point you have so that's how you know it's not but Otherwise if D is zero for if D no information if D is zero if D is zero it could go either way Okay, we didn't talk much about why this criterion is true. I only made a few comments The point is that to understand it you should really look at just quadratic surfaces because As we discussed a function the first approximation to a function is a linear function in other words It's a you're approximated by the first derivatives and the next level approximation is given by quadratic derivatives so But two functions have the same quadratic derivatives if they have the same sort of Taylor expansion in degrees one And two and the higher-order terms on the 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 just quadratic functions functions, which are polynomials of degree two combined degree two in X and Y and For such functions this expression is actually a number And if you look if you just plug this formula in this formula some of your favorite examples like you know elliptic paraboloid and Hyperboloids and all this in this kind of functions. You will see how this criteria how this criteria work the reason why we choose this fancy combination of of second derivatives is that Is the point is that The behavior of the of the graph is not necessarily determined by the coefficients of the polynomial, but they are determined by sort of the main axis When we talked about quadratic 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 so simple form meaning Say a x squared plus be y 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 Right, so for such a function if f is this function D is equal to It's just kind of small small insert here D is equal to a b and so then you can very easily see what what those scenario correspond to because D greater than zero and f xx greater than zero means that a is a is positive and b is positive So we are dealing with a with a paraboloid the graph of this function is a paraboloid 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 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 problem So this is a way to Understand this criterion by simply looking at such expression 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 for that form is this expression Anyway, we don't need we don't need to get too much into detail of this criterion You just have to know whether you have to know this criterion and you should understand it for this particular function How it works a x squared plus by squared Okay, so that takes care of of the local maximum and minimum And in some sense it's a little bit Disappointing because we don't have a conclusive criterion, but the same is true also for functions in one variable Functions one variable. We don't really have if you just use first and second derivatives. You cannot really make a conclusive Statement in general whether it has a local maximum or minimum, so it's not so surprising so what's what's more a kind of Pleasant in some sense and that's fine is the case of global maximum and minimum in this case we can usually find a complete solution By following a basic algorithm, so let's talk about this global So global is a global maximum and minimum is a totally different game where you are actually given a certain region Say if it's a function in two variables, you are given a region In our tool or if it's a function in three variables, it would be a region in our three and You have to find points within that region only you don't care But what happens outside only within that region where the function takes the maximum and minimum values, right? So the algorithm here consists of essentially two steps although you can sometimes phrase it as in terms of two steps sometimes in terms of three steps, but basically the first step would be to find global 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 of the first derivative Criterion because those could be the points of local maximum and minimum Local maximum minimum could potentially be global maximum minimum as well, right? So I have to find all of those points. In fact, you you you don't have to look at In this in this part of the algorithm You don't have to look at the boundary because the second part of the algorithm takes care of specifically of the boundary But you when you write this formulas, okay, if you get a if you get a point on the boundary You include it as well why not and so and the second part is to focus exclusively on the boundary Focus on the boundary boundary and find extrema on the boundary on this boundary Find the extrema of the function function restricted to this boundary. So Here there are There are basic to essential essentially two different ways two different approaches if the boundary is linear in other words if it is given by linear equation like x equals some something x equals five or x plus y equals zero You can simply substitute this equation into the function and get a function one variable and then solve the ques- solve the problem by doing functions in one variable, right, so first step first possibility is Boundary is given by linear equations given by linear equations Linear meaning is just degree one in x and y example Let's say f is equal to x squared plus y squared and the boundary One one segment one part of one component or segment of the boundary of the boundary Is say x plus y equals? 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 variable, which you originally have You will see that when this function is restricted to the boundary it effectively becomes a function one variable namely x So you get That is restriction 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 effectively function one variable If you have a very complicated equation for the boundary You may not be able so easily express y in terms of x or x in terms of y and then substitute But if it's a linear equation You can always express easily one in terms of the other and then you simply substitute and then the remaining variable will be the only Variable left You will get a function one variable. So then just solve the problem By using the methods of the calculus of one variable, which is you just look at the 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 on this line Like I said, it's only it's only component of the boundary in general is the boundary is going to have many components for example boundary could be Could have this as a component and then it could have part of a circle is another component. So Except of course, I didn't draw the right This is not x plus y equals zero, but it's x equals y Okay, let's do it the right way This is x plus y equals you Okay, but okay, so maybe this is not it's not a good because I don't want to write it like it's my function Is x squared plus y squared and I want let's just make it something complicated. It could be something like this, right? I'm not saying I'll put the exactly this one on the exam But I'm just saying for the sake of the argument. Okay, just as an example So you could have this very simple component like this When you restrict your function becomes a function one variable you can choose which one x or y You express the other one in terms of this one the for the original ones of y in terms of x substitute Get a function one variable solve the problem Namely, find the extreme of the function on this interval by using methods of one variable calculus one variable 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 could be 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 in substitute So you have to use something else. That's something else is Lagrange method. So I would say this is what I call To a so that's the method. That's the easy method and it's slightly more complicated method is Lagrange method Lagrange method So Lagrange method is about So in this case it's about solving a system of equations So in this case you your component your component of the boundary would be given by by the equation g of x y equals k or g some function and So you will write the following equations. You will write nabla f f is a function which you try to Maximize minimize is lambda nabla g and then you also have g of x y equals k So solve the system and then of course there is there is an additional issue, which is that there could be corners they could be kind of Points which are not smooth on the boundary and This have to be treated separately. I Mean you can think of treating them not separately But you can think of treating them within the context of to a or to be because when you do when you do that You have to talk you have to take care of the endpoints anyway Or you can just think of corners as a separate entity completely separate entity and just Put them on the list that they at the very end, but you have to include them. Okay, so So usually the way I explained it is you do the corner the Corners which are corner by corners. I mean points which are not smooth points Like this in this case these two So basically it boils down to the following you might have a sort of an easy case where You might have sort of an easy case where the boundary is smooth for example boundary could be in the lips This is exactly the example, which we studied originally in class 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 Okay, 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? Yes, well Lagrange find the find them for us That's a very good question Lagrange will not necessarily find them for us right for exactly the same reason why core why the endpoints would not necessarily be found just from the in one variable calculus from the Calculating from finding points with derivative zero What was the issue if you had a function one variable? Let's say you have a graph of a function Let me do it in this way you see Here is a very good illustration because here. This is a maximum point, which is also a local maximum So it will catch it in a first at the first step If we were doing it for one variable function, right? But this is a minimum and it's a minimum not because if the derivative vanishes it still it derivative is non-zero But because it's the endpoint because we can't go any further likewise here. Remember we had a Discussion about how that there were two points which were the points where the level curve of the function f were Tangent level curves of the function f which in my example back then was a linear function Were touching work tangent to the to the level curve to the constraint to this to this curve, right? now, okay great, but what if my What if my curve ended here? What if my curve was just Like this From here to here Then okay, I would catch this one as a 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 not part of this segment because my picture could be like this my domain could be could be like this and What would happen in this case is that actually the maximum would be achieved at the corner So just just because it's Lagrange method. It doesn't mean it doesn't have its own limitations, right? It has the same limitations as other methods that we have studied which involve derivatives But 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 subtle points when we're doing when we are doing global maximum Minimum and the answer is no because because precisely because it's a sort of a different sort of a game that we are We will certainly catch them in part one Because in part one we are taking we are just grabbing all the points We can get where the derivatives that's zero. So in particular we'll get a lot of subtle points in general but I Guess I didn't finish the algorithm. The point is that of course at the end of the day We are going to just evaluate our function at all of this point so the The subtle points will will just get rid of them in a natural way because they will be They will just turn out to be fake sort of it will not be maximum minimum So the maybe I should say that the end the end of the algorithm is to evaluate Function a function f at all of these points and find Maximum possibly multiple it could be that there are two different points where you get the same value So you have to list them all so if you if the question on the test is give all the all the maximum and minimum of this Function on this domain and let's say this function has two maxima two points where it takes the same maximum value And you only give one Then obviously you will you will lose some points on this Because this is not this would not be a complete answer 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 of 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 two-dimensional domain You want to find global maximum and minimum and then you have to you have to 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, right? But there is a different type of problem all together where you just are asked to find maximum minima On a level curve in other words, you don't you don't have the interior You don't have the two-dimensional region with a boundary, but you just have a curve Right. So 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 that's an important thing to remember that you have to understand what the problem is If you're asked to just analyze the curve, you don't have to see what happens in the interior Now in all of this discussion, I assumed So maybe I will write that Lagrange method Lagrange method Can also be used to find Maximum and minima on the particle on the on the on a curve Like this g of x y equals k. So in this case, no, there is no interior No interior. So you don't have to do the partial derivatives on 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 that are two tricky points Yeah Where the Lagrange method does not work in the in the best possible way as as explained here Okay, and the tricky points are the first of all This works Maybe I will just say it in one sentence. This works well This works well the method works well if First of all this curve Is bounded If the curve does not go to infinity This is actually something we did talk about in class. I did give an example like this if number one The curve is bounded. You see what I mean bounded means that it is Like this as opposed to you know something which goes to infinity More precisely bounded means that you can You can cover it by a sufficiently large a disk of sufficiently large radius On the homework there was There was an extra kind of a tricky exercise which was x cube I think it was something like x cube plus y cube equals one or something and it looks deceptively Simple because It looks almost like x squared plus y squared equals one So this is bounded Right, this is bounded Because it's a circle of radius one, but this is not bounded. So this is an important point And the reason is of course that see this here you have a sum of squares and squares are always positive or zero So if the sum of squares is equal to one You can see this is the sum of two numbers which are positive equals to one So it means that each of them has to be less than one between zero and one and that puts the bounds of course x and y Can only be between one and negative one, right? That's why it's bounded But here you have cubes and cube could be both positive and negative So x could go to plus infinity and y go to negative minus infinity as long as they add up to one Which is easy to find so I'm not going to try to draw this but this is not bounded for sure It goes because you will x could be arbitrary arbitrarily large and then y would be just 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 Right, so so be careful when you apply Lagrange method for example, it is very tempting Say you get two points and it's very tempting to say that one of them is a maximum that one is a minimum Right and that would be true If in fact the the curve is bounded because on the bounded curve It has to have a maximum and has to have a minimum and if you got two solutions for Lagrange method That means one of them has to be maximum has to be minimum. You just evaluate it. They would have to have different values And so you will know which one is which but I think in this problem I forgot either either there was only one point you got only one point which is like wow Why do I get only one point? Where is this if it's a maximum? Where is the minimum? It's a minimum Where is the maximum or maybe there were two points, but they had the same value Which is like even worse because what does it mean? So the both maximum minimum does it mean the function is constant? Well, it's not constant So the resolution of this the resolution of this paradox is that when the curve is not bounded Which is in this case When the curve is not bounded you may not have May not have Maximum or minimum or even you may be situation where you don't have either So you have to you have to take this into account. That's number one and there is one more little trick which is The other thing that could happen is that in this equation the equation which we use for Lagrange in Lagrange method It is perfectly okay for nabla f to be zero because that would correspond to the solution where lambda is equal to zero Right, but it can happen also that nabla g is zero and if Now nabla g is zero and nabla f is not zero that will correspond to lambda equal infinity. So you wouldn't be able to solve this So this is this this is one remaining possibility Which we haven't really talked about but there was at least one exercise on a homework where this was the case So you have to also be careful about this. In fact, this is at this point where nabla g is Is zero and also but this equation is so satisfied. They are actually corners. They are actually singular points of the of this curve So in that sense they kind of get under the rubric of corners So they have to be analyzed separately But just looking at the equation you may not realize it right away because you would have to really visualize So just keep in mind if something is 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 this kind of equations You have to be always careful when you cancel out things on both sides of the equation You know that right if you if you cancel things out It means that they are non-zero because it means like you're dividing by this Quantities so you have to allow for the possibility that they are equal to zero This may actually where this may be where your lost solutions are Okay, I'm I'm purposefully Purposefully trying spending more time on this differential a part of that because we talked about integrals for the last what? Three weeks and this is something which was came earlier So I kind of wanted to make more emphasis on on that part But the good news for you the good news is that you are not responsible for For the case when there are two constraints Somehow I expected a more a more enthusiastic response Okay Thank you. Okay, because I was thinking Why am I even bothering saying this, you know? Maybe they should be responsible for it No, okay. Okay. All right. So but in the book That's right. Well, that's the problem. So if you don't know what you what I meant that That's that's a problem for for everybody In the book All right, let me let me explain don't explain it to your neighbor In the book there at the very end of the chapter on like section on Lagrange multipliers. There is a discussion of two constraints Because this is called constraint This is called constraint and and this is Lagrange method for a single constraint because here We have two variables and we have we impose one equation or constraint So we'll end up with a curve if we impose a second constraint here will get finite number of points So it's not interesting a finite number of points. There will be no derivatives. You just evaluate at those points and that's it But if you consider the case of three variables Then what can how you can have two possible choices you can have a situation like this where simply you would just have third variable That's a single constraint and two constraint means that you have another h of x y z and then what what you need to do Is you need to write lambda novel g plus mu number h So it becomes much more complicated and actually did not put any problems of this type on the homework And you are actually not responsible for this. So don't So maybe I shouldn't have even mentioned because now Now maybe people get more will get more worried about it but okay Just to be clear Okay, any questions about this any other questions about maximum and minimum. Yes Very good. So the question is if the point if the curve is not bounded. How do we see if it's a maximum or 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 at those in the neighborhood of this point if you if you move slightly away from the point you have found Does the function grow or becomes value or decrease does it increase or decrease? You see and that's how you know if it if you move a little bit and the function becomes the value function comes larger Okay, that's a minimum and if you move you see them in so that's that's how you do it Okay, so let's now 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 maybe it's a good idea to just briefly summarize the stuff as well So what do we need to know about integrals? So we study integrals of two different kinds are double integrals and there are triple integrals, right? So double integrals are integrals over over two-dimensional Domain of a function in two variables and triple integrals Are fun our integrals of functions in three variables over three-dimensional? Regions like they 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 one variable and there is a very efficient tool for doing that namely finding anti-derivative what's called a fundamental theorem of calculus in one variable or Newton-Leibniz formula There's a very efficient tool you just have you have to take the function and you'd have to take its anti-derivative and Evaluate at the end points and that's it For functions in two variables, you cannot do it. You cannot evaluate the integral in one shot Because there is no anti-derivative as such Because there is not a Derivative as 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-derivative with respect to the one 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 and then y or y and then x Okay, and that's what sort of complicates matter matters But the basic structure of this calculation is always the same You break the calculation of a double integral or a triple integral into a sequence of single integrals This is called iterated integration. You do it integral with respect to one variable followed by integration with respect to the other variable so we talked about this a Lot and the important point is here is to find the correct order, right? It's correct order of integration which is essentially Finding the best possible way of sort of slicing your say three-dimensional domain or The two-dimensional domain in such a way that the resulting integration will be Will be the easiest to handle. Okay, and because there are multiple choices Right, sometimes you will get something easy and sometimes you'll get something hard So if you're getting something which looks very hard something which involves Antiderivative of some really complicated function chances are you're not using the most optimal way. I'm talking about the midterm because It's not my goal on the midterm to put some really complicated To test your knowledge of single integrals single variable integrals My my goal is to test your understanding how to calculate double and triple integrals. So If you encounter some really complicated single integrals try a different way Okay So what are what are these different ways? First of all changing the order of integration, right? So first of all changing the order of integration This is where you can already achieve quite a lot So changing the order of integration and I think that one of the actually one of the problems on the mock midterm is like this maybe not Changing order of integration. That's number one So for that you actually say if you are given an integral which is already given as an iterated integral you have to first reconstruct the domain which which it which it represents or integration over which it represents and then you have to Figure out how to slice it in a different way to get an integral in the opposite direction Okay, so that's that's the first that's the first trick and the second trick Which is slightly which is more advanced something which we studied at the very end last week and so on is Using different using a different coordinate system Using a different current system So here that you have you have some basic coordinate systems Basic ones which of course are You should always keep in mind and the basic ones are the polar Cylindrical and spherical right so these are these are always polar Polar cylindrical and spherical But you should also is also be able to devise your own coordinate system by looking at the problem itself and So this I'm talking about really the material of last week So if you look in the book if you look at the homework of the last homework exercises You know It is sort of leaps in your eyes. For example, you look at the problem number 19. It says the integrated function The function that needs to be integrated is x minus x minus So number 19 you have x minus 2 y divided by 3x minus y and then you have the the region is bounded by lines you know x minus 2 y equals something and 3x minus y equals something Okay, so if you look at this It should be clear to you. What are the coordinates that it should use? They should be your coordinate you and they should be your coordinate V Because then everything simplifies first all the function becomes you over V the constraint Region becomes, you know a box in you and V and so on so things become much simpler So usually it should it should be clear from the context Because so if you notice sort of the same pattern for function and for for the region chances are you should change variable You have a question Should we simplify based on the bounds or based on the function both? in this case, it's sort of it's almost too easy, right because it's almost too easy because They're the same they they send the same message, right? But in fact, what if this was not what if this was more complicated? Let's say it was x and this was y It's not a big deal It would in this case would pay off more to simplify on the basis of the function because instead of this very complicated thing You would have just you over V which you can very easily find derivatives, right? And then x and y you can easily express in terms of you and V anyway So you would have some very simple region on the UV plane And you in any case, right? But but if of course if both the boundaries The bounds and the function involve the same functions, then okay, so then it shouldn't be Too difficult to guess what the variables are Yes 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 you and V You'll get a function x and y So first of all you'll have to invert it and then you'll have to express x and y in terms of you and V You see and so then it sort of defeats the purpose of why bother why not just do it in the right way? You see what I mean For linear for linear changes of variables like this It's sometimes it's easier to do it like you said the question is really the following To explain the question I should say what the formula I should remind you what the formula is So let's say for function in two variables. It's like this that you can write it as f Let's say you write x as a function of you and V and you write Y is a function of you and V and then what you do is you substitute this Right, and then you write du dv And then you have this additional factor which is called a Jacobian. I'll just leave it as a question mark the question mark is equal to Is the Jacobian is d of x y over d of uv? absolute value Okay, I will not write the formula, but it's a formula which was given last time which is was using the homework and so on So just to save time. I will not write it But the question which was asked just now is what about what about D? You can also calculate duv over dx y and In fact, this is inverse of this This is inverse of this but understood in the right way because the point is that this is a function of you 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 some but sometimes not so I Would suggest just doing it in a direct way like this But here there is a very important point Which is that you have to put you have to put this absolute value? I think I mentioned it last time, but maybe maybe too briefly. So I want to really really emphasize it by by very very thick, you know Symbols here. So this is absolute value Or put in plain English. It has to be positive. Okay Because it cannot be negative because if you're calculating the integral of function one for example, you are calculating the area And so that means that the function whatever you insert here will have to be positive So in fact, there is a very simple way to keep track of When this is positive and when this is not positive when it's negative the point is that if you switch You and V which in the setup which I explained you can easily do there is no reason to take you over V or V over you You will get an opposite sign So you should be aware of this maybe Maybe I should write it. I should write it after all. It's like this, right? This minus this you see if you switch If you switch you and V you will have to switch the two rows And if you switch the two rows you get the negative sign Since we did not keep track which order you V or V you is the bed is the right one You can get a positive answer or negative answer. That's why We just say Put absolute value and not worry about it. Yes. Yes Sorry will be responsible for For three variables change of variables Well on the test on a mid-term probably not because it's highly involved. You certainly are responsible for spherical But more general probably not because it would be a very hard problem to do in a short period of time Oh, they have one more gift for you, which is that? You're not responsible for probability also because we didn't really All right, I guess finally I strike the chord. I feel All right, very good so Hold on hold on so I'm almost done just a couple of couple more in Mars so absolute value and 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 what we're talking about when we talk about volumes once one more time You can when you do a double integral When you do a double integral like this You are computing the volume of Of the region under the graph e equals f of x f of x y Okay, so if you're asked to calculate the volume of something and this something looks like region under the graph You can do it by double integral But if you are asked to do To calculate the volume of some region which does not necessarily look like Area, you know region under the graph and when I say under the graph I put in quotation marks You know, you know what I mean? It's under the graphs, but above the x y plane and so on You can also compute it by doing the integral of the function one Over the so this is the volume. This is the most general formula most general formula for the volume of Region in three dimensional space is the triple integral of function one 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 this difference, okay That sometimes the volume is best found by double integral and sometimes by triple integral Okay, and then of course you also have applications of double and triple integrals to computing the mass and center of mass You are not responsible for the Momenta of inertia You're not responsible those but you are responsible for you should be able to find the mass or the charge total charge when you have a Region with a density function as a double or triple integral. You should also be able to find the center of mass Okay, these are the applications of double and triple integrals any other questions Sorry Charge well charge is like mass. It's it's also integral of the density function All right, so we'll have office hours now so you can have asked me more questions now