Professional Documents
Culture Documents
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.
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)
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).
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 𝑂𝐵
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:
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
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
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
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.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)
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)
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.
𝑦
𝑥
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.
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 𝑧
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
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:
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