13 Functions of Several Variables

13.9 Lagrange Multipliers

In the previous section, we were concerned with finding maxima and minima of functions without any constraints on the variables (other than being in the domain of the function). We ended by discussing what we would do if there were constraints on the variables. The following example illustrates a simple case of this type of problem.

Example 13.9.1 Maximizing an Area

For a rectangle whose perimeter is 20 m, find the dimensions that will maximize the area.

SolutionThe area A of a rectangle with width x and height y is A=xy. The perimeter P of the rectangle is then given by the formula P=2x+2y. Since we are given that the perimeter P=20, this problem can be stated as:

Maximize f(x,y)=xy subject to 2x+2y=20

The reader is probably familiar with a simple method, using single-variable calculus, for solving this problem. Since we must have 2x+2y=20, then we can solve for, say, y in terms of x using that equation. This gives y=10-x, which we then substitute into f to get f(x,y)=xy=x(10-x)=10x-x2. This is now a function of x alone, so we now just have to maximize the function f(x)=10x-x2 on the interval [0,10]. Since f(x)=10-2x=0x=5 and f′′(5)=-2<0, then the Second Derivative Test tells us that x=5 is a local maximum for f, and hence x=5 must be the global maximum on the interval [0,10] (since f=0 at the endpoints of the interval). So since y=10-x=5, then the maximum area occurs for a rectangle whose width and height both are 5 m.

margin: Note: Joseph Louis Lagrange (1736–1813) was a French mathematician and astronomer.

Notice in the above example that the ease of the solution depended on being able to solve for one variable in terms of the other in the equation 2x+2y=20. But what if that were not possible (which is often the case)? In this section we will use a general method, called the Lagrange multiplier method, for solving constrained optimization problems:

Maximize (or minimize) f(x,y) subject to g(x,y)=c

for some constant c. The equation g(x,y)=c is called the constraint equation, and we say that x and y are constrained by g(x,y)=c. Points (x,y) which are maxima or minima of f(x,y) with the condition that they satisfy the constraint equation g(x,y)=c are called constrained maximum or constrained minimum points, respectively. Similar definitions hold for functions of three variables.

The previous section optimized a function on a set S. In this section, “subject to g(x,y)=c” is the same as saying that the set S is given by {(x,y)|g(x,y)=c}. The Lagrange multiplier method for solving such problems can now be stated:

Theorem 13.9.1      Lagrange Multipliers

Let f(x,y) and g(x,y) be functions with continuous partial derivatives of all orders, and suppose that c is a scalar constant such that g(x,y)0 for all (x,y) that satisfy the equation g(x,y)=c. Then to solve the constrained optimization problem

Maximize (or minimize) f(x,y) subject to g(x,y)=c,

find the points (x,y) that solve the equation f(x,y)=λg(x,y) for some constant λ (the number λ is called the Lagrange multiplier). If there is a constrained maximum or minimum, then it must be at such a point.

A rigorous proof of the above theorem is well beyond the scope of this text. Note that the theorem only gives a necessary condition for a point to be a constrained maximum or minimum. Whether a point (x,y) that satisfies f(x,y)=λg(x,y) for some λ actually is a constrained maximum or minimum can sometimes be determined by the nature of the problem itself. For instance, in Example 13.9.1 it was clear that there had to be a global maximum.

So how can you tell when a point that satisfies the condition in Theorem 13.9.1 really is a constrained maximum or minimum? The answer is that it depends on the constraint function g(x,y), together with any implicit constraints. It can be shown that if the constraint equation g(x,y)=c (plus any hidden constraints) describes a bounded set B in 2, then the constrained maximum or minimum of f(x,y) will occur either at a point (x,y) satisfying f(x,y)=λg(x,y) or at a “boundary” point of the set B.

In Example 13.9.1 the constraint equation 2x+2y=20 describes a line in 2, which by itself is not bounded. However, there are “hidden” constraints, due to the nature of the problem, namely 0x,y10, which cause that line to be restricted to a line segment in 2 (including the endpoints of that line segment), which is bounded.

Example 13.9.2 Maximizing an Area

For a rectangle whose perimeter is 20 m, use the Lagrange multiplier method to find the dimensions that will maximize the area.

SolutionAs we saw in Example 13.9.1, with x and y representing the width and height, respectively, of the rectangle, this problem can be stated as:

Maximize f(x,y)=xy subject to g(x,y)=2x+2y=20.

Then solving the equation f(x,y)=λg(x,y) for some λ means solving the equations fx=λgx and fy=λgy, namely:

y =2λ,
x =2λ

The general idea is to solve for λ in both equations, then set those expressions equal (since they both equal λ) to solve for x and y. Doing this we get

y2=λ=x2x=y,

so now substitute either of the expressions for x or y into the constraint equation to solve for x and y:

20=g(x,y)=2x+2y=2x+2x=4xx=5y=5

There must be a maximum area, since the minimum area is 0 and f(5,5)=25>0, so the point (5,5) that we found (called a constrained critical point) must be the constrained maximum. Therefore, the maximum area occurs for a rectangle whose width and height both are 5 m.

Example 13.9.3 Extreme Values on a Circle

Find the points on the circle x2+y2=80 which are closest to and farthest from the point (1,2).

SolutionThe distance d from any point (x,y) to the point (1,2) is

d=(x-1)2+(y-2)2,

and minimizing the distance is equivalent to minimizing the square of the distance. Thus the problem can be stated as:

Maximize (and minimize) f(x,y)=(x-1)2+(y-2)2 subject to g(x,y)=x2+y2=80.

Solving f(x,y)=λg(x,y) means solving the following equations:

2(x-1) =2λx,
2(y-2) =2λy

Note that x0 since otherwise we would get -2=0 in the first equation. Similarly, y0. So we can solve both equations for λ as follows:

x-1x=λ=y-2yxy-y=xy-2xy=2x
margin:

x2+y2=80

(4,8)

(1,2)

(-4,-8)
Figure 13.9.1: The circle in Example 13.9.3.

Substituting this into g(x,y)=x2+y2=80 yields 5x2=80, so x=±4. So the two constrained critical points are (4,8) and (-4,-8). Since f(4,8)=45 and f(-4,-8)=125, and since there must be points on the circle closest to and farthest from (1,2), then it must be the case that (4,8) is the point on the circle closest to (1,2) and (-4,-8) is the farthest from (1,2) (see Figure 13.9.1).

Notice that since the constraint equation x2+y2=80 describes a circle, which is a bounded set in 2, then we were guaranteed that the constrained critical points we found were indeed the constrained maximum and minimum.

The Lagrange multiplier method can be extended to functions of three variables.

Example 13.9.4 Maximizing a Function of Three Variables

Maximize (and minimize) f(x,y,z)=x+z subject to g(x,y,z)=x2+y2+z2=1.

SolutionSolve the equation f(x,y,z)=λg(x,y,z):

1 =2λx
0 =2λy
1 =2λz

The first equation implies λ0 (otherwise we would have 1=0), so we can divide by λ in the second equation to get y=0 and we can divide by λ in the first and third equations to get x=12λ=z. Substituting these expressions into the constraint equation g(x,y,z)=x2+y2+z2=1 yields the constrained critical points (12,0,12) and (-12,0,-12). Since f(12,0,12)>f(-12,0,-12), and since the constraint equation x2+y2+z2=1 describes a sphere (which is bounded) in 3, then (12,0,12) is the constrained maximum point and (-12,0,-12) is the constrained minimum point.

Two Constraints

When we have two constraints, we can still use Lagrange multipliers once we’ve made a slight modification. The optimization problem

Maximize (or minimize) f(x,y,z) subject to g(x,y,z)=c1 and h(x,y,z)=c2

is satisfied when f(x,y,z)=λg(x,y,z)+μh(x,y,z).

Example 13.9.5 Optimizing with Two Constraints

The plane x-y+z=2 intersects the cylinder x2+y2=4 in an ellipse. Find the points on the ellipse closest to and farthest from the origin.

SolutionWe can optimize the distance x2+y2+z2 by optimizing the function f(x,y,z)=x2+y2+z2, which has a simpler derivative. Let g(x,y,z)=x-y+z be the plane constraint, and h(x,y,z)=x2+y2 be the cylinder constraint. We see that

f(x,y,z) =2x,2y,2z
g(x,y,z) =1,-1,1
h(x,y,z) =2x,2y,0.

The equation f=λg+μh means that

2x =λ+2μx
2y =-λ+2μy
2z =λ.

Adding the first two equations tells us that x+y=μ(x+y), so that μ=1 or x=-y. If μ=1, then λ=z=0, and the constraint equations become

x-y =2
x2+y2 =4.

Substituting x=y+2 into x2+y2=4 tells us that (y+2)2+y2=4, which simplifies to 2y(y+2)=0. This means that we need to look at the points (2,0,0) and (0,-2,0), which are both distance 2 from the origin. If x=-y, then the constraint equations become

2x+z =2
2x2 =4

and we need to look at the points (±2,2,222). These have distance 2+2+(222)2=1682, which are both greater than 2. Therefore, the closest points are (2,0,0) and (0,-2,0), while the furthest point is (-2,2,2+2).

Finally, note that solving the equation f(x,y)=λg(x,y) means having to solve a system of two (possibly nonlinear) equations in three unknowns, which as we have seen before, may not be possible to do. And the 3-variable case can get even more complicated. All of this somewhat restricts the usefulness of Lagrange’s method to relatively simple functions. Luckily there are many numerical methods for solving constrained optimization problems, though we will not discuss them here.

Exercises 13.9

 

Problems

  1. 1.

    Find the constrained maxima and minima of f(x,y)=2x+y given that x2+y2=4.

  2. 2.

    Find the constrained maxima and minima of f(x,y)=xy given that x2+3y2=6.

  3. 3.

    Find the points on the circle x2+y2=100 which are closest to and farthest from the point (2,3).

  4. 4.

    Find the constrained maxima and minima of f(x,y,z)=x+y2+2z given that 4x2+9y2-36z2=36.

  5. 5.

    Find the maximum volume of a rectangular box inscribed in the unit sphere.

  6. 6.

    Find the minimum surface area of a box that holds 2 cubic meters.

  7. 7.

    The girth of a box is the perimeter of a cross section perpendicular to its length. The US post office will accept packages whose combined length and girth are at most 130 inches. Find the dimensions of the largest volume box that will be accepted.

  8. 8.

    Using Lagrange multipliers, find the shortest distance from the point (x0,y0,z0) to the plane ax+by+cz=d. (See also Key Idea 11.6.1.)

  9. 9.

    Find all points on the surface xz-y2+1=0 that are closest to the origin.

  10. 10.

    Find the three positive numbers whose sum is 60 and whose product is as large as possible.

  11. 11.

    Find all points on the plane x+y+z=5 in the first octant at which f(x,y,z)=x2yz2 has a maximum value.

  12. 12.

    Find the points on the surface z2-xy=5 that are closest to the origin.

  13. 13.

    Find the maximum and minimum points of f(x,y)=xy+9-x2-y2 when x2+y29.

  14. 14.

    Find three real numbers whose sum is 12 and the sum of whose squares is a small as possible.

  15. 15.
    Find the volume of the largest rectangular parallelepiped that can be inscribed in the ellipsoid x2a2+y2b2+z2c2=1.
  16. 16.

    The plane x+y-z=1 intersects the cylinder x2+y2=1 in an ellipse. Find the points on the ellipse closest to and farthest from the origin.

  17. 17.

    Consider f(x,y)=x2+2y2+2xy+2x+3y subject to x2-y=1. Show that there is no maximum. Find the minimum.

  18. 18.

    Find the minimum of f(x,y,z)=x2+2y2+z2 subject to x+y+z=4 and x-y+2z=12.

Modern Campus CMS