 The theory is going perfectly parallel, similar to one variable. In one variable, we looked at local maximum or minimum, then we looked at how do you find out absolute maximum or absolute minimum of a function of one variable. So, what was our line of thinking? If the some point is a point of local maximum or local minimum, it is also a point of global maximum and global minimum. So, what we are interested in and that means we should look at the critical points. The points where either the derivative does not exist one variable or derivative exists and is equal to 0 or the boundary points. So, these points look at the values of the function and compare. If the function has absolute maximum or minimum, it will be one of those points. To ensure that the function has absolute maximum minimum, you have to justify by some other theorem. For example, if the function is defined in a domain which is compact, closed and bounded in the real line, then every continuous function attains maximum and minimum. How to find that? You apply the calculus techniques, derivative test and so on. So, in two variables or three variables, also the same method is applied. Look at the critical points, look at the values at those points and compare. Whichever is the largest, that will be the maximum supremum. Whichever is the smallest will be the infremum provided the function has such things. So, justify that. So, let us look at probably some. So, these are called absolute maximum, absolute minimum. So, if it has, then either it is a boundary point or it is absolute maximum at a point, then either it is a boundary point or a critical point. It has to be one of them. So, there is nothing in the proof. We just say, writing that because absolute has to be local. So, let us look at. So, D is the domain where x, y is the mod x is less than or equal to, mod y is less than or equal to 2. So, what is the domain? Mod x less than or equal to 2, mod y less than or equal to 2. What does the domain look like? It is square of what kind? Absolute value. So, anyway, is this domain compact, close bounded? No problem. So, it is a compact set. So, let us look at the function f x, y is equal to 4 x, y minus 2 x square minus y. Just now, we analyzed that function for local maximum and local minimum. But we analyzed everywhere. We did not analyze it in a particular part of the plane. So, now, we are saying it is strict this function in this domain. The domain being closed and bounded, the function should have a absolute maximum and absolute minimum. So, how do we find out absolute maximum or absolute minimum? You have to look at the critical points. The critical points are the points where the derivative exists and are equal to 0. So, we found out 0, 0, 1, 1 and minus 1, minus 1. What are the boundary points? Boundary points are where x is equal to 0 and y is equal to, mod y is equal to 2, those ones. So, let us analyze and compare. So, discriminant, actually 1, 1 and minus 1. So, let us look at the boundary point. If D is a boundary point, then what should happen? Either x 0 will be equal to 2 or x 0 will be equal to mod x. So, either this side or that side. So, x will be going up to minus 2 or plus 2. So, those are the values of it. Similarly, mod y. So, what are the boundary points when x 0 is equal to 2, y is varying, x 0 is equal to minus 2, y is varying and similarly, other two things. So, those are the boundary things. So, we have to analyze what happens. For example, let us look at x is equal to 2. That means we have to fix x is equal to 2 and let y vary as a function of one variable. It comes out to be this. So, on the boundary points, look at how the function looks like and then as a function of one variable, find out what is the critical points, maximum, minimum for that function. So, those are the values of the boundary. Function does not remain constant on the boundary point. It changes. So, what is the maximum or minimum at the boundary? We have to analyze and then compare. So, look at the function of one variable. For example, when x is equal to 2, this is the function. y varies between minus 2 and 2. So, for one variable, how will you find out derivative? So, this is the function. So, if we check for this function, I am avoiding the calculations. It has a maximum at the point y is equal to cube root of 2. How will you find that? As function of one variable, find out the derivative, derivative equal to 0. Then you want to analyze. You can apply second derivative test if you like to find out whether there is a point of maximum or a minimum. So, one variable theory will be applied to conclude that it has a maximum value at the point and this. So, how do you now compare? Compare the values at 0, 0. Compare the value at 1, 1. Compare the value at minus 1 and the boundary points and see out of this, which is the largest. So, if you compare, so you get, similarly, this is 2y. Similarly, for x2, you will be doing it. You are fixing. Earlier, x is equal to 2. Now, fix y and compare what is the value. So, that comes out to be minus 8. So, out of all the points, the absolute maximum of f is equal to 1. So, all this you have to be comparing. So, for function of two variables, you have to compare the values not only at the critical points. Also, in one variable, boundary points may be at the most 2 for interval left and right. But here, it will be probably a boundary. You have to see how the function on the boundary looks like. Find out the maximum, minimum and then compare among all these things. So, is it clear? Theory goes parallel to one variable. Only the work involved is more because the boundary in two variables may be a triangle, may be a circle, may be a or may be quite complicated one. If it is quite complicated one, you may not be able to find what is the maximum, minimum, some other way one has to apply. Is that okay? Process is clear. Rest is only computation. How do you compute? There are some more examples. Now, what we next want to do is sometimes one has to find out maximum or minimum function with a constraint. Here, we are looking at the function defined in a domain. But what does it mean saying that I want to find out function is defined in a domain, but I want to find out the maximum or the minimum with a constraint. So, for example, you may be interested knowing that is a problem with space scientist phase. A shuttle is entering into the earth's atmosphere. A space shuttle is falling. It is normally done. Nowadays, all space shuttles, when they come back to earth, what is happening? They enter the gravitational force field of earth and they have a sort of path along which they drop somewhere in a sea or somewhere. Have you ever wondered why they take a drop in the sea? Why should space shuttle be maneuvered to fall in its water body, a sea? Normally, you have seen all the fall in the sea. There are two reasons for that. One, if it is a hard surface, then you have to control the speed. It should land very smoothly slowly. We will be increasing the speed. You have to decelerate somehow. So, you have to add on mechanism. That is one and that is why probably our mission slightly failed in the end because we could not decelerate it. It landed very harshly. There was no sea. But other advantage is when something is falling on the earth, its surface gets heated up because of friction. Because of the air friction, the outer surface starts getting heated up. And when something with such a mass is coming down with such a velocity, it gets so heated up that it has to be cooled down. So, water is a natural cooling. It falls in the sea and then naturally it cools down to some temperature. So, the point, what we are trying to do, analyze here is the body of a space shuttle is something. That is the surface. That is the surface. At a particular time point, there is a temperature on the surface. So, what is the point on the surface where the temperature is maximum? We want to analyze. So, we are analyzing temperature on that body. So, it is a function of how many variables x, y and z, the position of the surface and time point t. At time point t is the temperature as time changes. Even if the point x, y and coordinate remain the same, temperature changes. So, it is a function of 4 variables x, y, z and t. So, we want to know what is the temperature at that point. So, the temperature is a function of 4 variables x, y, z and t. We want to know the point on the shuttle where the temperature is maximum. So, it is a function of 4 variables, but we want to put a constraint on x, y and z. That x, y and z should be on that surface. So, that is the constraint. It should satisfy the equation of the surface. So, that is the constraint. We do not want to, as it falls, temperature goes on increasing probably somewhere, but we want to know on that surface what is the temperature. So, in general, this is the problem. Say, x, y is a function x, y belonging to, say, the domain d. x, y goes to x, y belonging to d. So, problem is to maximize, minimize f, say, such that g x, y is equal to 0. There is a relation between x and y. For example, let us look at a plane, p is a plane. x, y is a point or let us look at the, let us look at, to be very simple, let us look at the point 0, 0 origin. So, for any point x, y on the plane, it has a distance. Any point x, y outside the plane, any point x, y on the x, y and z, say, on the y, let us, the three variables, x, y and z. So, this is the origin and this is the plane and let us call this point as something or let us call it p. So, o p. So, what is o p equal to? Distance, distance formula, x square plus z square square root. That is the distance. So, the problem is, find p such that o p is smallest. So, this is the problem, such that o p is smallest. So, what are we going to look at? So, we are trying to, so this is my function f x, y, z. That is the distance. So, I want to minimize this distance, but I want to minimize where is x and y? x and y lie on the plane. The plane may have some equation. So, let us say, this plane has a equation. So, what is the normal equation of a plane? Equation in R 3 of a plane. So, it will be A x plus D y plus C z plus D equal to 0. Is it okay? So, this is my G x, y, z. I want this function f x, y, z to be minimized with a constraint that the point lies in the plane. That means it should satisfy this. So, following. So, this means we want to, so in this problem minimize the function f x, y, z which was equal to square root of x square plus y square plus z square with constraint G x, y, z equal to 0. That means there is a relation between those points x, y and z G x, y, z is equal to 0. So, that is a constraint. So, this problem occurs not only in practical situations, in many practical situations. This also occurs in probability and statistics when you want to do statistical inference and you have estimates, likelihood estimates kind of thing coming. There you want to maximize or minimize the error with respect to some constraints. So, this will come back in case you are doing some courses in probability and statistics also. So, this is the kind of thing we want to do. So, these are called maxima, minima with constraints. So, these are called problems of maxima, minima with constraints. And for that Lagrange's proved a theorem. So, we will not go into the proof of the theorem. But what is the consequence of that theorem? How that method called Lagrange's method of constraint maxima, minima is used? We will look into that. So, let me look into that. So, here is what is called Lagrange's multiplier theorem. I am just stating it so that it is clear. f and g are two functions defined in a neighborhood of the point x0, y0. So, f is going to be the function which is going to be maximized or minimized and g is the constraint that is going to be, such that the following holds. The function f has a local extremum at x0, y0 when restricted to c, the level curve g x, y equal to 0. So, that constraint, g x, y equal to 0 will be a curve in the domain. Is it clear? x and y are related with each other. So, y as a function of x can be computed probably. So, that is a level curve. So, saying this is the constraint. So, the conditions are, if both the partial derivative of f and g exist and are continuous in that neighborhood, g x0, y0 is equal to 0 and derivative, this is a gradient. If you remember, what was the gradient? Partial derivative of g with respect to x comma partial derivative of g with respect to y, that vector is not equal to 0, then this relation must be satisfied. So, it is a necessary condition. So, f is the function which is to be maximized or minimized. g is the constraint. So, it says then there must exist some lambda, say that this is equal to lambda times this. Now, if you look at this partial derivative, gradient of f, it gives you two, is a vector, is a vector equation. So, what is this vector equation? Partial derivative of f with respect to x is equal to lambda times partial derivative of g with respect to x. Second component equation is partial derivative of f with respect to y is lambda times partial derivative of g. And what is the third equation? Third equation is g x, y equal to 0. That is another relation. So, three variables, x 0 is not known, y 0 is not known, lambda is not known and I have got three equations. So, you have to solve these three equations and find out the points x 0, y 0. That will give you constraint maxima and minima. So, let us look at one example at least to illustrate. So, let us look at the function f x y equal to x y. On the unit circle, we want to maximize, that means we want to find x and y. The function is, domain is everywhere. Function is defined for all points in the plane, but we want to know what is the maximum and the minimum value of the function on when x and y satisfy the equation of the circle. So, on the unit circle, what is the constraint? x square plus y square equal to 1. So, g x y is x square plus y square minus 1 is equal to 0. So, that is the constraint. So, what are the equations that we will be solving? So, gradient of f is equal to lambda times gradient of g, that is one vector equation. So, that means partial derivative of respect to x, that is y, partial derivative of g with respect to y, that is 2 y. So, f x is equal to lambda times g x, f y is equal to lambda times g y, the second and the third one is the equation of the constraint, that is the circle. So, these three equations have to be solved. Mind it, they are not linear equations. So, it is not linear algebra being done, because these equations are not linear equations. This is linear, this is linear, but this is not linear. So, those techniques of linear equations may not work. So, somehow you have to, the basic idea is you can remove lambda from first two equations probably, find a relation between x and y, put it in that equation and find y and then find x. So, that is how you do it. So, this can be a problem sort of how to find equations, find solutions. So, it comes out that these are the possible points. So, once you have found the points, the values of the points. Now, how to find the maximum or the minimum? Look at the values at these points and compare which is the largest, which is the smallest. So, that gives you. So, once you do that, you get these are the values. So, 1 by 2 is the maximum and 1 by minus 1 by 2 is the minimum and they are attained at more than one point. So, this is called Lagrange multiplier method for finding constrained maximum and minimum. Sometimes the constraint can be more than 1. Sometimes the constraint can be more than 1. f x y, you want to maximize, minimize with constraint g 1 and g 2. Then one more variable will enter into picture. So, you will take because of constraint, if you want f x y equal to 0, also g x y, g 1 equal to 0, g 2 equal to 0. That means, you have a linear combination of that should be equal to 0. So, you can make it as a one constraint, but one more variable enters into picture. So, that is with more than 1. So, let me just state that. So, the examples, two variables, these were three variables. Number of equations will become three vectors, lambda. So, four equations in four variables. So, that is ok, but constraint is still one. So, let me look at multiple constraints. Here is a multiple constraint. g and h are two constraints, which are applied to the function f. So, what we are saying is, you can look at a linear combination of these two, as if there is one constraint. So, look at lambda and mu to be scalars, variables of code. So, gradient f is equal to lambda times g plus mu times h. So, this is again a vector equation. So, how many three components, x, y and z? So, it will give you three equations. Fourth one comes, g equal to 0, fifth comes from, h is equal to 0, and how many variables to be solved? x, y, z, lambda and mu. So, problem becomes slightly more complicated, that is all, but it can be done. So, and many a times finding solutions of these, you may not be able to find exactly solutions. So, there is something called numerical techniques for finding solutions. So, if you do a course in numerical techniques, you may come across these things. So, for example, here is the, analyze the problem of finding the points on the intersection of the planes. There are two planes. When they intersect, what you will get? When two planes intersect, what you will get? You will get a line. So, essentially you want a point on that line which is closest to the origin. So, one method could be, you find out the intersection of the two planes and solving system of linear equations, find out that linear equation, that line and then closest to the origin. So, reduce. But why to do that much? You can just look at. So, this is the constraint. What is the distance formula? x square plus y square plus z square square root, that is the function f. To be minimized with the constraint g, that is the first one, x plus y plus z is equal to 1, minus 1 equal to 0, h, 3x plus 2y plus z minus 6 is equal to 0. So, these two constraints. So, simple problem goes to Lagrange multiplier. So, you do that. So, with respect to these constraints and then you can solve them. Problem becomes slightly more involved, because two constraints are there and non-linear things may come into picture. So, find x, y and z, put in that equations and solve them. So, your ability to solve those equations, you get two equations in lambda and mu. There is a method of solving and then solve those two equations, get values of lambda and mu and then find out the point. So, the basic idea is, as the constraint increase, you can take a linear combination of them to be the constraint. So, these kind of things will come into picture for you. So, today we have just tried to look at maxima-minima problems of several variables. Theory goes parallel to one variable. Essentially, that find critical points first, though the points are the points where either the partial derivatives do not exist or partial derivative exist and are equal to 0 or the critical or the points which are the boundary points later on. And, there are possibility of points out of these critical points, points with neither maxima nor minima, probably can be what is called a saddle point. So, to analyze them, you have derivative test, second derivative test, discriminant, discriminant positive, second derivative fxx less than 0, local maximum derivative, discriminant positive, second derivative less than 0, bigger than 0, local minimum, discriminant equal to 0, saddle point, less than 0, saddle point, n equal to 0, it is inconclusive. Bigger than 0, less than 0, you can conclude, but equal to 0, you cannot conclude. You may have to go directly. And, the method is, in the domain, try to look at points, some curves along with, it could be maximum to give you the value. And then, same method applied to, with constraints, it gives you fxy to be maximized, minimized with respect to constraint g. So, you have to solve the equation f is gradient of f is equal to lambda times gradient of g. And, if more variable, more constraints than lambda and mu come into picture. So, let us stop here.