I Problemas5 Sol
I Problemas5 Sol
CHAPTER 5: Optimization
5-1. Find and classify the critical points of the following functions.
(a) f (x, y) = x2 − y 2 + xy.
(b) f (x, y) = x2 + y 2 + 2xy.
(c) f (x, y) = ex cos y .
2 2
(d) f (x, y) = e1+x −y .
(e) f (x, y) = x sin y.
(f) f (x, y) = xe−x (y 2 − 4y)
Solution:
(a) The gradient of f (x, y) = x2 − y 2 + xy is
∇f (x, y) = (2x + y, −2y + x)
and the critical points are the solutions to the following system of equations
2x + y = 0
−2y + x = 0
whose solution is (0, 0). The Hessian is
2 1
1 −2
which is indefinite. Hence, (0, 0) is a saddle point.
(b) The gradient of f (x, y) = x2 + y 2 + 2xy is ∇f (x, y) = (2x + 2y, 2y + 2x). The critical points are the
points of the form y = −x. The Hessian is
2 2
2 2
which is positive semidefinite. The second order conditions are not informative. But, since f (x, y) =
(x + y)2 ≥ 0 and f (x, −x) = 0 we see that the points of the form (x, −x) are global minima of f .
(c) The gradient of f (x, y) = ex cos y is
∇f (x, y) = (ex cos y cos y, −xex cos y sin y)
The critical points are solutions to the following system of equations
(cos y) ex cos y = 0
cos y = 0
≡
−x (sin y) ex cos y = 0 −x sin y = 0
The first equation implies that
π
y= + kπ, k = 0, ±1, ±2, . . .
2
For those values of y, sin y 6= 0 and the second equation implies now that x = 0. The solutions are
π
(0, + kπ) k = 0, ±1, ±2, . . .
2
The Hessian is
cos2 y
x cos y − sin y − x sin y cos y
e
− sin y − x sin y cos y −x cos y + x2 sin2 y
π
For x = 0, y = 2 + kπ, we obtain that
0 − sin y
− sin y 0 y= π
2 +kπ
whose determinant is − sin2 ( π2 + kπ) = −1. Thus, the critical points are saddle points.
1
2
2
−y 2
(d) The gradient of f (x, y) = e1+x is
2
−y 2
∇f (x, y) = 2e1+x (x, −y)
and the unique critical point is (0, 0). The Hessian is
2 + 4x2
2 2 −4yx 2e 0
Hf (0, 0) = e1+x −y =
−4yx −2 + 4y 2 x=0,y=0
0 −2e
whose determinant is − cos2 (kπ) = 1. Hence, the Hessian is indefinite and the critical points are saddle
points.
(f) The gradient of f (x, y) = xe−x (y 2 − 4y) is
∇f (x, y) = e−x ((1 − x)(y 2 − 4y), x(2y − 4))
The critical points are solutions to the following system of equations
(1 − x)(y 2 − 4y) = 0
x(2y − 4) = 0
that is (0, 0), (0, 4) and (1, 2). The Hessian is
(x − 2)(y 2 − 4y)
−x (1 − x)(2y − 4)
Hf (x, y) = e
(1 − x)(2y − 4) 2x
At the critical points we obtain that
0 −4
Hf (0, 0) = (indefinite)
−4 0
0 4
Hf (0, 4) = (indefinite)
4 0
−1
4e 0
Hf (1, 2) = (positive definite)
0 2e−1
so (0, 0), (0, 4) are saddle points and (1, 2) is a local minimum.
5-2. Find the critical points of the following functions. For which points the second derivative criterion does not
give any information?
(a) f (x, y) = x3 + y 3 .
1/2
(b) f (x, y) = (x − 1)2 + (y + 2)2 .
(c) f (x, y) = x3 + y 3 − 3x2 + 6y 2 + 3x + 12y + 7.
(d) f (x, y) = x2/3 + y 2/3
Solution:
3
(a) The gradient of f (x, y) = x3 + y 3 is ∇f (x, y) = 3(x2 , y 2 ). The unique critical point is (0, 0). The Hessian
is
6x 0 0 0
Hf (0, 0) = =
0 6y x=0,y=0
0 0
The second derivative criterion does not provide any information. But, noting that f (0, 0) = 0 and that
(
3 > 0 if x > 0,
f (x, 0) = x
< 0 if x < 0.
we see that (0, 0) is a saddle point.
(b) The gradient of f (x, y) = ((x − 1)2 + (y + 2)2 )1/2 is
1
∇f (x, y) = p (x − 1, y + 2)
(x − 1) + (y + 2)2
2
which does not vanish in its domain. Note that f is differentiable, except at the point (1, −2). Therefore,
the unique critical point is (1, −2) and since the function is not differentiable at this point we may not
apply the second derivative criterion.
Noting that f (1, −2) = 0 < ((x − 1)2 + (y + 2)2 )1/2 if (x, y) 6= (1, −2), we see that (1, −2) is a global
minimum.
(c) The gradient of f (x, y) = x3 + y 3 − 3x2 + 6y 2 + 3x + 12y + 7 is
∇f (x, y) = (3x2 − 6x + 3, 3y 2 + 12y + 12)
The critical points are solutions of the system
x2 − 2x + 1 = 0
y 2 + 4y + 4 = 0
whose unique solution is x = 1, y = −2. The unique critical point is (1, −2). The Hessian is
6x − 6 0 0 0
Hf (1, −2) = =
0 6y + 12 x=1,y=−2
0 0
The second derivative criterion does not provide any information. Note that f is a polynomial of degree 3,
∇f (1, −2) = (0, 0 and also Hf (1, −2) = 0. Thus, we see that f (x, y) = (y + 2)3 + (x − 1)3 . And we have
that (
3 > 0 if x > 0,
f (x + 1, −2) = x
< 0 if x < 0.
So, (1, −2) is a saddle point.
(d) The function f (x, y) = x2/3 + y 2/3 is not differentiable at (0, 0). At the points (x, y) 6= (0, 0) we have
that
2 2
∇f (x, y) = √ , √
33x 33y
so the function never vanishes in its domain. The unique critical point is (0, 0). The second derivative
criterion does not provide any information. But, noting that f (0, 0) = 0 and that if (x, y) 6= (0, 0),
f (x, y) = x2/3 + y 2/3 > 0
we see that (0, 0) is a global minimum.
Solution:
(a) The function f (x, y) = (3 − x)(3 − y)(x + y − 3) is differentiable in R2 . The gradient is
∇f (x, y) = (−6x − 9y + 18 + 2xy + y 2 , −9x − 6y + 18 + x2 + 2xy)
and the critical points are solutions of the system of equations
−6x − 9y + 18 + 2xy + y 2 = 0
−9x − 6y + 18 + x2 + 2xy = 0
whose solutions are (3, 0), (3, 3), (0, 3) y (2, 2). The Hessian is
−6 + 2y 2x + 2y − 9
Hf (x, y) =
2x + 2y − 9 −6 + 2x
4
5-4. Find the values of the constants a, b and c so that the function f (x, y) = ax2 y + bxy + 2xy 2 + c has a local
minimum at the point (2/3, 1/3) and the minimum value at that point is −1/9.
2axy + by + 2y 2 = 0
ax2 + bx + 4xy = 0
Therefore, the critical points are
b b b b
(0, 0), (− , 0), (0, − ), (− , − )
a 2 3a 6
The point (2/3, 1/3) is a critical point if
b b
(2/3, 1/3) = (− ,− )
3a 6
This happens if a = 1, b = −2.
Now, we choose c such that the value of the function at the point (2/3, 1/3) is −1/9.
4
f (2/3, 1/3) = x2 y − 2xy + 2xy 2 + c
x=2/3,y=1/3
=− + c = −1/9
27
1
We obtain c = 27 .
2y 2x − 2 + 4y
We check that (2/3, 1/3) is a minimum. The Hessian is Hf (2/3, 1/3) = =
2x − 2 + 4y 4x x=2/3,y=1/3
2 2
3 3 which is positive definite. Therefore (2/3, 1/3) is a minimum.
2 8
3 3
5-5. The income function is R(x, y) = x(100 − 6x) + y(192 − 4y) where x and y are the number of articles sold.
If the cost function is C(x, y) = 2x2 + 2y 2 + 4xy − 8x + 20 determine the maximum profit.
5-6. A milk store produces x units of whole milk and y units of skim milk. The price for whole milk is p(x) = 100−x
and the price for skim milk is q(y) = 100 − y. The cost of production is C(x, y) = x2 + xy + y 2 . How should
the company choose x and y to maximize profits?
5-7. A monopolist produces a good which is bought by two types of consumers. The consumers of type 1 are will-
ing to pay 50 − 5q1 euros in order to purchase q1 units of the good. The consumers of type 2 are willing
to pay 100 − 10q2 euros in order to purchase q2 units of the good. The cost function of the monopolist is
c(q) = 90 + 20q euros. How much should the monopolist produce in each market?
Solution: If the monopolist sells q1 units in the first market and q2 units in the second market, the profit
is
q1 (50 − 5q1 ) + q2 (100 − 10q2 ) − 90 − 20(q1 + q2 ) = 30q1 − 5q12 + 80q2 − 10q22 − 90
The first order conditions are
30 = 10q1
80 = 20q2
so the solution is
q1 = 3, q2 = 4
5-8. Find and classify the extreme points of the following functions under the given restrictions.
(a) f (x, y, z) = x + y + z in x2 + y 2 + z 2 = 2.
(b) f (x, y) = cos(x2 − y 2 ) in x2 + y 2 = 1.
Solution:
(a) The Lagrangian is
L(x, y, z) = f (x, y, z) − λg(x, y, z)
We obtain the Lagrange equations
Dx (L(x, y, z)) =1 − 2λx = 0
Dy (L(x, y, z)) =1 − 2λy = 0
Dz (L(x, y, z)) =1 − 2λz = 0
x2 + y 2 + z 2 = 2
Comparing the first three equations we see that x = y = z. Thus, 3x2 = 2, that is
r
2
x=±
3
(b) The Lagrangian is
L(x, y) = f (x, y) − λg(x, y)
The Lagrange equations may be written as
x(sin(−x2 + y 2 ) − λ) = 0
y(sin(−x2 + y 2 ) + λ) = 0
x2 + y 2 = 1
We see that (0, ±1) y (±1, 0) are solutions. If we now, assume that x 6= 0, y 6= 0, from the first two
equations we obtain that
λ = sin −x2 + y 2
λ = − sin −x2 + y 2
Therefore,
sin −x2 + y 2 = − sin −x2 + y 2
6
from where
1
x2 = y 2 =
2
and hence x = y or x = −y. The solutions are
√ √ √ √ √ √ √ √
2 2 2 2 2 2 2 2
( , )( ,− )(− , )(− ,− )
2 2 2 2 2 2 2 2
√ √ √ √
2 2 2 2
Substituting in the objective function we see that (0, ±1) y (±1, 0) are minima and ( 2 , 2 ), ( 2 , − 2 ),
√ √ √ √
(− 22 , 22 ), (− 22 , − 22 ), are maxima.
5-10. A company makes two products, P1 and P2 . If the company sells x1 units of P1 and x2 units of P2 it receives
a net profit of R = −5x21 − 8x22 − 2x1 x2 + 42x1 + 102x2 . Find x1 and x2 that maximize net profit.
5-12. The production function for a firm is 4x + xy + 2y, where x is labor and y is capital. The total budget that
the company can spend is 2000$. Each unit of labor costs 20$, whereas each unit of capital costs 4$. Find the
optimal level of production for the firm.
5-13. An editor has been assigned a budget of 60.000 to be spent on advertising and production of a new book.
She estimates that spending x thousand euro in production and y thousand euro in advertising she can sell
f (x, y) = 20x3/2 y books. If she wants to maximize sales, how much should she allocate to advertising and how
much should she allocate to production?
The feasible set is compact and the objective function is continuous. Hence, there is a solution. The corner
points (0, 60000) and (60000, 0) yield a value of 0 in the objective function. These points correspond to a
minimum and we may assume the solution is interior
max. 20x3/2 y
s.t. x + y = 60000
7
The Lagrangian is
L(x, y) = 20x3/2 y + λ(60000 − x − y)
We obtain the Lagrange equations
30x1/2 y − λ =0
20x3/2 − λ =0
x + y =60000
From the two first equations we obtain that
30x1/2 y = 20x3/2
If we assume that x 6= 0, we obtain that y = 2x/3, so the solution is x = 36000, y = 24000. This point
satisfies the constraints of the problem.
The Hessian matrix of L is
15x √ y √
√ 30 x √ 2 x
H L(x, y) = √x = 15 √x
30 x 0 2 x 0
At the point (36000, 24000) we have that
40 120 1 3
H L(36000, 24000) = 15 = 600
120 0 3 0
The restriction of the problem is g(x, y) = x + y − 60000 and ∇g(36000, 24000) = (1, 1). Then,
T(36000,24000) M = {(v1 , v2 ) ∈ R2 : (v1 , v2 ) · (1, 1) = 0}
= {(v1 , v2 ) ∈ R2 : v1 + v2 = 0}
= {(t, −t) : t ∈ R}
The quadratic form
t 1 3 t
(t, −t) · H L(36000, 24000) = 600 (t, −t) · = −3000t2
−t 3 0 −t
is negative definite. Hence, the point (36000, 24000) is a local maximum. And by Weierstrass Theorem is also
a global maximum.
5-14. A store sells two products which are close substitutes. The manager has found that if he sells the products at
the prices P1 and P2 , the net profit is R = 500P1 + 800P2 + 1, 5P1 P2 − 1, 5P12 − P22 . Find the optimal prices
for the manager.
5-15. The utility function of a consumer is u(x, y) = 31 ln x + 32 ln y, where x and y are the consumption goods, with
prices, respectively, p1 and p2 . The rent of the agent is M . Find the demand of the agent for each good.
Solution: The consumer demands the amounts of goods x and y which are solutions to the following
problem,
1 2
max. 3 ln x + 3 ln y
s.t. p1 x + p2 y = M
The Lagrangian is
1 2
L(x, y) = ln x + ln y + λ(M − p1 x − p2 y)
3 3
8
5-16. Find and classify the extreme points of the function f on the given set.
(a) f (x, y, z) = x2 + y 2 + z 2 on the set {(x, y, z) ∈ R3 : x + 2y + z = 1, 2x − 3y − z = 4}.
(b) f (x, y, z) = (y + z − 3)2 on the set {(x, y, z) ∈ R3 : x2 + y + z = 2, x + y 2 + 2z = 2}.
(c) f (x, y, z) = x + y + z on the set {(x, y, z) ∈ R3 : x2 + y 2 + z 2 = 1, x − y − z = 1}.
(d) f (x, y, z) = x2 + y 2 + z 2 on the set {(x, y, z) ∈ R3 : x2 + y 2 = z, x + y + z = 4}.
Solution:
(a) The Lagrangian is
L(x, y, z) = f (x, y, z) − λg(x, y, z) − µh(x, y, z)
The Lagrange equations are
Dx (L(x, y, z)) =2x − λ − 2µ = 0
Dy (L(x, y, z)) =2y − 2λ + 3µ = 0
Dz (L(x, y, z)) =2z − λ + µ = 0
x + 2y + z = 1
2x − 3y − z = 4
whose solution is
92 19 5 58 68
x= ,y = − ,z = ,µ = ,λ =
59 59 59 59 59
(b) The Lagrangian is
L(x, y, z) = f (x, y, z) − λg(x, y, z) − µh(x, y, z)
The Lagrange equations are
−2λx − µ = 0
2y + 2z − 6 − λ − 2µy = 0
2y + 2z − 6 − λ − 2µ = 0
x2 + y + z = 2
x + y 2 + 2z = 2
From the second and third equations we obtain that
µ = µy
and there are two possibilities: either µ = 0 or y = 1.
If µ = 0, the first equation implies that λx = 0. One of factors must be 0. If λ = 0, we obtain the
equations,
2y + 2z − 6 = 0
x2 + y + z = 2
x + y 2 + 2z = 2
9
But, the first equation implies y + z = 3 and substituting in the second one one we obtain x2 = −1,
which is impossible. If x = 0, the last two equations are
y+z =2
y 2 + 2z = 2
But, now we obtain equation y 2 − 2y + 2 = 0 which does not have real solutions.
We conclude that µ 6= 0, so y = 1. We may now use the last two equations to obtain x and z. The
solutions to the Lagrange equations are
−1 3
( , 1, ), (1, 1, 0)
2 4
To see the character of these points, we apply the sufficient condition and calculate the second order
derivatives of L with respect to the variables x, y, z, obtaining the Hessian
−2λ 0 0
HLx,y,z = 0 2 − 2µ 2
0 2 2
We need the values of the multipliers associated to each point. Plugging the point P1 into the Lagrange
system above, we get λ = µ = − 56 . The above Hessian becomes
5
3 0 0
HLx,y,z = 0 11 3 2
0 2 2
which is positive definite, thus it is also positive definite when restricted to any subspace, in particular
to the tangent subspace associated to P1 . Hence P1 is a local minimum.
We do the same for the other point, P2 . The multipliers are in this case λ = 34 and µ = − 83 . The Hessian
is
8
−3 0 0
22
(1) HLx,y,z = 0 3 2
0 2 2
which is indefinite. We thus proceed to check the sign of the quadratic form in the tangent subspace to
the constraints at the point P2 . We compute the gradients of the constraints at the point P2 . They are
the vectors (2x, 1, 1) and (1, 2y, 2). At the point P2 they become (2, 1, 1) and (1, 2, 2), respectively. The
tangent space is the solution set of the system
2x + y + z = 0
x + 2y + 2z = 0.
We find {(0, −z, z) : z ∈ R} as tangent space. Restricting the quadratic form (1) to this space, we get
the restricted quadratic form 22 2 2 2 16 2
3 z + 2z − 4z = 3 z , which is positive definite. Thus, P2 is a local
minimum too.
Remark: The above represents as far as the methods that we have studied in class will take us. If we
want to determine if any of the above points corresponds to a global minimum, further analysis, beyond
the scope of this course, is needed. We address this issue in this remark for those of you who are interested
in the answer.
From the first restrictions we obtain z = 2 − x2 − y. Replacing this value of z in the second restriction
we get the equation
2 = x + y 2 + 2z = x + y 2 + 4 − 2x2 − 2y
so y satisfies the equation
y 2 − 2y + x − 2x2 + 2 = 0
Solving for y,
p
y =1± 2x2 − x − 1
Thus, to obtain a solution of the two restrictions we need that 2x2 − x − 1 ≥ 0. Plotting the graph of
the parabola y = 2x2 − x − 1 we see that 2x2 − x − 1 ≥ 0 for x ≤ −1/2 and x ≥ 1. That is, if we let
I = (−∞ − 12 ] ∪ [1, ∞), we may parametrize the set {(x, y, z) ∈ R3 : x2 + y + z = 2, x + y 2 + 2z = 2} as
p
{(x, y, z) ∈ R3 : x ∈ I, y = 1 ± 2x2 − x − 1, z = 2 − x2 − y, }
10
Now, replacing y +z = 2−x2 in the objective function we obtain f (x, y, z) = (y +z −3)2 = (1+x2 )2 . Note
that function of one variable h(x) = (1 + x2 )2 , defined in the domain I, is strictly convex, decreasing for
x ≤ 0 and increasing for x ≥ 0. Thus, there are two local minima at the points −1/2 and 1. Furthermore,
1 1
h − = , h(1) = 4
2 4
Thus, the global minimum is attained at the point x = − 21 , y = 1, z = 34 .
(c) The Lagrangian is L(x, y, z) = f (x, y, z) − λg(x, y, z) − µh(x, y, z) The Lagrange equations are
1 − 2λx − µ = 0
1 − 2λy + µ = 0
1 − 2λz + µ = 0
x2 + y 2 + z 2 = 1
x−y−z =1
From the second and third equations a we obtain that λy = λz.
If λ = 0, the first two equations are inconsistent. Therefore, λ 6= 0 and y = z. Now, we may use the last
two equations to solve for y and z. We obtain the solutions
(1, 0, 0) maximum
1
− (1, 2, 2) minimum
3
5-17. Find the maximum of the function f (x, y, z) = xyz on the set {(x, y, z) ∈ R3 : x + y + z ≤ 1, x, y, z ≥ 0}.
The equations 12 yield an infinite number of solutions in which at least two of the variables x, y, z vanish.
The value of the objective function at these solutions is 0.
Case 2 λ1 > 0. Then, x + y + z = 1. If, for example x = 0, we obtain from equations 3 y 4 that
λ3 = λ4 = λ1 > 0
and from the equations 7 y 8 we see that y = z = 0. But this contradicts that x + y + z = 1. We conclude
that x > 0. Analogously, one can show that y, z > 0. By equations 6, 7 y 8 we see that
λ2 = λ3 = λ4 = 0
and equations 2, 3 y 4 imply that
yz = xz = xy
that is
x=y=z
And since x + y + z = 1, we conclude that
1 1
x=y=z= ; λ1 =
3 9
The value of the objective function is
1 1 1 1
f , , =
3 3 3 27
So the point
1
x=y=z=
3
corresponds to the maximum.
5-18. Find the minimum of the function f (x, y) = 2y − x2 on the set {(x, y) ∈ R2 : x2 + y 2 ≤ 1, x, y ≥ 0}.
s.t. x2 + y 2 ≤ 1
−x ≤ 0
−y ≤ 0
The Lagrangian is
L = x2 − 2y + λ1 (1 − x2 − y 2 ) + λ2 x + λ3 y
and the Kuhn–Tucker equations are
∂L
(13) = 2x − 2λ1 x + λ2 = 0 ⇔ 2λ1 x = 2x + λ2
∂x
∂L
(14) = −2 − 2λ1 y + λ3 = 0 ⇔ λ3 = 2 + 2λ1 y
∂y
(15) λ1 (1 − x2 − y 2 ) = 0
(16) λ2 x = 0
(17) λ3 y = 0
(18) λ1 , λ2 , λ3 ≥ 0
2 2
(19) x +y ≤ 1
(20) x, y ≥ 0
Since all the variables that appear in equation 14 are positive, we have that
λ3 ≥ 2 > 0
so
y=0
and from equation 14 we see that
λ3 = 2
Case 1: x = 0. By equation 15 we see that λ1 = 0 y by equation 13 we see that λ2 = 0. That is, of
solution of the Kuhn–Tucker equations is
x∗ y ∗ = 0; λ1 = λ2 = 0, λ3 = 2
12
s.t. x2 + y 2 − z ≤ 0
−x ≤ 0
−y ≤ 0
−z ≤ 0
The Lagrangian is
L = x + y − 2z + λ1 (z − x2 − y 2 ) + λ2 x + λ3 y + λ4 z
and the Kuhn–Tucker equations are
∂L
(30) = 1 − 2λ1 x + λ2 = 0 ⇔ 2λ1 x = 1 + λ2
∂x
∂L
(31) = 1 − 2λ1 y + λ3 = 0 ⇔ 2λ1 y = 1 + λ3
∂y
∂L
(32) = −2 + λ1 + λ4 = 0 ⇔ λ1 + λ4 = 2
∂z
(33) λ1 (x2 + y 2 − z) = 0
(34) λ2 x = 0
(35) λ3 y = 0
(36) λ4 z = 0
(37) λ1 , λ2 , λ3 , λ4 ≥ 0
(38) x, y, z ≥ 0
From equation 30, we see that if λ1 = 0 o x = 0, then 1 + λ2 = 0 so λ2 < 0. Therefore, we must have that
λ1 > 0 y x > 0. Similarly, from equation 31 we obtain that y > 0. From equations 34 and 35 we see now that
λ2 = λ3 = 0. The Kuhn–Tucker equations may now be written as follows
(39) 2λ1 x = 1
(40) 2λ1 y = 1
(41) λ1 + λ4 = 2
2 2
(42) x +y = z
(43) λ4 z = 0
(44) λ1 , λ4 ≥ 0
(45) x, y, z ≥ 0
Since λ1 > 0, from equations 39 and 40 we obtain that
1
x=y=
2λ1
so
z = 2x2 > 0
And we deduce from equation 43 that λ4 = 0 and from equation 41 that λ1 = 2. Therefore, the solution is
1 1
x=y= , z= ; λ1 = 2, λ2 = λ3 = λ4 = 0
4 8