Maximum and minimum along a curve - Differentiation - Two-Dimensional Calculus

Two-Dimensional Calculus (2011)

Chapter 2. Differentiation

9. Maximum and minimum along a curve

A railroad train travels from San Francisco to Los Angeles. Plotting its route on a contour map, how do we find the point of maximum altitude? We might guess that at such a point the direction of the tracks must be tangent to a contour line (Fig. 9.1). Indeed, where the tracks cross a contour line, one would expect the altitude to be either increasing or decreasing. With slight qualifications, this observation leads to very simple solutions of many maximum and minimum problems, and to a general method for treating problems of this type.5 The method may be stated roughly as follows:

Image

FIGURE 9.1 Highest point along track, and tangent contour line

if a function f has a maximum or minimum along a curve C at a point (x0, y0), then the level curve of f through (x0, y0) is tangent to C. In the above discussion, the function f(x, y) is the altitude, and the curve C is the route of the train.

Theorem 9.1 Method of Level Curves Let f(x, y) be continuously differentiable in D, and let C:x(t), y(t), a ≤ t ≤ b, be a regular curve in D. Suppose f(x, y) has a maximum or minimum along C at the point (x0, y0) = (x(t0), y(t0)), where a < t0 < b. Then either

1. f(x0, y0) = 0

or

2. the level curve f(x, y) = f(x0, y0) is tangent to C at (x0, y0).

PROOF. We consider the function fc(t). If it has a maximum or minimum at t0, then Image = 0. But by the chain rule,

Image

There are two alternatives. Either f(x0, y0) = 0 (case 1 in the statement of the theorem), or else f(x0, y0) ≠ 0, in which case we know from the Corollary to Th. 8.2 that the level curve f(x, y) = f(x0, y0) is a regular curve near (x0, y0). Furthermore, by Th. 8.1 the tangent to this level curve is perpendicular to f(x0, y0). But Eq. (9.1) states that the tangent to C is perpendicular to f(x0, y0). Thus, the curve C and the level curve of f have the same tangent line at (x0, y0), and case 2 holds in the statement of the theorem. Image

Remark In practice, one often ignores case 1, and simply looks for points of tangency (as in our rough statement of the theorem). However, it should be noted that case 1 is a real possibility, and not just a technical complication. For example, should the train discussed in the first paragraph of this section choose to go right over the top of a mountain, then at its highest point the level curve would “reduce to a point”, and case 2 would be meaningless. But at a mountain top f = 0. (If our curve represented a trail rather than a train route, this would be a very likely possibility.) An even more frequent occurrence would be for the highest point to be the summit of a pass. It is intuitively clear that a contour line through such a point generally splits into a pair of crossing curves, so that again case 2 is meaningless (Fig. 9.2). But we have observed earlier (following Def. 7.1), that case 1 must necessarily hold at the summit of a pass.

Thus, to apply the method of Th. 9.1 one should first check if there are any points on the curve C where f(x0, y0) = 0, and then look for points of tangency.

Image

FIGURE 9.2 Summit of a pass

Example 9.1

Find the point along a coastline nearest to a fixed point inland.

If we let (x1, y1) be the fixed point and C the coastline, then we have to minimize the function

Image

subject to the restriction that (x, y) lies on C. Since

Image

which is zero only at the point (x1, y1), we have f(x0, y0) ≠ 0, where (x0, y0) is the point on C nearest (x1, y1). Thus the level curve of f through (x0, y0) must be tangent to C at (x0, y0). But the level curves of f are circles about (x1, y1), and since the radius of a circle is always perpendicular to its tangent line, we may state the result as follows: the nearest point to (x1, y1) along C, must be a point (x0, y0) such that the line from (x1, y1) to (x0, y0) is perpendicular to C at (x0, y0) (Fig. 9.3).

A “practical” way to find this point would be to place a light at (x1, y1) and then sail along the coast holding a mirror parallel to the direction of motion. At the nearest point, the light would be reflected directly back to (x1, y1).

Image

FIGURE 9.3 Shortest distance from a point to a curve

Example 9.2

The milkmaid problem A milkmaid has to go from her house to a river, fill a pail with water, and then take it to the barn. For what point P along the river is her total path the shortest?

Denote by H and B the points at which the house and barn are located. For any point P, the function we are minimizing is the sum of the distances from H to P and from P to B (Fig. 9.4). The level curves of this function are ellipses with foci at H and B. At the point P along the river where this function is a minimum, the corresponding ellipse must be tangent to the river.

Consider first the case where the river is a straight line l. Then this line is tangent to the ellipse at the point P. In this case there is an elementary solution to the problem. If we reflect B in the straight line we get a point B' and the total distance from H to P to B is the same as the distance from H to P to B' (Fig. 9.5). To minimize this distance, we clearly must choose P on the straight line from H to B'. Then the angle between PH and l must equal the angle between PB' and l, which equals the angle between PB and l. The equality of these angles is a basic fact of reflection of light, and follows from the assumption that reflected light follows the shortest path. The above reasoning also shows that if P is the point where a tangent line touches an ellipse, then the lines from P to the foci make equal angles with l.

Finally, if we consider the general case, we see that the river must have a direction at P tangent to the ellipse, and hence that the angles made by PH and PB with the river must be equal. We may therefore formulate an equally practical solution to this problem as to the last. We place a bright light at the house, sail down the river with a mirror, and at the desired point the reflected light will hit the barn.

Image

FIGURE 9.4 Shortest distance between two points, with stop-off on a curve

Example 9.3

If the sum of two numbers is a given positive number s, what is the maximum of their product?

Let the numbers be x and y. We are given that x + y = s, for some fixed number s. The function we wish to maximize is f(x, y) = xy. We must therefore find the point on the line x + y = s that maximizes xy. We note that the function xy is negative where the line x + y = s is in the second and fourth quadrants,

Image

FIGURE 9.5 Reflection method for finding shortest path

zero where it crosses the x and y axes, and positive in the first quadrant. It therefore has a maximum at some point (x0, y0) in the first quadrant, and the level curve xy = c through this point must be tangent to x + y = s. This means the slope of xy = c at (x0, y0) must be − 1. But if

Image

Thus x0 = y0, and since x0 + y0 = s, x0 = y0 = s/2, and x0y0 = s2/4. Thus for any point (x, y) on x + y = s (Fig. 9.6),

Image

In particular, if x and y are any two positive numbers, then since they lie on some line x + y = s, we have the inequality

Image

This is called the inequality of the geometric mean and the arithmetic mean, these being the designation of the left- and right-hand sides of (9.2), respectively.

Image

FIGURE 9.6 Minimizing xy for x + y = s

We now wish to consider a special case of the type of problem we have been considering. We assume that the curve C is given implicitly by an equation g(x, y) = k. Example 9.3 was of this nature, where the equation g(x, y) = kwas x + y = s. The problem can be formulated as follows:

“find the maximum (or minimum) of a function f(x, y) subject to the condition g(x, y) = k.”

Such a problem is called a maximum problem with a side condition or with a constraint. The solution consists in observing that the side condition g(x, y) = k is merely the implicit form of a curve C, and the problem therefore reduces to our previous one. The result is then usually stated as follows.

Theorem 9.2 Lagrange Multiplier Method If a function f(x, y) has a maximum or minimum at (x0, y0) subject to the condition g(x, y) = k, then either

1. g(x0, y0) = 0

or

2. f(x0, y0) = λg(x0, y0), for some λ.

PROOF. It is sufficient to show that if case 1 does not hold, then case 2 must hold. Suppose, therefore, g(x0, y0) ≠ 0. Then the equation g(x, y) = g(x0, y0) = k defines a regular curve C near (x0, y0). Since f(x, y) has a maximum or minimum along C at (x0, y0), either f(x0, y0) = 0, in which case conclusion 2 holds with λ = 0, or else the level curve of f through (x0, y0) is tangent to C. But f(x0, y0) is perpendicular to this level curve, and g(x0, y0) is perpendicular to the curve C (which is a level curve of g(x, y)) and hence f(x0, y0) and g(x0, y0) have the same (or opposite) direction. But that is precisely what conclusion 2 asserts (Fig. 9.7). Image

Remark The natural way to attack a problem of this type would be to solve the equation g(x, y) = k for x or y, and substitute in the function f, thus obtaining a function of a single variable. For instance, in Example 9.3, we had x + y = s or y = sx, and f(x, y) = xy = sxx2. Differentiation with respect to x yields x = s/2. However, as we have observed earlier, there are very few cases where an equation g(x, y) = k can be solved explicitly. An alternative approach is to differentiate the equation g(x, y) = k implicitly, giving

Image

Image

FIGURE 9.7 Geometric interpretation of Lagrange multiplier method

Then considering y to be a function of x by the equation g(x, y) = k, we have that f(x, y(x)) has a maximum or minimum, and hence

Image

Eliminating dy/dx, gives

Image

which can sometimes be solved simultaneously with g(x, y) = k to yield the desired point. It is a question of solving two equations in two unknowns. If we rewrite Eq. (9.3) in the form

Image

and if we denote the common value of both sides of this equation by λ, then we have again case 2 in Th. 9.2, which may be written as

Image

These two equations, combined with

Image

yield three equations in the three unknowns x0, y0, λ. Although it may seem to complicate matters to introduce an extra unknown and an extra equation, the fact is that this device often proves useful. (The application made in the following section is a good case in point.) The new quantity λ, incidentally, is what is referred to as the Lagrange multiplier. One interpretation of this method is to consider the function h(x, y) = f(x, y) − λg(x, y), formed by changing f by a fixed multiple A of the constraint function g. Then Eqs. (9.5) simply say that h(x0, y0) = 0, and the problem is to find a multiple λ such that this equation holds simultaneously with Eq. (9.6).

Example 9.4

Find the minimum perimeter for rectangles having a fixed area A.

If the rectangle has length x and width y, then the perimeter is 2x + 2y and the area is xy. If we let

Image

the problem is to minimize f(x, y) under the side condition g(x, y) = A.

Method 1. Level curves The equation xy = A defines a hyperbola. Since the quantities x and y represent the sides of a rectangle, they cannot be negative. Thus we choose the curve C to be the branch of xy = A lying in the first quadrant, and we wish to find the minimum of f(x, y) along C. Since f = Image2, 2Image , which is never zero, at the point (x0, y0) of C where the minimum occurs, the curve C must be tangent to the level curve of f(x, y). But the level curves of f(x, y) are the straight lines x + y = c. It is clear geometrically (see Fig. 9.8), and it is easy to verify that tangency can only occur if x0 = y0. Since x0y0 = A, we find x0 = y0 = Image, and f(x0, y0) = 4Image .

Image

FIGURE 9.8 Maximizing x + y for xy = A

Method 2. Elimination of one variable The condition xy = A yields y = A/x. Substituting this in f(x, y), we find that the function to be minimized becomes 2(x + A/x). Setting the derivative of this function equal to zero yields 2(1 − A/x2) = 0, or x2 = A, x = ± Image. Since x is positive, x = Image, and since xy = A, y = A/x = A/Image = Image.

Method 3. Implicit differentiation Without solving the equation xy = A for y in terms of x, we can differentiate implicitly and obtain

Image

We consider the function

Image

where y(x) is determined from the relation xy = A. Then

Image

Setting h'(x) = 0 yields y = x, which gives the same solution to the problem as the previous two methods.

Method 4. Lagrange multipliers We have

Image

Since g is zero only at the origin, which does not lie on the curve xy = A for A > 0, we conclude that at the extreme point (x0, y0) on the curve xy = A “we must have f(x0, x0)” = λg(x0, y0) for some λ. This yields three equations (corresponding to Eqs. (9.5) and (9.6)):

Image

From the first two equations we have λ = 2/x0 = 2/y0, whence x0 = y0, and from the third, x0 = y0 = A1/2.

Exercises

9.1 Solve each of the following problems first by using Lagrange multipliers, and then by eliminating y and treating the problem as an extremum problem in one variable.

a. Find the maximum and minimum of x + 2y on x2 + y2 = 1.

b. Find the maximum and minimum of x4 + y4x2y2 + 1 on x2 + y2 = 4.

c. Find the minimum of x + y on the branch of the curve 1/x + 1/y = 1 lying in the first quadrant.

d. Find the maximum of 1/x + 1/y on the part of the curve 1/x2 + 1/y2 = 2 lying in the first quadrant.

e. Find the minimum of x2 + y2 on the curve x = y2 + 1. Explain why the second method does not work. (Hint: interpret the problem geometrically and indicate the answer by means of a sketch.)

Note: the Lagrange multiplier method is based on the assumption that (x0, y0) represents a maximum or minimum. It then gives a means of finding (x0, y0). However, if a point is obtained by the Lagrange multiplier method, it is sometimes difficult to decide whether that point represents a maximum or a minimum of the given function (for example, in Ex. 9.1d). In fact it may represent neither, but rather a kind of “inflection point” (see Ex. 9.2). Furthermore it may represent a local maximum or minimum but not an absolute maximum or minimum (see Ex. 9.3). In practice, some other reasoning is usually used to show that a maximum or minimum exists, and then the Lagrange multiplier method is used to find it.

9.2 Use Lagrange multipliers to find the points on the curve x + x5y = 2 where the function f(x, y) = xy may have a maximum or minimum. Then sketch the curve and sketch the level curves of f(x, y), and show that the point or points you have found do not represent either a local maximum or a local minimum of f.

9.3 Use Lagrange multipliers to find the points on the curve x3 − 3xy = 0 where the function ey may have a maximum or minimum. Show by a sketch that these points represent a local maximum or minimum but not an absolute maximum or minimum.

9.4 Use Lagrange multipliers to find the angle of a circular sector, which yields the minimum perimeter for a given area. (The angle and the radius are both allowed to vary.)

9.5 Find the distance from the point (x1, y1) to the line ax + by + c = 0, using Lagrange multipliers.

9.6 Solve parts a and b below by the method of Lagrange multipliers.

a. Find the point on x2 + y2 = 25 where the function 3x + 4y is maximum.

b. Find the point on 3x + 4y = 25 where the function x2 + y2 is minimum.

c. Give a geometric interpretation of part b.

d. Give a geometric interpretation of part a. (Hint: note that the function to be maximized may be interpreted as a dot product of vectors.)

e. Explain why in both parts a and b, the point sought must lie on the line y = Imagex.

Note: It happens quite frequently that the problem of maximizing a function f(x, y) subject to the condition that g(x, y) be constant, is equivalent to minimizing g(x, y) with f(x, y) held constant. This is illustrated by Exs. 9.5a, b, and also by Examples 9.3 and 9.4 (see also Exs. 10.22–10.24). The method of level curves provides a good explanation of this phenomenon, since it states that in both cases, the level curves of f and g through the given point must be tangent.

9.7 Illustrate the solutions to Exs. 9.6a, b by the method of level curves, using sketches similar to Figs. 9.6 and 9.8.

9.8 a. Let f(x, y) be the distance from the point (x, y) to a fixed straight line. What are the level curves of f?

b. Use the method of level curves to find the point on the ellipse x2/4 + y2 = 1 nearest to the line y = x + 5.

9.9 a. Let f(x, y) be the distance from the point (x, y) to a fixed circle. What are the level curves of f?

b. Let C1 and C2 be nonconcentric circles. Show that the point on C1 farthest from C2 must lie on the line through the centers of C1 and C2.

9.10 Let f(x, y) = 4 − (x + y)2 and let C be the circle x2 + y2 = 2.

a. What are the level curves of f(x, y)?

b. At what points of C are the level curves of f(x, y) tangent to C?

c. What is the maximum value of f(x, y) for all x and y, and at which points is it attained?

d. What is the maximum value of f(x, y) on C, and at which points is it attained ?

e. Are the level curves of (x, y) tangent to C at the points found in part d?

f. Explain how the method of level curves can be used to find the maximum and minimum of f(x, y) on C.

g. Sketch the surface z = f(x, y) and sketch the curve on that surface lying over the circle C, indicating the highest and lowest points on that curve, and the level curves at those points.

*9.11 Let L be the line segment joining the points (0, 1) and (0, 3). Let f(x, y) be the angle subtended by L at the point (x, y).

a. Describe the level curves of f(x, y). (You may use results from plane geometry.)

b. Use the method of level curves to find the point on the positive x axis where f(x, y) is maximum.

9.12 Let f(x, y) = x5 + x + 1, g(x, y) = x3 + y2.

a. Use the method of Lagrange multipliers to find the maximum of f(x, y) subject to the condition g(x, y) = 0.

b. What are the level curves of f(x, y)?

c. Sketch the curve g(x, y) = 0, and indicate the point where f(x, y) is maximum.

d. Explain why the method of level curves fails here and why Eqs. (9.5) and (9.6) do not have any common solutions in this case.