You are on page 1of 40

Optimization

LAGRANGE’S METHOD
Another method for solving the system
of equations 2–5 is to solve each of Equations
2, 3, and 4 for λ and then to equate
the resulting expressions.
LAGRANGE’S METHOD Example 2
Find the extreme values of the function
f(x, y) = x2 + 2y2 on the circle x2 + y2 = 1.

▪ We are asked for the extreme values of f


subject to the constraint

g(x, y) = x2 + y2 = 1
LAGRANGE’S METHOD Example 2
Using Lagrange multipliers, we solve
the equations and g(x, y) = 1.

These can be written as:


fx = λgx
fy = λgy
g(x, y) = 1
LAGRANGE’S METHOD
They can also be written as:

2x = 2xλ

4y = 2yλ

x2 + y2 = 1
LAGRANGE’S METHOD Example 2
From Equation , we have
x = 0 or λ = 1

▪ If x = 0, then Equation gives y = ±1.

▪ If λ = 1, then y = 0 from Equation 10;


so, then Equation gives x = ±1.
LAGRANGE’S METHOD Example 2
Therefore, f has possible extreme values
at the points
(0, 1), (0, –1), (1, 0), (–1, 0)

▪ Evaluating f at these four points,


we find that:

f(0, 1) = 2 f(0, –1) = 2 f(1, 0) = 1 f(–1, 0) = 1


LAGRANGE’S METHOD Example 2
Therefore, the maximum value of f
on the circle x2 + y2 = 1 is:
f(0, ±1) = 2

The minimum value is:


f(±1, 0) = 1
LAGRANGE’S METHOD Example 2
Checking with the figure, we see that
these values look reasonable.
LAGRANGE’S METHOD
The geometry behind the use of Lagrange
multipliers in Example 2 is shown here.

▪ The extreme values


of f(x, y) = x2 + 2y2
correspond to the
level curves that
touch the circle
x2 + y2 = 1
LAGRANGE’S METHOD Example 3
Find the extreme values of
2 2 2 2
f(x, y) = x + 2y on the disk x + y ≤ 1

▪ According to the procedure, we compare the values


of f at the critical points with values at the points
on the boundary.
LAGRANGE’S METHOD Example 3
Since fx = 2x and fy = 4y, the only critical
point is (0, 0).

▪ We compare the value of f at that point


with the extreme values on the boundary
from Example 2:

f(0, 0) = 0 f(±1, 0) =1 f(0, ±1) = 2


LAGRANGE’S METHOD Example 3
Therefore, the maximum value of f
on the disk x2 + y2 ≤ 1 is:
f(0, ±1) = 2

The minimum value is:


f(0, 0) = 0
LAGRANGE’S METHOD Example 4
Find the points on the sphere
x2 + y2 + z2 = 4 that are closest to
and farthest from the point (3, 1, –1).
LAGRANGE’S METHOD Example 4
The distance from a point (x, y, z) to the point
(3, 1, –1) is:

▪ However, the algebra is simpler if we


instead maximize and minimize the square
of the distance:
LAGRANGE’S METHOD Example 4
The constraint is that the point (x, y, z)
lies on the sphere, that is,

g(x, y, z) = x2 + y2 + z2
=4
LAGRANGE’S METHOD Example 4
According to the method of Lagrange
multipliers, we solve:
LAGRANGE’S METHOD
That gives:
2(x – 3) = 2xλ

2(y – 1) = 2yλ

2(z + 1) = 2zλ

x2 + y2 + z2 = 4
LAGRANGE’S METHOD Example 4
The simplest way to solve these equations
is to solve for x, y, and z in terms of λ from
Equations 12, 13, and 14, and then
substitute these values into Equation 15.
LAGRANGE’S METHOD Example 4
From Equation 12, we have:

x – 3 = xλ or x(1 – λ) = 3 or

▪ Note that 1 – λ ≠ 0 because λ = 1 is impossible


from Equation 12.
LAGRANGE’S METHOD Example 4
Similarly, Equations 13 and 14
give:
LAGRANGE’S METHOD Example 4
So, from Equation 15, we have:

▪ This gives (1 – λ)2 = 11/4, 1 – λ = ± .

▪ Thus,
LAGRANGE’S METHOD Example 4
These values of λ then give the corresponding
points (x, y, z):

▪ It’s easy to see that f has a smaller value


at the first of these points.
LAGRANGE’S METHOD Example 4
Thus, the closest point is:

The farthest is:


LAGRANGE’S METHOD
The figure shows the sphere and
the nearest point in Example 4.

▪ Can you see how to


find the coordinates
of P without using
calculus?
TWO CONSTRAINTS
Suppose now that we want to find
the maximum and minimum values of
a function f(x, y, z) subject to two constraints
(side conditions) of the form g(x, y, z) = k
and h(x, y, z) = c.
TWO CONSTRAINTS
Geometrically, this means:

▪ We are looking for the extreme values of f


when (x, y, z) is restricted to lie on the curve
of intersection C of the level surfaces
g(x, y, z) = k and
h(x, y, z) = c.
TWO CONSTRAINTS
Suppose f has such an extreme value at
a point P(x0, y0, z0).

We know from the beginning of this section


that is orthogonal to C at P.
TWO CONSTRAINTS
However, we also know that is orthogonal
to g(x, y, z) = k and is orthogonal to
h(x, y, z) = c.

So, and are both orthogonal to C.


TWO CONSTRAINTS
This means that the gradient vector
is in the plane determined
by and

▪ We assume that these gradient vectors


are not zero and not parallel.
TWO CONSTRAINTS
So, there are numbers λ and μ
(called Lagrange multipliers)
such that:
TWO CONSTRAINTS
In this case, Lagrange’s method is to look
for extreme values by solving five equations
in the five unknowns

x, y, z, λ, μ
TWO CONSTRAINTS
These equations are obtained by writing
Equation 16 in terms of its components and
using the constraint equations:

fx = λgx + μhx fy = λgy + μhy fz = λgz + μhz

g(x, y, z) = k h(x, y, z) = c
TWO CONSTRAINTS Example 5
Find the maximum value of the function
f(x, y, z) = x + 2y + 3z on the curve of
intersection of the plane x – y + z = 1
and the cylinder x2 + y2 = 1
TWO CONSTRAINTS Example 5
We maximize the given function subject
to the constraints

g(x, y, z) = x – y + z = 1

h(x, y, z) = x2 + y2 = 1
TWO CONSTRAINTS
The Lagrange condition is
So, we solve the equations
1 = λ + 2xμ
2 = –λ + 2yμ
3=λ
x–y+z=1
x2 + y2 = 1
TWO CONSTRAINTS Example 5
Putting λ = 3 (from Equation 19)
in Equation 17, we get 2xμ = –2.

Thus, x = –1/μ.

▪ Similarly, y = 5/(2μ).
TWO CONSTRAINTS Example 5
Substitution in Equation 21 then
gives:

▪ Thus,
TWO CONSTRAINTS Example 5
Then,

and, from Equation 20,


TWO CONSTRAINTS Example 5
The corresponding values of f are:

▪ Hence, the maximum value of f


on the given curve is:

You might also like