Homework Problems: X X y y
Homework Problems: X X y y
Maths21a
This is part 3 (of 3) of the weekly homework. It is due July 27 at the beginning of class.
SUMMARY.
Extremize f (x, y) under the constraint g(x, y) = c: Solve g(x, y) = c, f (x, y) = g(x, y)
with Lagrange multiplier , These are 3 equations for 3 unknowns x, y, :
fx (x, y) = gx (x, y)
fy (x, y) = gy (x, y)
g(x, y) = c
In three dimensions, the Lagrange equations form 4 equations for 4 unknowns.
fx (x, y, z)
fy (x, y, z)
fz (x, y, z)
g(x, y, z)
=
=
=
=
gx (x, y, z)
gy (x, y, z)
gz (x, y, z)
c
Homework Problems
1) (4 points) Find the extrema of the function f (x, y) = e x
x2 + y 2 = 4 using the method of Lagrange multipliers.
2 y 2
Solution:
The Lagrange equations are
(2x 2x3 4xy 2 )ex
2 y 2
= 2x
x2 y 2
Case 1: If x = 0, then the first equation is ok and we get from the third equation y = 2.
Case 2: If y = 0, then the second equation is ok and we get from the third edquation
x = 2.
Case 3: If x = 0 and y = 0, then the first two equations are ok, but clashes with the
third. Forget this case.
Case 4: If both x and y are not zero we can divide the first equation by 2x and the second
by 2y. We also replace x2 y 2 by 4
(1 x2 2y 2 )e4 =
(2 2y 2 x2 )e4 =
x2 + y 2 = 4 .
But setting the first two equations equal leads to a contradiction. Also this case 4) has no
solutions. We end up with the four solutions (2, 0), (2, 0), (0, 2), (0, 2). The minimal
values are f (2, 0) = 4e4 , the maximal values are f (0, 2) = 8e4 .
2 y 2
Solution:
2
2
In the last homework we have seen that the equation f = ((2x 2x 3 )ex y , (4y
2
2
4y 3 )ex y ) = (0, 0) has the solutions x = 0, y = 0, x = 0, y = 1, y = 0, x = 1. Together with the previous problem, we can now make a list of all the candidates for extrema
1. Extrema inside
2. Extrema on the boundary
point f =
point f =
(0,0) 0
(2,0) 4/e4
(1,0) 1/e
(-2,0) 4/e4
(-1,0) 1/e
(0,2) 8/e4
(0,1) 2/e
(0,-2) 8/e4
(0,-1) 2/e
We see that the origin is the minimum and the points (0, 1) are both the maxima.
3) (4 points) Find the points (x, y, z) on the surface g(x, y, z) = xy 2 z 3 2 = 0 that are closest
to the origin (0, 0, 0).
Solution:
=
=
=
=
y 2
2xy
3z 2
z3 + 2
=
=
=
=
y 2
x
3z
z3 + 2
1.25
the
distance
from
1/6
1/3
1.7723. The first one is the
the points (3/31 (1, 2, 2/3) to the origin is 31
minimum.
4) (4 points) Let a, b, c be non-negative constants and let F be the function F (x, y, z) = x log(x)
y log(y) z log(z) ax by cz. Find the maxima and minima of F on x > 0, y > 0, z > 0
under the constraint x + y + z = 1.
Solution:
The Lagrange equations are
log(x) 1 a
log(x) 1 b
log(x) 1 c
x+y+z
=
=
=
=
Solution:
2xy = ( y 2 + x2 + x2 / y 2 + x2 + 2x)
q
x2 = yx/ y 2 + x2
q
1 = x y 2 + x2 + x2
There are different possibilities to solve this a bit
system. Since x 6= 0, we can
tricky
2
2
divide the second equation by x. replace it by x x + y = y or its square. The third
equation becomes therefore 1 = y + x2 . The square roots of the first equation can then
also be replaced by y/x.
2xy = (y/x + x3 /(y) + 2x)
x2 (y 2 + x2 ) = 2 y 2
1 = y + x2 .
Until now, we were just trying to simplify, not yet eliminiating. To eliminate , we
multiply the first equation by and replace y by (1x2 ). We end up with two equations:
2xy 2 = (1 x2 )((1 x2 )/x + x3 /(1 x2 ) + 2x)
x2 (y 2 + x2 ) = (1 x2 )2
Te second equation is equivalent to x2 y 2 = 1 2x2 so that the second equation gives
y 2 = (1 2x2 )/x2 . This can be plugged into the first equation to obtain
2x(1 2x2 ) = x(1 x2 )2 + x5 + 2x3 (1 x2 )
which simplifies to x = 4x3 . The solution is therefore a = 1/2, h =
2. Whao!
Remark. This problem was on the edge what is possible to solve by hand. A two dimensional version of the
problem, where one asks for the equilateral triangle of height h and ground side 2a which has maximal area if the
circumfence 2a + 2 a2 + h2 = 2 is fixed. The solutions of the Lagrange equations are then a = 1/3, h = 1/ 3.
Remarks
(You dont need to read these remarks to do the problems.)
Remark to problem 4) This problem appears in thermodynamics and is relevant in biology
or chemistry. If x, y, z are the probabilities that a system is in state X, Y, Z and a, b, c are
the energies for these states. Then x log(x) y log(y) z log(z) is called the entropy of
the system and E = ax + by + cz is the energy. The number F (x, y, z) is called the free
energy. If energy is fixed, nature tries to maximize entropy. Otherwise it tries to minimize
the free energy F = S E. If we extremize F under the constraint of having total probability
G(x, y, z) = x + y + z = 1, we obtain the so called Gibbs distribution.
Challenge Problems
(Solutions to these problems are not turned in with the homework.)
1) What does it mean that the Lagrange multiplier is zero in a constrained optimization problem?
2) Extend the Lagrange method to arbitrary dimensions. Find the equations to find the extrema
of a function f (x1 , ..., xn ) under the constraint g(x1 , ..., xn ) = c.
P
3) Let I = ni=1 pi log(pi ) be the entropy of a probability distribution (p1 , . . . , pn ). Show that
among all probability distributions, the one where p i = 1/n is the one which maximizes entropy.
4) Find the box of dimensions x, y, z, w in four dimensional space which has maximal hyper
volume V = xyzw under the constraint that the surface volume A = 2xy + 2xz + 2xw +
2yz + 2yw + 2zw is fixed equal to 12.