Course:MATH200/Lagrange

From UBC Wiki

Lagrange Multipliers

Lagrange multipliers are a tool for maximizing a function of several variables subject to one or more constraints. Here we state the theorem for functions of 3 variables and one constraint.

Local extreme values

Suppose S is a subset of R3, P is a point in S and f is a function defined on S. We say that f(P) is a local maximum of f on S if f(P)≥ f(Q) for all Q on S near P. Explicilty this means that there is a positive number r such that f(P)≥ f(Q) for all Q on S with |PQ|<r. Similarly, we say that f(P) is a local minimum of f on S if there is a positive number r such that f(P)≤ f(Q) for all Q on S with |PQ|<r. We say that f(P) is a local extreme value of f on S if f(P) is either a local maximum or a local minimum of f on S.

The Lagrange Multiplier Theorem with One Constraint

Theorem Let f and g be continuously differentiable functions of three real variables and let S:={(x,y,z)∈ R3: g(x,y,z)=0}. Suppose that P=(x0,y0,z0) is a point in S where ∇g(P) is not equal to 0. Assume that f(P) is a local extreme value of f on S. Then there exists a real number λ such that

Rough Justification Suppose r:[-1,1]→ S is a vector valued function with r(0)=P. Recall that the vector r'(0) is tangent to the surface S at P and, thus, r'(0) is orthogonal to ∇g(P). If P is a local extreme value of f, then P will be a local extreme value of the function f(r(t)). Assuming that r is differentiable at 0, it follows that (d/dt)f(r(t))=∇f(P)⋅r'(0)=0. Since this holds for every such r:[-1,1]→ S, we conclude that ∇f(P) must be parallel to the normal vector to S at P. Thus ∇f(P) must be parallel to ∇g(P). In other words, ∇f(P)=λ∇g(P) for some real number λ.

Remark The function f in the theorem is the function to be maximized and the function g is called the constraint. The number λ is called the Lagrange multiplier . If we like we can restate the theorem by picking a number k and setting S:={(x,y,z)∈ R3: g(x,y,z)=k}. Then for f(P) to be a local extreme value of f on S we still need ∇f(P)=λ∇g(P). You can deduce this from the theorem by noticing that the gradient of g is equal to the gradient of g-k.

Remark The analogous theorem holds where f and g are functions of 2 variables. The statement is the same except that you write (x,y) everywhere you see (x,y,z). In fact, for any non-negative integer n, the analogous theorem holds for functions of n variables.

Method of Lagrange Multipliers

Suppose f is a function that we wish to maximize subject to a constraint g=0. To find the maximum we

  1. Find all points P where g(P)=0 and ∇f(P) =λ∇g(P) for some λ∈R.
  2. Evaluate f(P) at all points P from from step 1. Thee largest such value should be the maximum of f subject to the constraint g; the smallest should be the mininimum.

To guarantee that the method will work we need to assume that the set S:={(x,y,z)∈ R3: g(x,y,z)=0} is closed and bounded and that, for every point P∈ S, ∇ g(P)≠0. In that case the method will work, because global extreme values are guaranteed to exist by the extreme value theorem and any global extremum will be a local extreme value.

An example

Here is a problem similar to one from the Stewart that we worked in class before we learned about Lagrange multipliers.

Problem Find the dimensions of an open box with maximum volume and surface area equal to 48.

Solution Let x, y and z denote the length, width and height of the box. The volume is V=V(x,y,z)=xyz. The constraint is that the surface area

  

is equal to 48. So we can write the constraint as g(x,y,z)=A(x,y,z)-48.

Note that any maximum of V will occur when x, y and z are all positive. So in looking for maxima we can assume that x,y,z>0. Now we have

  
 

So in step one we need to look for solutions to the equation

 

or explicitly


Equivalently, we can look for solutions to the system of equations


Now the trick is to multiply the the first, second and third equation by x, y and z respectively to get the equivalent system of equations:


Note that λ=0 is not possible because x,y,z>0. So, we can cancel out the λ in the last three terms and get

 

From the first equation, we see that 2xz=2yz. Therefore x=y since z>0. Now the second equation says that 2xz+x2=4xz. Thus x2=2xz. It follows that x=2z, since x is positive. Thus

 

Plugging back into the constraint we see that

 

So the only possible local extreme value is V(4,4,2)=32.

Unfortunately, the set S:={(x,y,z):A(x,y,z)=48, x,y,z>0} is neither closed nor bounded. However, using our physical intuition, we can argue that there must be some maximum volume of a box with surface area 48 and it must then also be a local maximum. Therefore, we conclude that the maximum volume is 32.

Another Example

Problem. Find the minimum surface area of an open box with volume V=108.

Solution. We still have V=xyz and A=2xz+2yz+xy as above. But now our constraint is V=108. So we seek x,y,z and λ such that x,y,z>0 and ∇A=λ∇ V. In other words we seek solutions to the system of equations

 

Multiplying the first by x, the second by y and the third by z as we did in the previous example, we find the equivalent system of equations

 

Now subtract the first equation is equivalent to the equation 2xz=2yz. Since z>0, this implies that x=y. The second equation is then equivalent to the equation 2xz+x2=4xz. This implies that x2=2xz. Since x>0, this implies that x=2z. So (x,y,z)=(2z,2z,z).

Now we substitute back into the constraint to get V=4z3=108. So z3=27. Thus

 

Again we appeal to physical intuition to deduce that there is a minimum of the surface area subject to the constraint that the volume is 108. So we conclude that this minimum is

 

Lagrange Multipliers with Two Constraints

There is a version of the Lagrange multiplier theorem that works with two constraints. I state it for functions of 3 variables since that is the case where it will most often be used in the class. However, it is also useful for functions with 4 or more variables.

Theorem. Let f, g and h be continously differentiable functions of 3 variables and set

 

Suppose that

  1. f(P) is a local extreme value of f on S;
  2. ∇g(P) and ∇h(P) are not parallel.

Then there are real numbers λ and μ such that


Example

We can use the Lagrange multiplier theorem with two constraints to maximize or minimize functions the same way we used the theorem with one constraint: we use it as a way to look for local extreme values.

Problem. Let C denote the circle fromed by the intersection of the plane x+y+z=0 and the sphere x2 + y2 + z2=1. Maximize x+2y+3z on C.

Solution. We set

  • f(x,y,z)=x+2y+3z⇒ ∇f=⟨1, 2, 3⟩;
  • g(x,y,z)=x+y+z⇒ ∇g=⟨1,1,1⟩;
  • h(x,y,z)=x2 + y2 + z2-1⇒h=⟨2x,2y,2z⟩;

Suppose f(P) is a local extremum of f on C with P=(x,y,z), then there exist λ and μ such that

 

This gives a system of equations


Adding the equations, taking into account that x+y+z=0, we see that 6=3λ⇒ λ=2. Since ⟨ 1,2,3⟩ is not parallel to ⟨ 1,1,1⟩, we must have μ≠ 0. Therefore the equation 2=2+2μy implies that y=0. It follows that z=-x. Using the fact that h=0, we then see that 2x2=1. Thus we have

  

Looking at both possible values, we see that


is the maximum.