You are on page 1of 16

MATH2023 Multivariable Calculus Chapter 4 Applications of partial derivatives

L2/L3 (Fall 2019)

Chapter 4 Applications of partial derivatives

1. Maxima and minima

The notions of absolute extrema and local extrema carry over in a way that is similar to functions of
one real variable.

Definition 4.1 Let 𝑓 be a function of 𝑛 real variables and (𝑎1 , 𝑎2 , … , 𝑎𝑛 ) be a point in the
domain of 𝑓. We say that 𝑓 attains absolute maximum (or global maximum) at (𝑎1 , 𝑎2 , … , 𝑎𝑛 )
if
𝑓(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) ≤ 𝑓(𝑎1 , 𝑎2 , … , 𝑎𝑛 )
for every (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) in the domain of 𝑓, and we say that 𝑓 attains absolute minimum (or
global minimum) at (𝑎1 , 𝑎2 , … , 𝑎𝑛 ) if
𝑓(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) ≥ 𝑓(𝑎1 , 𝑎2 , … , 𝑎𝑛 )
for every (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) in the domain of 𝑓. The point (𝑎1 , 𝑎2 , … , 𝑎𝑛 , 𝑓(𝑎1 , 𝑎2 , … , 𝑎𝑛 )) on the
graph of 𝑓 is called an absolute maximum point or an absolute minimum point. Absolute
maximum and absolute minimum are collectively called absolute extremum.

Definition 4.2 Let 𝑓 be a function of 𝑛 real variables and (𝑎1 , 𝑎2 , … , 𝑎𝑛 ) be a point in the
domain of 𝑓. We say that 𝑓 attains relative maximum (or local maximum) at (𝑎1 , 𝑎2 , … , 𝑎𝑛 ) if
𝑓(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) ≤ 𝑓(𝑎1 , 𝑎2 , … , 𝑎𝑛 )
for every (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) in the domain of 𝑓 that are near (𝑎1 , 𝑎2 , … , 𝑎𝑛 ), and we say that 𝑓
attains relative minimum (or local minimum) at (𝑎1 , 𝑎2 , … , 𝑎𝑛 ) if
𝑓(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) ≥ 𝑓(𝑎1 , 𝑎2 , … , 𝑎𝑛 )
for every (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) in the domain of 𝑓 that are near (𝑎1 , 𝑎2 , … , 𝑎𝑛 ). The corresponding
point (𝑎1 , 𝑎2 , … , 𝑎𝑛 , 𝑓(𝑎1 , 𝑎2 , … , 𝑎𝑛 )) on the graph of 𝑓 is called a local maximum point or a
local minimum point. Local maximum and local minimum are collectively called local extremum.

A critical number of a function 𝑓 of one real variable is a number 𝑐 such that either 𝑓 ′ (𝑐) = 0
or 𝑓 ′ (𝑐) does not exist. For functions of several variables, we have the following corresponding
notion.

Definition 4.3 Let 𝑓 be a function of 𝑛 real variables and (𝑎1 , 𝑎2 , … , 𝑎𝑛 ) be an interior point of
the domain of 𝑓. If either
∇𝑓(𝑎1 , 𝑎2 , … , 𝑎𝑛 ) = 𝟎
or ∇𝑓(𝑎1 , 𝑎2 , … , 𝑎𝑛 ) does not exist, i.e. either 𝑓𝑥𝑘 (𝑎1 , 𝑎2 , … , 𝑎𝑛 ) = 0 for all 𝑘 or
𝑓𝑥𝑘 (𝑎1 , 𝑎2 , … , 𝑎𝑛 ) does not exist for some 𝑘, then (𝑎1 , 𝑎2 , … , 𝑎𝑛 ) is called a critical point of 𝑓.

Page 1 of 16
MATH2023 Multivariable Calculus Chapter 4 Applications of partial derivatives
L2/L3 (Fall 2019)

Theorem 4.4 Let 𝑓 be a function of 𝑛 real variables and (𝑎1 , 𝑎2 , … , 𝑎𝑛 ) be an interior point of
the domain of 𝑓 . If 𝑓 attains local maximum or local minimum at (𝑎1 , 𝑎2 , … , 𝑎𝑛 ) , then
(𝑎1 , 𝑎2 , … , 𝑎𝑛 ) is a critical point of 𝑓.

Proof. This follows directly from the corresponding result for functions of one real variable. ∎

Remark 4.5 Theorem 4.4 says that to look for local maxima and minima of a function defined on
an open set, the only possible candidates are its critical points. However, the converse of this
theorem is false, which means that at some critical points the function may have neither a local
maximum nor a local minimum. A critical point of a differentiable function of several variables
might turn out to be a saddle point, just as we have seen in MATH1013/1023 that a critical point of
a differentiable function of one variable might turn out to be a point of inflection.

Definition 4.6 A critical point (𝑎1 , 𝑎2 , … , 𝑎𝑛 ) of a function 𝑓 of 𝑛 real variables is a saddle


point if near (𝑎1 , 𝑎2 , … , 𝑎𝑛 ) there are both points (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) in the domain of 𝑓 such that
𝑓(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) > 𝑓(𝑎1 , 𝑎2 , … , 𝑎𝑛 )
as well as points (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) in the domain of 𝑓 such that
𝑓(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) < 𝑓(𝑎1 , 𝑎2 , … , 𝑎𝑛 ).

Example 4.7 The function 𝑓(𝑥, 𝑦) = 𝑥 2 + 𝑦 2 has a local minimum and an absolute minimum at
its only critical point (0, 0). The function 𝑔(𝑥, 𝑦) = 𝑦 2 − 𝑥 2 has a saddle point at its only critical
point (0, 0).
𝑧 𝑧 𝑧 = 𝑔(𝑥, 𝑦)
𝑧 = 𝑓(𝑥, 𝑦)

𝑦
𝑥
𝑥
𝑦 𝑦
Level curves of 𝑓 Level curves of 𝑔
2
32 1
1 0 0
𝑥 𝑥
−1 −1 −2
−2
1
2

Suppose for simplicity that 𝑓 is a function of two real variables. To classify the critical points of
𝑓 into local maximum, local minimum or saddle point, we have three strategies:
 Use the shape of the graph of 𝑓 (Example 4.7 above)
 Use the shape of the level curves of 𝑓 (Remark 4.8)
 Second derivative test (Theorem 4.9)

Page 2 of 16
MATH2023 Multivariable Calculus Chapter 4 Applications of partial derivatives
L2/L3 (Fall 2019)

Remark 4.8 Let 𝑓 be a continuous function of two variables and (𝑎, 𝑏) be a critical point of 𝑓.
 If the level curves of 𝑓 near (𝑎, 𝑏) go around (𝑎, 𝑏), and the heights of the level curves
decrease as one moves away from (𝑎, 𝑏), then 𝑓 attains local maximum at (𝑎, 𝑏).
 If the level curves of 𝑓 near (𝑎, 𝑏) go around (𝑎, 𝑏), and the heights of the level curves
increase as one moves away from (𝑎, 𝑏), then 𝑓 attains local minimum at (𝑎, 𝑏).
 If a level curve of 𝑓 intersect itself at (𝑎, 𝑏), then 𝑓 has a saddle point at (𝑎, 𝑏).

Theorem 4.9 (Second derivative test with two real variables) Let 𝑓 be a function of two real
variables and (𝑎, 𝑏) be a critical point of 𝑓 of the type 𝑓𝑥 (𝑎, 𝑏) = 𝑓𝑦 (𝑎, 𝑏) = 0, and suppose that
the second partial derivatives of 𝑓 are continuous near (𝑎, 𝑏). Define
2
𝐷 ≔ 𝑓𝑥𝑥 𝑓𝑦𝑦 − (𝑓𝑥𝑦 ) .

 If 𝐷(𝑎, 𝑏) > 0 and 𝑓𝑥𝑥 (𝑎, 𝑏) < 0, then 𝑓 attains local maximum at (𝑎, 𝑏).
 If 𝐷(𝑎, 𝑏) > 0 and 𝑓𝑥𝑥 (𝑎, 𝑏) > 0, then 𝑓 attains local minimum at (𝑎, 𝑏).
 If 𝐷(𝑎, 𝑏) < 0, then 𝑓 has a saddle point at (𝑎, 𝑏).
 If 𝐷(𝑎, 𝑏) = 0, then this test is inconclusive.

Remark 4.10 The function 𝐷 in the above theorem can also be expressed as the determinant
𝑓𝑥𝑥 𝑓𝑥𝑦
𝐷=| |.
𝑓𝑥𝑦 𝑓𝑦𝑦
It is called (the determinant of) the Hessian of 𝒇.

Proof of Theorem 4.9. We let 𝐯̂ = 〈𝑣1 , 𝑣2 〉 be an arbitrary unit vector in ℝ2 and suppose that
𝐷(𝑎, 𝑏) > 0 and 𝑓𝑥𝑥 (𝑎, 𝑏) > 0. Our aim is to show that 𝐷𝐯̂2 𝑓(𝑎, 𝑏) > 0, so that by the second
derivative test for one-variable functions we can conclude that the cross-sectional curve of 𝑓 in
any direction attains local minimum at (𝑎, 𝑏), and so 𝑓 attains local minimum at (𝑎, 𝑏). Now by
the computation formula for the directional derivative (Theorem 3.65) and the mixed derivative
theorem (Theorem 3.45) we have 𝐷𝐯̂ 𝑓(𝑥, 𝑦) = 𝑣1 𝑓𝑥 (𝑥, 𝑦) + 𝑣2 𝑓𝑦 (𝑥, 𝑦) and
𝜕𝐷𝐯̂ 𝑓 𝜕𝐷𝐯̂ 𝑓
𝐷𝐯̂2 𝑓(𝑥, 𝑦) = 𝐷𝐯̂ (𝐷𝐯̂ 𝑓)(𝑥, 𝑦) = 𝑣1 [ (𝑥, 𝑦)] + 𝑣2 [ (𝑥, 𝑦)]
𝜕𝑥 𝜕𝑦
= 𝑣1 [𝑣1 𝑓𝑥𝑥 (𝑥, 𝑦) + 𝑣2 𝑓𝑦𝑥 (𝑥, 𝑦)] + 𝑣2 [𝑣1 𝑓𝑥𝑦 (𝑥, 𝑦) + 𝑣2 𝑓𝑦𝑦 (𝑥, 𝑦)]
= 𝑣1 2 𝑓𝑥𝑥 (𝑥, 𝑦) + 2𝑣1 𝑣2 𝑓𝑥𝑦 (𝑥, 𝑦) + 𝑣2 2 𝑓𝑦𝑦 (𝑥, 𝑦),
so at (𝑎, 𝑏) we have
𝐷𝐯̂2 𝑓(𝑎, 𝑏) = 𝑣1 2 𝑓𝑥𝑥 (𝑎, 𝑏) + 2𝑣1 𝑣2 𝑓𝑥𝑦 (𝑎, 𝑏) + 𝑣2 2 𝑓𝑦𝑦 (𝑎, 𝑏)
2
𝑓𝑥𝑦 (𝑎, 𝑏) 𝐷(𝑎, 𝑏) 2
𝑓𝑥𝑥 (𝑎, 𝑏) (𝑣1 +
=⏟ 𝑣2 ) + 𝑣⏟ > 0
⏟ 𝑓𝑥𝑥 (𝑎, 𝑏) 𝑓
⏟𝑥𝑥 (𝑎, 𝑏) 2
>0 ≥0
≥0 >0

as the last two terms cannot vanish simultaneously. The proofs for the other cases are similar. ∎

Page 3 of 16
MATH2023 Multivariable Calculus Chapter 4 Applications of partial derivatives
L2/L3 (Fall 2019)

Example 4.11 Let 𝑓: ℝ2 → ℝ be the function defined by


𝑓(𝑥, 𝑦) = 𝑥 3 + 𝑦 3 − 9𝑥𝑦 + 1.
Find all the critical points of 𝑓, and for each critical point determine whether it is a local maximum,
a local minimum or a saddle point.

Solution:
Since
∇𝑓(𝑥, 𝑦) = 〈𝑓𝑥 (𝑥, 𝑦), 𝑓𝑦 (𝑥, 𝑦)〉 = 〈3𝑥 2 − 9𝑦, 3𝑦 2 − 9𝑥〉,
we have ∇𝑓(𝑥, 𝑦) = 𝟎 only when both 3𝑥 2 − 9𝑦 = 0 and 3𝑦 2 − 9𝑥 = 0.
𝑥2
The first equation gives 𝑦 = , and substituting this into the second equation we get
3

𝑥 4 − 27𝑥 = 0,
i.e. 𝑥(𝑥 − 3)(𝑥 2 + 3𝑥 + 9) = 0. The only real solutions are 𝑥 = 0 or 𝑥 = 3, and so the only
critical points of 𝑓 are (0, 0) and (3, 3).

Now the second partial derivatives of 𝑓 are


𝑓𝑥𝑥 (𝑥, 𝑦) = 6𝑥, 𝑓𝑥𝑦 (𝑥, 𝑦) = −9 and 𝑓𝑦𝑦 (𝑥, 𝑦) = 6𝑦.
 At the critical point (0, 0) we have
𝑓𝑥𝑥 𝑓𝑥𝑦
𝐷(0, 0) = | | (0, 0) = (0)(0) − (−9)2 = −81 < 0,
𝑓𝑥𝑦 𝑓𝑦𝑦
so 𝑓 has a saddle point at (0, 0) by the second derivative test.
 At the critical point (3, 3) we have 𝑓𝑥𝑥 (3, 3) = 18 > 0 and
𝑓𝑥𝑥 𝑓𝑥𝑦
𝐷(3, 3) = | | (3, 3) = (18)(18) − (−9)2 = 243 > 0,
𝑓𝑥𝑦 𝑓𝑦𝑦
so 𝑓 attains local minimum at (3, 3) by the second derivative test.

Remark 4.12 Note that the following two useful results in MATH1013/1023 are true for functions
of one real variable only, and have no analogue for functions of several real variables.

Theorem (Only critical number) Let 𝑓: (𝑎, 𝑏) → ℝ be a differentiable function which has its only
critical number at 𝑐 ∈ (𝑎, 𝑏). If 𝑓 attains local maximum (resp. minimum) at 𝑐, then 𝑓 also
attains absolute maximum (resp. minimum) at 𝑐.

𝑧 = 𝑓(𝑥, 𝑦)
A two-variable counter-example: The differentiable function 2

𝑓(𝑥, 𝑦) = 3𝑥𝑒 𝑦 − 𝑥 3 − 𝑒 3𝑦 1

has its only critical point at (1, 0), which is a local maximum. 0 𝑧
−1
But 𝑓 has no absolute maximum because lim 𝑓(𝑥, 0) = +∞.
𝑥→−∞
−2 −1
−1 0
𝑦 0 1 𝑥
Page 4 of 16
MATH2023 Multivariable Calculus Chapter 4 Applications of partial derivatives
L2/L3 (Fall 2019)

Theorem (Between two local max., always a local min.) Let 𝐼 be an interval and 𝑓: 𝐼 → ℝ be a
continuous function which attains local maxima (resp. minima) at two distinct numbers 𝑎, 𝑏 ∈ 𝐼.
Then 𝑓 attains local minimum (resp. maximum) at some 𝑐 between 𝑎 and 𝑏.
0
𝑥 1
A two-variable counter-example: The differentiable function 𝑧 = 𝑓(𝑥, 𝑦)

𝑓(𝑥, 𝑦) = 4𝑥 2 𝑒 𝑦 − 2𝑥 4 − 𝑒 4𝑦 0
has exactly two critical points at (1, 0) and at (−1, 0), which −1
𝑧
are both local maxima. 𝑓 does not have any other critical −2
points.
0
−1 𝑦

The Extreme Value Theorem (Theorem 3.31) states that if 𝑓 is a continuous function of several
real variables defined on a closed and bounded set, then 𝑓 must attain absolute maximum and
absolute minimum somewhere. In this case, we can locate the absolute extrema of 𝑓 by merely
comparing the values of 𝑓 at all its critical points and at the boundary points of the domain of 𝑓.

Example 4.13 Find the absolute maximum and minimum values of the function
𝑓(𝑥, 𝑦) = 𝑥 + 𝑦 − 𝑥𝑦
on the closed triangular region with vertices 𝑂(0, 0), 𝐴(0, 2) and 𝐵(4, 0).

Solution:
Since 𝑓 is continuous on the closed triangular region 𝑂𝐴𝐵 which is a closed and bounded set, it
must attain absolute maximum and minimum somewhere. These extremum values must occur at
critical points and boundary points, so we simply compare them as follows:
 (Interior) Critical points: We have
∇𝑓(𝑥, 𝑦) = 〈𝑓𝑥 (𝑥, 𝑦), 𝑓𝑦 (𝑥, 𝑦)〉 = 〈1 − 𝑦, 1 − 𝑥〉,
so ∇𝑓(𝑥, 𝑦) = 𝟎 only when 𝑦 = 1 and 𝑥 = 1, so the only critical point of 𝑓 is (1, 1). The
value of 𝑓 at this critical point is
𝑓(1, 1) = 1.
 Boundary points: The boundary of the region consists of line 𝑦
segments 𝑂𝐴, 𝑂𝐵 and 𝐴𝐵.
𝑥=0 𝐴
(i) The line segment 𝑂𝐴 can be parametrized by {
𝑦=𝑡
where 𝑡 ∈ [0, 2] , so along 𝑂𝐴 the value of 𝑓 is 𝑂 𝐵
𝑥
𝑓(𝑥, 𝑦) = 𝑓(0, 𝑡), and if we let
ℎ(𝑡) = 𝑓(0, 𝑡) = 0 + 𝑡 − 0𝑡 = 𝑡
for 𝑡 ∈ [0, 2], then the minimum of ℎ occurs at 𝑡 = 0 and the maximum of ℎ occurs
at 𝑡 = 2. The values of 𝑓 at the points corresponding to these values of 𝑡 are
𝑓(0, 0) = 0 and 𝑓(0, 2) = 2.

Page 5 of 16
MATH2023 Multivariable Calculus Chapter 4 Applications of partial derivatives
L2/L3 (Fall 2019)

𝑥=𝑡
(ii) The line segment 𝑂𝐵 can be parametrized by {𝑦 = 0 where 𝑡 ∈ [0, 4], so along 𝑂𝐵

the value of 𝑓 is 𝑓(𝑥, 𝑦) = 𝑓(𝑡, 0), and if we let


ℎ(𝑡) = 𝑓(𝑡, 0) = 𝑡 + 0 − 0𝑡 = 𝑡
for 𝑡 ∈ [0, 4], then the minimum of ℎ occurs at 𝑡 = 0 and the maximum of ℎ occurs
at 𝑡 = 4. The values of 𝑓 at the points corresponding to these values of 𝑡 are
𝑓(0, 0) = 0 and 𝑓(4, 0) = 4.
𝑥 = 0(1 − 𝑡) + 4𝑡
(iii) The line segment 𝐴𝐵 can be parametrized by { where 𝑡 ∈ [0, 1], so
𝑦 = 2(1 − 𝑡) + 0𝑡
along 𝐴𝐵 the value of 𝑓 is 𝑓(𝑥, 𝑦) = 𝑓(4𝑡, 2 − 2𝑡), and if we let
ℎ(𝑡) = 𝑓(4𝑡, 2 − 2𝑡) = (4𝑡) + (2 − 2𝑡) − (4𝑡)(2 − 2𝑡)
3 2 7
= 2 − 6𝑡 + 8𝑡 2 = 8 (𝑡 − ) +
8 8
3
for 𝑡 ∈ [0, 1], then the minimum of ℎ occurs at 𝑡 = 8 and

the maximum of ℎ occurs at 𝑡 = 1. The values of 𝑓 at the 𝑧


4
points corresponding to these values of 𝑡 are
3 5 7
𝑓( , ) = and 𝑓(4, 0) = 4.
2 4 8
Among all these values, we find that the absolute maximum value of 𝑓 0
2 𝑦
is 4, which occurs at (4, 0); and the absolute minimum value of 𝑓 is 0, 3 5
4 ( , )
2 4
which occurs at (0, 0). 𝑥

Example 4.14 Find the absolute maximum and minimum values of the function
𝑓(𝑥, 𝑦) = 𝑥 2 + 3𝑦 2 + 2𝑦
on the closed unit disk 𝑥 2 + 𝑦 2 ≤ 1.

Solution:
𝑓 is continuous on the closed unit disk 𝑥 2 + 𝑦 2 ≤ 1 which is a closed and bounded set, so we
again look for extremum values by comparing the values of 𝑓 at critical points and boundary
points as follows:

 Critical points: Since


∇𝑓(𝑥, 𝑦) = 〈𝑓𝑥 (𝑥, 𝑦), 𝑓𝑦 (𝑥, 𝑦)〉 = 〈2𝑥, 6𝑦 + 2〉,
1 1
∇𝑓(𝑥, 𝑦) = 𝟎 only when 𝑥 = 0 and 𝑦 = − 3, so the only critical point of 𝑓 is (0, − 3).

The value of 𝑓 at this critical point is


1 1
𝑓 (0, − ) = − .
3 3
Page 6 of 16
MATH2023 Multivariable Calculus Chapter 4 Applications of partial derivatives
L2/L3 (Fall 2019)

 Boundary points: The boundary has equation 𝑥 2 + 𝑦 2 = 1, which is a circle that can be
𝑥 = cos 𝑡
parametrized by { 𝑦 = sin 𝑡 where 𝑡 ∈ [−𝜋, 𝜋] . Along this boundary circle we have

𝑓(𝑥, 𝑦) = 𝑓(cos 𝑡 , sin 𝑡), and if we let


ℎ(𝑡) = 𝑓(cos 𝑡 , sin 𝑡)
= cos 2 𝑡 + 3 sin2 𝑡 + 2 sin 𝑡
= 1 + 2 sin2 𝑡 + 2 sin 𝑡
for 𝑡 ∈ [−𝜋, 𝜋], then
ℎ′ (𝑡) = 4 sin 𝑡 cos 𝑡 + 2 cos 𝑡 = 2 cos 𝑡 (2 sin 𝑡 + 1),
𝜋 𝜋 𝜋 5𝜋
and ℎ′ (𝑡) = 0 only when 𝑡 = or 𝑡 = − 2 or 𝑡 = − 6 or 𝑡 = − . The values of 𝑓 at
2 6

the points corresponding to these four values of 𝑡 are


√3 1 1 √3 1 1
𝑓(0, 1) = 5, 𝑓(0, −1) = 1, 𝑓( ,− ) = and 𝑓 (− ,− ) = .
2 2 2 2 2 2

Among all these values, we find that the absolute maximum value of 𝑓 is 5, which occurs at (0, 1);
1 1
and the absolute minimum value of 𝑓 is − 3, which occurs at (0, − 3).

Remark 4.15 The following is a summary on the procedure of finding the absolute extrema of a
continuous function 𝑓 of two real variables on a closed and bounded set.
(i) First we find the (interior) critical points of 𝒇:
We compute 𝑓𝑥 and 𝑓𝑦 . The critical points of 𝑓 are interior points (𝑎, 𝑏) of the domain at
which 𝑓𝑥 (𝑎, 𝑏) = 𝑓𝑦 (𝑎, 𝑏) = 0. Evaluate 𝑓 at each of these critical points.
(ii) Next we look for possible local extrema of 𝒇 on the boundary:
We parametrize the boundary curve of the domain as (𝑥(𝑡), 𝑦(𝑡)). Instead of considering 𝑓,
we simply find the critical numbers of the one-variable function ℎ(𝑡) = 𝑓(𝑥(𝑡), 𝑦(𝑡)), i.e. all
those 𝑡 where ℎ′ (𝑡) = 0. Also evaluate 𝑓 at each of these possible extremum points
(𝑥(𝑡), 𝑦(𝑡)) on the boundary.
(iii) Finally search for the largest and smallest values of 𝒇 among those finitely many values you
have listed in steps (i) and (ii).

Given a continuous function 𝑓 of 𝒏 > 𝟐 variables on a closed and bounded set in ℝ𝑛 , one can
still carry out a similar procedure to find the absolute extrema of 𝑓. However, the parametrization
in step (ii) may turn out to be very difficult because the boundary of the domain may no longer be
just a curve. To solve this problem in general, we introduce in the next section an alternative
method to find the possible local extrema of 𝒇 “on a boundary”, i.e. when the domain of 𝒇 is
restricted to a set described by some equality constraint(s).

Page 7 of 16
MATH2023 Multivariable Calculus Chapter 4 Applications of partial derivatives
L2/L3 (Fall 2019)

2. Lagrange’s multipliers

Let 𝑓 be a function of 𝑛 real variables having continuous partial derivatives. In this section, we
will study a method of finding possible local extrema of 𝑓 “subject to an equality constraint
𝑔(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 0.” 𝑧
𝑧 = 𝑓(𝑥, 𝑦)
To be mathematically more precise, we are looking for possible Local max. of 𝑓|𝑆
local extrema of the function 𝑓|𝑆 : 𝑆 → ℝ, where Local max. of 𝑓
𝑆 = {(𝑥1 , 𝑥2 , … , 𝑥𝑛 ): 𝑔(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 0}
is the “zero” level set of a function 𝑔 (a hypersurface in ℝ𝑛 ).
The notation 𝑓|𝑆 indicates that it is a function defined by the
𝑆: 𝑔(𝑥, 𝑦) = 0
same formula as 𝑓, but its domain is restricted to the subset 𝑆. 𝑥 𝑦

Theorem 4.16 (Lagrange’s multiplier, one constraint) Let 𝑓 and 𝑔 be functions of 𝑛 real
variables, let
𝑆 = {(𝑥1 , 𝑥2 , … , 𝑥𝑛 ): 𝑔(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 0}
be the zero level set of 𝑔, and let (𝑎1 , 𝑎2 , … , 𝑎𝑛 ) be an interior point of 𝑆. If 𝑓 and 𝑔 have
continuous partial derivatives near (𝑎1 , 𝑎2 , … , 𝑎𝑛 ), if ∇𝑔(𝑎1 , 𝑎2 , … , 𝑎𝑛 ) ≠ 𝟎, and if the function
𝑓|𝑆 : 𝑆 → ℝ attains local extremum at (𝑎1 , 𝑎2 , … , 𝑎𝑛 ), then there exists 𝜆 ∈ ℝ such that
∇𝑓(𝑎1 , 𝑎2 , … , 𝑎𝑛 ) = 𝜆∇𝑔(𝑎1 , 𝑎2 , … , 𝑎𝑛 ).

Proof. We consider only the case 𝑛 = 3 and note that the proof can be easily extended to the
general case. 𝑆 is then simply the level surface defined by 𝑔(𝑥, 𝑦, 𝑧) = 0. Now let (𝑎, 𝑏, 𝑐) be
an interior point of 𝑆 such that 𝑓 and 𝑔 have continuous partial derivatives near (𝑎, 𝑏, 𝑐),
∇𝑔(𝑎, 𝑏, 𝑐) ≠ 𝟎, and the restriction 𝑓|𝑆 : 𝑆 → ℝ attains local extremum at (𝑎, 𝑏, 𝑐). Then,
 ∇𝑔(𝑎, 𝑏, 𝑐) is normal to the surface 𝑆 at (𝑎, 𝑏, 𝑐) according to Theorem 3.74.
 On the other hand, we let 𝐶 be any curve lying inside 𝑆 which passes through (𝑎, 𝑏, 𝑐).
Then 𝐶 has a parametrization 𝐫(𝑡) = 〈𝑥(𝑡), 𝑦(𝑡), 𝑧(𝑡)〉, where 𝐫(𝑡0 ) = 〈𝑎, 𝑏, 𝑐〉 for some 𝑡0 .
The values of 𝑓|𝑆 on 𝐶 are given by
ℎ(𝑡) ≔ 𝑓(𝑥(𝑡), 𝑦(𝑡), 𝑧(𝑡)),
whose derivative with respect to 𝑡 is
𝜕𝑓 ′ 𝜕𝑓 ′ 𝜕𝑓 ′
ℎ′ (𝑡) = 𝑥 (𝑡) + 𝑦 (𝑡) + 𝑧 (𝑡) = ∇𝑓(𝑥(𝑡), 𝑦(𝑡), 𝑧(𝑡)) ⋅ 𝐫 ′ (𝑡).
𝜕𝑥 𝜕𝑦 𝜕𝑧
Since 𝑓|𝑆 attains local maximum at (𝑎, 𝑏, 𝑐), ℎ must attain local maximum at 𝑡0 , so that
∇𝑓(𝑎, 𝑏, 𝑐) ⋅ 𝐫 ′ (𝑡0 ) = ℎ′ (𝑡0 ) = 0.
So ∇𝑓(𝑎, 𝑏, 𝑐) is orthogonal to every curve 𝐶 lying inside 𝑆 which passes through (𝑎, 𝑏, 𝑐),
i.e. ∇𝑓(𝑎, 𝑏, 𝑐) is also normal to the surface 𝑆 at (𝑎, 𝑏, 𝑐).
The above shows that ∇𝑓(𝑎, 𝑏, 𝑐) and ∇𝑔(𝑎, 𝑏, 𝑐) are parallel. Since ∇𝑔(𝑎, 𝑏, 𝑐) ≠ 𝟎, we must
have ∇𝑓(𝑎, 𝑏, 𝑐) = 𝜆∇𝑔(𝑎, 𝑏, 𝑐) for some 𝜆 ∈ ℝ. ∎

Page 8 of 16
MATH2023 Multivariable Calculus Chapter 4 Applications of partial derivatives
L2/L3 (Fall 2019)

Remark 4.17 (Method of Lagrange’s multiplier, one constraint) Let 𝑓 and 𝑔 be functions of 𝑛
real variables having continuous partial derivatives. To find the possible local extrema of 𝑓
subject to the equality constraint 𝑔(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 0, we solve for (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) in the system
∇𝑓(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 𝜆∇𝑔(𝑥1 , 𝑥2 , … , 𝑥𝑛 )
{ ,
𝑔(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 0
(a system of (𝑛 + 1) scalar equations in the (𝑛 + 1) scalar unknowns 𝑥1 , 𝑥2 , … , 𝑥𝑛 and 𝜆).
The unknown 𝜆 in the above system is called a Lagrange’s multiplier. If one considers a function
𝐿 of (𝑛 + 1) real variables defined by
𝐿(𝑥1 , 𝑥2 , … , 𝑥𝑛 , 𝜆) ≔ 𝑓(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) − 𝜆𝑔(𝑥1 , 𝑥2 , … , 𝑥𝑛 )
(𝐿 is called the Lagrangian), then the above system simply reduces to the vector equation ∇𝐿 = 𝟎.

Remark 4.18 Note that Theorem 4.16 gives only a necessary (but not sufficient) condition for a
constrained local extremum, so the method of Lagrange’s multiplier only gives possible candidates
for constrained local extrema. The method does not guarantee that there must be a local
extremum somewhere, and it cannot distinguish whether any solution to the system will eventually
give a local maximum or local minimum or neither.

Example 4.19 Find the absolute maximum and minimum values of the function
𝑓(𝑥, 𝑦) = 𝑥 2 + 𝑦 2 − 4𝑥 + 9
on the ellipse 4𝑥 2 + 9𝑦 2 = 36.

Solution:
Let 𝑔(𝑥, 𝑦) = 4𝑥 2 + 9𝑦 2 − 36. To find the possible local extrema of 𝑓 subject to the equality
constraint 𝑔(𝑥, 𝑦) = 0, we solve the system
𝑓𝑥 (𝑥, 𝑦) = 𝜆𝑔𝑥 (𝑥, 𝑦) 2𝑥 − 4 = 𝜆(8𝑥)
{𝑓𝑦 (𝑥, 𝑦) = 𝜆𝑔𝑦 (𝑥, 𝑦) , i.e. {2𝑦 = 𝜆(18𝑦) .
𝑔(𝑥, 𝑦) = 0 4𝑥 2 + 9𝑦 2 = 36
1 18
If 𝑦 ≠ 0, then 𝜆 = 9 according to the second equation, so the first equation gives 𝑥 = , and the
5

third equation gives no real solution for 𝑦. If 𝑦 = 0, then the third equation gives (𝑥, 𝑦) = (3, 0)
or (−3, 0). The values of 𝑓 at these two points are
𝑦
𝑓(3, 0) = 6 and 𝑓(−3, 0) = 30.
Level curves of 𝑓
Since 𝑓 is continuous on the given ellipse, which is a closed and
bounded set in ℝ2 , 𝑓 must attain absolute maximum and minimum 𝑔(𝑥, 𝑦) = 0
on it. Therefore on this ellipse, the absolute maximum value of 𝑓 is
𝑥
30, which occurs at (−3, 0); and the absolute minimum value of 𝑓 −3 3

is 6, which occurs at (3, 0).

Page 9 of 16
MATH2023 Multivariable Calculus Chapter 4 Applications of partial derivatives
L2/L3 (Fall 2019)

Remark 4.20 In the previous example we could have solved the constraint equation
4𝑥 2 + 9𝑦 2 = 36,
4
substituted the solution 𝑦 2 = 4 − 9 𝑥 2 into 𝑓, and reduced the problem to finding the absolute

extrema of the single variable function


4
ℎ(𝑥) = 𝑥 2 + (4 − 𝑥 2 ) − 4𝑥 + 9
9
for 𝑥 ∈ [−3, 3] (why just on this interval?). This would of course give the same result.

Remark 4.21 Also note that there are some technical assumptions in Theorem 4.16, namely
 𝑓 and 𝑔 have continuous partial derivatives near (𝑎1 , 𝑎2 , … , 𝑎𝑛 );
 ∇𝑔(𝑎1 , 𝑎2 , … , 𝑎𝑛 ) ≠ 𝟎;
 (𝑎1 , 𝑎2 , … , 𝑎𝑛 ) is an interior point of 𝑆.
As a result, the method of Lagrange’s multiplier may possibly fail to detect constrained local
extrema of 𝑓 at a point (𝑎1 , 𝑎2 , … , 𝑎𝑛 ) ∈ 𝑆 where
 ∇𝑓(𝑎1 , 𝑎2 , … , 𝑎𝑛 ) or ∇𝑔(𝑎1 , 𝑎2 , … , 𝑎𝑛 ) does not exist; or
 ∇𝑔(𝑎1 , 𝑎2 , … , 𝑎𝑛 ) = 𝟎; or
 (𝑎1 , 𝑎2 , … , 𝑎𝑛 ) is a boundary point of 𝑆.

Example 4.22 Subject to the equality constraint 𝑔(𝑥, 𝑦) = 𝑦 3 − 𝑥 2 = 0, the function


𝑓(𝑥, 𝑦) = 𝑦
has a constrained local minimum value 0 at the origin (0, 0). However, such a constrained local
minimum cannot be detected using the method of Lagrange’s multiplier. Note that ∇𝑔(0, 0) = 𝟎
and that the curve 𝑔(𝑥, 𝑦) = 0 has a cusp at (0, 0).

Example 4.14 Find the absolute maximum and minimum values of the function
𝑓(𝑥, 𝑦) = 𝑥 2 + 3𝑦 2 + 2𝑦
on the closed unit disk 𝑥 2 + 𝑦 2 ≤ 1.

Solution:
𝑓 is continuous on the closed unit disk 𝑥 2 + 𝑦 2 ≤ 1 which is a closed and bounded set. For the
interior part we look for critical points as in the previous section, but on the boundary we may now
use the method of Lagrange’s multiplier instead of a parametrization.
 Critical points: We have already seen that
∇𝑓(𝑥, 𝑦) = 〈2𝑥, 6𝑦 + 2〉
1
and that the only critical point of 𝑓 is (0, − 3). The value of 𝑓 at this critical point is

1 1
𝑓 (0, − ) = − .
3 3
Page 10 of 16
MATH2023 Multivariable Calculus Chapter 4 Applications of partial derivatives
L2/L3 (Fall 2019)

 Boundary points: Instead of parametrizing the boundary circle, this time we note that the
boundary circle can be described by the equality constraint
𝑔(𝑥, 𝑦) = 𝑥 2 + 𝑦 2 − 1 = 0.
To find the possible local extrema of 𝑓 subject to this equality constraint, we solve the system
𝑓𝑥 (𝑥, 𝑦) = 𝜆𝑔𝑥 (𝑥, 𝑦) 2𝑥 = 𝜆(2𝑥)
{𝑓𝑦 (𝑥, 𝑦) = 𝜆𝑔𝑦 (𝑥, 𝑦) , i.e. {6𝑦 + 2 = 𝜆(2𝑦) .
𝑔(𝑥, 𝑦) = 0 𝑥2 + 𝑦2 = 1
If 𝑥 = 0, then the third equation gives (𝑥, 𝑦) = (0, 1) or (0, −1). If 𝑥 ≠ 0, then 𝜆 = 1
√3 1
according to the first equation, and so the second and third equations give (𝑥, 𝑦) = ( ,− )
2 2

√3 1
or (− , − 2). The values of 𝑓 at these four points are
2

√3 1 1 √3 1 1
𝑓(0, 1) = 5, 𝑓(0, −1) = 1, 𝑓( ,− ) = and 𝑓 (− ,− ) = .
2 2 2 2 2 2
Among all these values, we find that the absolute maximum 𝑦
value of 𝑓 is 5, which occurs at (0, 1); and the absolute Level curves of 𝑓
𝑔(𝑥, 𝑦) = 0
1 1 1
minimum value of 𝑓 is − 3, which occurs at (0, − 3).
𝑥

−1

Remark 4.23 The following is a summary on the procedure of finding the absolute extrema of a
continuous function 𝑓 of 𝒏 real variables on a closed and bounded set.
(i) First compute ∇𝑓. The critical points of 𝒇 are interior points (𝑎1 , 𝑎2 , … , 𝑎𝑛 ) of the domain
at which ∇𝑓(𝑎1 , 𝑎2 , … , 𝑎𝑛 ) = 𝟎. Find the value of 𝑓 at each of these critical points.
(ii) Next write the equation of the boundary of the domain as 𝑔(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 0. Look for
possible local extrema of 𝒇 on the boundary by either
 Parametrizing the boundary (this may be easy when 𝑛 = 2, the boundary is just a curve)
or
 Using the method of Lagrange’s multiplier, i.e. solving for (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) in the system
∇𝑓(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 𝜆∇𝑔(𝑥1 , 𝑥2 , … , 𝑥𝑛 )
{ .
𝑔(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 0
Also find the value of 𝑓 at each of these possible local extrema on the boundary.
(iii) Finally search for the largest and smallest values of 𝒇 among those finitely many values you
have listed in steps (i) and (ii).
If 𝑓 is a function which is NOT continuous on a closed and bounded set, then 𝑓 may or may not
attain any absolute extrema.

Page 11 of 16
MATH2023 Multivariable Calculus Chapter 4 Applications of partial derivatives
L2/L3 (Fall 2019)

Remark 4.24 (Method of Lagrange’s multiplier, 𝒌 constraints) Let 𝑓 and 𝑔1 , 𝑔2 , … , 𝑔𝑘 be


functions of 𝑛 real variables, with 𝑘 < 𝑛. To find the possible local extrema of 𝑓 subject to all
the equality constraints
𝑔1 (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 0
𝑔 (𝑥 , 𝑥 , … , 𝑥𝑛 ) = 0
{ 2 1 2 ,

𝑔𝑘 (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 0
we solve for (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) in the system

∇𝑓(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 𝜆1 ∇𝑔1 (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) + ⋯ + 𝜆𝑘 ∇𝑔𝑘 (𝑥1 , 𝑥2 , … , 𝑥𝑛 )


𝑔1 (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 0
𝑔2 (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 0 ,

{𝑔𝑘 (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 0

(a system of (𝑛 + 𝑘) scalar equations in the (𝑛 + 𝑘) unknowns (𝑥1 , 𝑥2 , … , 𝑥𝑛 , 𝜆1 , 𝜆2 , … , 𝜆𝑘 )).


The unknowns 𝜆1 , 𝜆2 , … , 𝜆𝑘 in the above system are called Lagrange’s multipliers. If one
considers a function 𝐿 of (𝑛 + 𝑘) real variables defined by
𝐿(𝑥1 , 𝑥2 , … , 𝑥𝑛 , 𝜆1 , 𝜆2 , … , 𝜆𝑘 ) ≔ 𝑓(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) − 𝜆1 𝑔1 (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) − ⋯ − 𝜆𝑘 𝑔𝑘 (𝑥1 , 𝑥2 , … , 𝑥𝑛 )
(𝐿 is called the Lagrangian), then the above system simply reduces to the vector equation ∇𝐿 = 𝟎.

Example 4.25 Find the absolute maximum and minimum values of the function
𝑓(𝑥, 𝑦, 𝑧) = 𝑥 + 2𝑦 + 3𝑧
on the curve of intersection of the plane 𝑥 − 𝑦 + 𝑧 = 1 and the circular cylinder 𝑥 2 + 𝑦 2 = 1.

Solution:
Let 𝑔(𝑥, 𝑦, 𝑧) = 𝑥 − 𝑦 + 𝑧 − 1 and ℎ(𝑥, 𝑦, 𝑧) = 𝑥 2 + 𝑦 2 − 1. We find the possible local extrema
of 𝑓 subject to the equality constraints 𝑔(𝑥, 𝑦, 𝑧) = 0 and ℎ(𝑥, 𝑦, 𝑧) = 0 by solving the system
𝑓𝑥 (𝑥, 𝑦, 𝑧) = 𝜆𝑔𝑥 (𝑥, 𝑦, 𝑧) + 𝜇ℎ𝑥 (𝑥, 𝑦, 𝑧) 1 = 𝜆 + 2𝑥𝜇
𝑓𝑦 (𝑥, 𝑦, 𝑧) = 𝜆𝑔𝑦 (𝑥, 𝑦, 𝑧) + 𝜇ℎ𝑦 (𝑥, 𝑦, 𝑧) 2 = −𝜆 + 2𝑦𝜇
𝑓𝑧 (𝑥, 𝑦, 𝑧) = 𝜆𝑔𝑧 (𝑥, 𝑦, 𝑧) + 𝜇ℎ𝑧 (𝑥, 𝑦, 𝑧) , i.e. 3 = 𝜆 .
𝑔(𝑥, 𝑦, 𝑧) = 0 𝑥−𝑦+𝑧 =1
{ℎ(𝑥, 𝑦, 𝑧) = 0 {𝑥 2 + 𝑦 2 = 1

From the first three equations we obtain 𝑥𝜇 = −1 and 2𝑦𝜇 = 5, and the fifth equation becomes
1 2 5 2
(− ) + ( ) = 1,
𝜇 2𝜇
√29 √29 √29 2 5 7
so 𝜇 = or − . If 𝜇 = , then the fourth equation gives (𝑥, 𝑦, 𝑧) = (− , ,1 + );
2 2 2 √29 √29 √29

√29 2 5 7
if 𝜇 = − , then the fourth equation gives (𝑥, 𝑦, 𝑧) = ( ,− ,1 − ).
2 √29 √29 √29

Page 12 of 16
MATH2023 Multivariable Calculus Chapter 4 Applications of partial derivatives
L2/L3 (Fall 2019)

The values of 𝑓 at these two points are


2 5 7 2 5 7
𝑓 (− , ,1 + ) = 3 + √29 and 𝑓 ( ,− ,1− ) = 3 − √29.
√29 √29 √29 √29 √29 √29
The two equality constraints 𝑔(𝑥, 𝑦, 𝑧) = 1 and ℎ(𝑥, 𝑦, 𝑧) = 1 define an ellipse in ℝ3 , which is a
closed and bounded set. Since 𝑓 is continuous on such an ellipse, 𝑓 must attain both absolute
maximum and minimum on it. So on this ellipse, the absolute minimum value of 𝑓 is 3 + √29
and the absolute maximum value of 𝑓 is 3 − √29.

3. Optimization

The techniques we have learnt in the previous two sections can be applied to solve problems in
optimization. When we look for the extremum values of a function without any constraints, we
are solving an unconstrained optimization problem; if there are some additional equality or
inequality constraints to the independent variables, then we are solving a constrained optimization
problem. The method of Lagrange’s multiplier may sometimes be useful in the latter case.

Example 4.26 Let 𝑎 > 0 and suppose that the frame of a


rectangular box is made of a piece of wire of length 4𝑎. Find
the largest possible surface area of such a rectangular box. 𝑎−𝑥−𝑦

𝑦
𝑥
Solution (optimization problem with two variables):
Let 𝑥, 𝑦 and 𝑎 − 𝑥 − 𝑦 be the length, width and height of the box respectively. Then the
surface area of the box is given by
𝑓(𝑥, 𝑦) = 2𝑥𝑦 + 2𝑥(𝑎 − 𝑥 − 𝑦) + 2𝑦(𝑎 − 𝑥 − 𝑦)
= 2𝑎𝑥 + 2𝑎𝑦 − 2𝑥 2 − 2𝑦 2 − 2𝑥𝑦
for every (𝑥, 𝑦) in the closed region
𝑅 = {(𝑥, 𝑦) ∈ ℝ2 : 𝑥 ≥ 0 and 𝑦 ≥ 0 and 𝑥 + 𝑦 ≤ 𝑎}.
Our goal is to find the absolute maximum of 𝑓. Now 𝑓 is continuous on the closed and bounded
set 𝑅, so it does have an absolute maximum, which must occur either at critical points or at
boundary points.

 Critical points: We have


∇𝑓(𝑥, 𝑦) = 〈2𝑎 − 4𝑥 − 2𝑦, 2𝑎 − 4𝑦 − 2𝑥〉,
𝑎 𝑎 𝑎
so ∇𝑓(𝑥, 𝑦) = 𝟎 only when 𝑥 = 𝑦 = 3, which means that ( 3 , 3) is the only critical point of

𝑓. The value of 𝑓 at this critical point is


𝑎 𝑎 2
𝑓 ( , ) = 𝑎2 .
3 3 3

Page 13 of 16
MATH2023 Multivariable Calculus Chapter 4 Applications of partial derivatives
L2/L3 (Fall 2019)

 Boundary points: The boundary of the region consists of three line segments.
(i) Along the line segment 𝑥 = 0 joining (0, 0) and (0, 𝑎), we have 𝑦

𝑎
𝑎 2 𝑎2
𝑓(𝑥, 𝑦) = 𝑓(0, 𝑡) = 2𝑎𝑡 − 2𝑡 2 = −2 (𝑡 − ) +
⏟ 2 2
≤0
𝑥
𝑎2 0 𝑎
where 𝑡 ∈ [0, 𝑎], so 𝑓(𝑥, 𝑦) ≤ along this line segment.
2

𝑎2
(ii) Along the line segment 𝑦 = 0 joining (0, 0) and (𝑎, 0), we similarly have 𝑓(𝑥, 𝑦) ≤ .
2

(iii) Along the line segment 𝑥 + 𝑦 = 𝑎 joining (𝑎, 0) and (0, 𝑎), we have
1 2 𝑎2
𝑓(𝑥, 𝑦) = 𝑓(𝑎(1 − 𝑡), 𝑎𝑡) = 2𝑎2 (𝑡 − 𝑡 2 ) = −2𝑎2 (𝑡 − ) +
⏟ 2 2
≤0

𝑎2
where 𝑡 ∈ [0, 1], so again 𝑓(𝑥, 𝑦) ≤ 2
along this line segment.

2
Therefore the largest possible surface area of the box is 𝑎2 .
3

Alternative solution (optimization problem with three variables and one equality constraint):
Let 𝑥 , 𝑦 and 𝑧 be the length, width and height of the box
respectively. Then the surface area of the box is given by
𝑓(𝑥, 𝑦, 𝑧) = 2𝑥𝑦 + 2𝑦𝑧 + 2𝑥𝑧.
We need to find the absolute maximum of this function 𝑓 of three 𝑧

variables, subject to the equality constraint 𝑦


𝑥
4𝑥 + 4𝑦 + 4𝑧 = 4𝑎.
The constraint can be rewritten as 𝑔(𝑥, 𝑦, 𝑧) ≔ 𝑥 + 𝑦 + 𝑧 − 𝑎 = 0, so we solve the system
𝑓𝑥 (𝑥, 𝑦, 𝑧) = 𝜆𝑔𝑥 (𝑥, 𝑦, 𝑧) 2𝑦 + 2𝑧 = 𝜆
𝑓𝑦 (𝑥, 𝑦, 𝑧) = 𝜆𝑔𝑦 (𝑥, 𝑦, 𝑧) 2𝑥 + 2𝑧 = 𝜆
, i.e. { .
𝑓𝑧 (𝑥, 𝑦, 𝑧) = 𝜆𝑔𝑧 (𝑥, 𝑦, 𝑧) 2𝑥 + 2𝑦 = 𝜆
{𝑔(𝑥, 𝑦, 𝑧) = 0 𝑥+𝑦+𝑧 =𝑎
Subtracting each of the first three equations from two times the fourth equation, we obtain
𝑥 = 𝑦 = 𝑧,
𝑎 𝑎 𝑎
so by the fourth equation again, we obtain (𝑥, 𝑦, 𝑧) = (3 , 3 , 3). Therefore the largest possible

surface area of the box is


𝑎 𝑎 𝑎 2
𝑓 ( , , ) = 𝑎2 .
3 3 3 3

Page 14 of 16
MATH2023 Multivariable Calculus Chapter 4 Applications of partial derivatives
L2/L3 (Fall 2019)

Example 4.27 Find the points on the sphere in ℝ3 defined by the equation
𝑥2 + 𝑦2 + 𝑧2 = 4
that are nearest to and farthest from the point (3, 1, −1).

Solution:
The square of the distance from a point (𝑥, 𝑦, 𝑧) to (3, 1, −1) is
𝑓(𝑥, 𝑦, 𝑧) = (𝑥 − 3)2 + (𝑦 − 1)2 + (𝑧 + 1)2 .
Our aim is to find the absolute extrema of 𝑓 subject to the equality constraint
𝑔(𝑥, 𝑦, 𝑧) = 𝑥 2 + 𝑦 2 + 𝑧 2 − 4 = 0.
We solve the system
𝑓𝑥 (𝑥, 𝑦, 𝑧) = 𝜆𝑔𝑥 (𝑥, 𝑦, 𝑧) 2𝑥 − 6 = 2𝜆𝑥
𝑓𝑦 (𝑥, 𝑦, 𝑧) = 𝜆𝑔𝑦 (𝑥, 𝑦, 𝑧) 2𝑦 − 2 = 2𝜆𝑦
, i.e. { .
𝑓𝑧 (𝑥, 𝑦, 𝑧) = 𝜆𝑔𝑧 (𝑥, 𝑦, 𝑧) 2𝑧 + 2 = 2𝜆𝑧
{𝑔(𝑥, 𝑦, 𝑧) = 0 𝑥2 + 𝑦2 + 𝑧2 = 4

3 1 1
The first three equations give 𝑥 = 1−𝜆, 𝑦 = 1−𝜆 and 𝑧 = 𝜆−1, and the fourth equation then gives

3 2 1 2 1 2
( ) +( ) +( ) = 4,
1−𝜆 1−𝜆 𝜆−1
√11 √11 6 2 2
so 𝜆 = 1 + or 1 − . In the former case we have (𝑥, 𝑦, 𝑧) = (− ,− , ); in the
2 2 √11 √11 √11

6 2 2
latter case we have (𝑥, 𝑦, 𝑧) = ( , ,− ). Since
√11 √11 √11

6 2 2 2 6 2 2 2
𝑓 (− ,− , ) = (√11 + 2) and 𝑓( , ,− ) = (√11 − 2) ,
√11 √11 √11 √11 √11 √11
6 2 2 6 2 2
the point ( , ,− ) is the nearest to (3, 1, −1) and the point (− ,− , ) is the
√11 √11 √11 √11 √11 √11

farthest from (3, 1, −1).

Think: Can you obtain the required points without using any calculus?
[The given sphere 𝑥 2 + 𝑦 2 + 𝑧 2 = 4 has radius 2 and is centered at the origin 𝑂, and
the given point 𝑃 = (3, 1, −1) lies in the exterior of the sphere. So the point on the
sphere nearest to 𝑃 is the point 𝐴 such that ⃗⃗⃗⃗⃗ 𝑂𝐴 has length 2 and has the same
⃗⃗⃗⃗⃗
direction as 𝑂𝑃, and the point on the sphere farthest from 𝑃 is the point 𝐵 such that
⃗⃗⃗⃗⃗ has length 2 and has direction opposite to ⃗⃗⃗⃗⃗
𝑂𝐵 𝑂𝑃.]

𝑃
𝐴
𝐵 𝑂

Page 15 of 16
MATH2023 Multivariable Calculus Chapter 4 Applications of partial derivatives
L2/L3 (Fall 2019)

Summary of Chapter 4

The following are what you need to know in this chapter in order to get a pass (a distinction) in this
course:

 Maximum, minimum and saddle points of a function of several real variables


 Interior extrema must occur at critical points
 To classify critical points into local maximum / local minimum / saddle point using the second
derivative test with two variables; Hessian of a function
 To locate boundary extrema using
 Parametrization of the boundary curve, or
 The method of Lagrange’s multiplier

 To find absolute extrema of a continuous function 𝑓 defined on a closed and bounded set:
 Find the values of 𝑓 at interior critical points
 Find the values of 𝑓 at possible boundary extrema
 Identify the largest and smallest among these values

 Unconstrained optimization
 Constrained optimization using the method of Lagrange’s multiplier
 Limitations of the method of Lagrange’s multiplier
 Proof of the Lagrange’s multiplier Theorem 4.16

Page 16 of 16

You might also like