Lecture #4 SQ2025 Update
Lecture #4 SQ2025 Update
Lecture IV
Albena Veltcheva
Waseda University
Summer Quarter 2025
1
Gradient, Divergence, Curl, and
the Del Operator
Gradient
2
Gradient
The gradient is defined for a scalar function Φ(x,y,z) as:
𝜕 𝜕 𝜕 𝜕Φ 𝜕Φ 𝜕Φ
𝛻Φ = 𝑖Ԧ + 𝑗Ԧ + 𝑘 Φ = 𝑖Ԧ + 𝑗Ԧ +𝑘
𝜕𝑥 𝜕𝑦 𝜕𝑧 𝜕𝑥 𝜕𝑦 𝜕𝑧
4
Lagrange Multipliers
Constrained Extrema
5
Copyright 2012 Pearson Education, Inc.
Lagrange Multiplier Method
➢ We are looking for extrema of 𝑓 𝑥, 𝑦 while
“moving” on g 𝑥, 𝑦
➢ → 𝛻𝑓 at an extremum is proportional to 𝛻𝑔
𝛻𝑓 parallel to 𝛻𝑔:
𝛻𝑓 = 𝜆𝛻𝑔
- Lagrange Multiplier 6
Lagrange Multiplier Theorem
f (x) = g(x)
g(x) = c
really n
for x, . equations
8
Copyright 2012 Pearson Education, Inc.
Exercise
Find extrema of a function 𝑓 𝑥, 𝑦 = 𝑥 2 + 2𝑦 2 under the
constraint 𝑔 𝑥, 𝑦 = 2𝑥 + 𝑦 = 9
𝟐𝒙 + 𝒚 = 𝟗
Find the position and value of this minimum
9
Solution
𝑓 𝑥, 𝑦 = 𝑥 2 + 2𝑦 2
𝑔 𝑥, 𝑦 = 2𝑥 + 𝑦 = 9
𝛻𝑓 = λ𝛻𝑔
2𝑥 = 2λ
4𝑦 = λ
2𝑥 + 𝑦 = 9
𝑥 = 4𝑦 , 8𝑦 + 𝑦 = 9, 𝑦 = 1 , 𝑥 = 4
𝟐𝒙 + 𝒚 = 𝟗
Volume:
𝑓 𝑥, 𝑦, 𝑧 = 𝑥𝑦𝑧
Area / 2 = 27:
𝑔 𝑥, 𝑦, 𝑧 = 2𝑥𝑦 + 2𝑥𝑧 + 2𝑦𝑧 = 54 𝑔 𝑥, 𝑦, 𝑧 = 𝑥𝑦 + 𝑥𝑧 + 𝑦𝑧 = 27
𝑦𝑧 𝑦+𝑧
𝛻𝑓 = 𝑥𝑧 , 𝛻𝑔 = 𝑥 + 𝑧
𝑥𝑦 𝑥+𝑦
𝑦𝑧 = λ 𝑦 + 𝑧
𝑥𝑧 = λ 𝑥 + 𝑧 System of
𝑥𝑦 = λ 𝑥 + 𝑦 Equations
𝑥𝑦 + 𝑥𝑧 + 𝑦𝑧 = 27
12
Solution
λ𝑥 𝑦 + 𝑧 = λ𝑦 𝑥 + 𝑧
𝑦𝑧 = λ 𝑦 + 𝑧
λ 𝑥𝑦 + 𝑥𝑧 − 𝑥𝑦 + 𝑦𝑧 = 0
𝑥𝑧 = λ 𝑥 + 𝑧
λ 𝑥𝑧 − 𝑦𝑧 = 0
𝑥𝑦 = λ 𝑥 + 𝑦
𝑥𝑦 + 𝑥𝑧 + 𝑦𝑧 = 27 λ = 0 , 𝑥𝑧 = 𝑦𝑧 , 𝑧 = 0 , 𝑥 = 𝑦
14
Solution
Find extrema of a function 𝑓 𝑥, 𝑦 = 𝑥 2 + 𝑦 under the
constraint 𝑔 𝑥, 𝑦 = 𝑥 2 + 𝑦 2 = 1
𝛻𝑓 = 𝜆𝛻𝑔
2𝑥 2𝑥
𝛻𝑓 = , 𝛻𝑔 =
1 2𝑦
2𝑥 = λ2𝑥
1 = λ2𝑦
𝑥2 + 𝑦2 = 1
15
Solution
2𝑥 = λ2𝑥 2𝑥 = λ2𝑥
1 = λ2𝑦
λ=1 OR 𝑥=0
𝑥2 + 𝑦2 = 1
1 𝑦2 = 1
𝑦=
2
1 𝑦 = 1 𝑦 = −1
2
𝑥 + =1
4
𝑥=0 𝑥=0
𝑥 = 0𝑦 =1
3 3 𝑥 = 0 𝑦 = −1
𝑥=
4 𝑥=− 4 3 1
𝑥= 𝑦=
4 2 16
3 1
𝑥=− 𝑦=
4 2
Solution
The obtained points are only critical points:
→ may be minimum, maximum or saddle point
𝑓 𝑥, 𝑦 = 𝑥 2 + 𝑦
𝑥 = 0, 𝑦 = −1 → 𝑓 0, −1 = −1 Global Minimum
3 1 3 1 5
𝑥= ,𝑦 = → 𝑓 , = Global Maximum
4 2 4 2 4
3 1 3 1 5
𝑥 = − ,𝑦 = → 𝑓 − 4,2 = 4 Global Maximum
4 2
18
Extrema on Compact
Regions(reminder)
● Definition A region (subset) D in Rn is compact if it is
closed (i.e., contains all its boundary points) and
bounded (i.e., can be enclosed in a suitable large n-
dimensional ball).
● ➔ compact sets contain their boundaries (a consequence
of being closed) and have only finite extent (a
consequence of being bounded).
19
Extreme Value Theorem (reminder)
The notion of compactness is of value because of the socalled
Extreme Value theorem
22
Solution
Find the extrema of 𝑓 𝑥, 𝑦 = 2𝑥 + 𝑦 subject to the conditions
that 𝑥 + 𝑦 = 3
Let 𝑔 𝑥, 𝑦 = 𝑥 + 𝑦 = 3
∇𝑓 𝑥, 𝑦 = 𝜆∇𝑔 𝑥, 𝑦
2 = 𝜆/(2 𝑥)
൞ 1 = 𝜆/(2 𝑦)
𝑥+ 𝑦=3
𝜆
2= ⇒𝜆=4 𝑥=2 𝑦
2 𝑥
𝑦=2 𝑥
𝑥+ 𝑦=3⇒3 𝑥=3⇒𝑥=1
Then 𝑦 = 2 𝑥 ⇒ 𝑦 = 4
One critical point 1,4 23
Solution
Find the extrema of 𝑓 𝑥, 𝑦 = 2𝑥 + 𝑦 subject to the conditions
that 𝑥 + 𝑦 = 3 One critical point 1,4
Since the constraint defines a closed, bounded
curve segment, by the extreme value theorem
f must attain both a global maximum and a
global minimum on this segment.
By the Lagrange multiplier method only a
single critical point 1,4 . However the points
(9, 0) and (0, 9) satisfy the constraint
𝑥 + 𝑦 = 3. But they are both points where
∇𝑔 is undefined
f=? at (1,4), (9,0) and (0,9)
f (1, 4) = 6, while f (9, 0) = 18 and f (0, 9) = 9.
Comparing the value of 𝑓 𝑥, 𝑦 at these three points we conclude24
that the minimum of f occurs at (1, 4) and the maximum at (9, 0).
Solution
Find the extrema of 𝑓 𝑥, 𝑦 = 2𝑥 + 𝑦 subject to the conditions that 𝑥 + 𝑦 = 3
The minimum of f occurs at (1, 4) and the
maximum at (9, 0).
Geometry: The level sets of the function f =
the family of parallel lines 2𝑥 + 𝑦 = 𝑘. The
height 𝑘 is the y-intercept of the corresponding
line in the family. → looking to find the largest
and smallest y-intercepts of any line in the
family that meets the curve 𝑥 + 𝑦 = 3
These extreme values of 𝑘 occur either when one of the lines is
tangent to the constraint curve or at an endpoint of the curve.
This example – illustration of the importance of locating all the
points where extrema may occur by considering places where
∇𝑓 or ∇𝑔 is undefined (or where ∇𝑔 = 𝟎) as well as the critical
points determined by Lagrange multiplier method. 25
Lagrange Multipliers
More than one constrain
Generalization
Find extrema of a function f subject to several constraints.
26
More Than One Constraint
g1(x1,…, xn) = c1
g2(x1,…, xn) = c2
gk(x1,…, xn) = ck
where k < n.
27
Theorem
● Let f : X → R and g1,…, gk: X → R be functions of class
C1, where X Rn is open.
● Let S ={x Rn | g1(x) = c1,…, gk(x) = ck} are
constrains.
● If f |S has an extremum at a point a S where
g1(a),…,gk(a) are linearly independent*, then there
exist scalars 1,…, k such that
f (a) = 1g1(a) + 2g2(a) + … + kgk(a).
k vectors v1,…,vk are linearly independent if the only way to satisfy
equation a1v1 +… + akvk = 0 for scalars a1, … ak is if
a1 = a2 … = ak = 0. 28
Finding Constrained
Critical Points
gk(x) = ck g1(x) = c1
gk(x) = ck
for x, 1,…, k.
29
Exercise
Use Lagrange multipliers to identify the critical points of
𝑓 𝑥, 𝑦, 𝑧 = 2𝑥 + 𝑦 2 − 𝑧 2 , subject to the constrains 𝑥 − 2𝑦 = 0,
𝑥+𝑧 =0
30
Solution
Use Lagrange multipliers to identify the critical points of
𝑓 𝑥, 𝑦, 𝑧 = 2𝑥 + 𝑦 2 − 𝑧 2 , subject to the constrains 𝑥 − 2𝑦 = 0,
𝑥+𝑧 =0
𝑔1 (𝑥, 𝑦, 𝑧) = 𝑥 − 2𝑦 = 0
ቊ
𝑔2 (𝑥, 𝑦, 𝑧) = 𝑥 + 𝑧 = 0
By the Theorem, any constrained critical points (𝑥0 , 𝑦0 , 𝑧0 ) must
satisfy ∇𝑓 𝑥0 , 𝑦0 , 𝑧0 = 𝜆1 ∇𝑔1 𝑥0 , 𝑦0 , 𝑧0 + 𝜆2 ∇𝑔2 𝑥0 , 𝑦0 , 𝑧0
and the two constrained →system
2 = 𝜆1 + 𝜆2
2𝑦 = −2𝜆1
−2𝑧 = 𝜆2
𝑔1 (𝑥, 𝑦, 𝑧) = 𝑥 − 2𝑦 = 0
𝑔2 (𝑥, 𝑦, 𝑧) = 𝑥 + 𝑧 = 0
31
Solution
2 = 𝜆1 + 𝜆2
2𝑦 = −2𝜆1
−2𝑧 = 𝜆2
𝑔1 (𝑥, 𝑦, 𝑧) = 𝑥 − 2𝑦 = 0
𝑔2 (𝑥, 𝑦, 𝑧) = 𝑥 + 𝑧 = 0
Subtract from 3rd (x2) eq 2nd one and compare with 1st
2 = 𝜆1 + 𝜆2 = −𝑦 − 2𝑧
Substitute 𝑧 and 𝑦 from 4th and 5th
𝑥 4
2 = −𝑦 − 2𝑧 = − + 2𝑥 ⇒ 𝑥 =
2 3
4 2 4
The critical point is , , −
3 3 3
32
Exercise
Use Lagrange multipliers to identify the critical points of
𝑓 𝑥, 𝑦, 𝑧 = 2𝑥 + 𝑦 2 + 2𝑧, subject to the constrains 𝑥 2 − 𝑦 2 = 1,
𝑥+𝑦+𝑧 =2
33
Solution
Use Lagrange multipliers to identify the critical points of
𝑓 𝑥, 𝑦, 𝑧 = 2𝑥 + 𝑦 2 + 2𝑧, subject to the constrains 𝑥 2 − 𝑦 2 = 1,
𝑥+𝑦+𝑧 =2
𝑔1 (𝑥, 𝑦, 𝑧) = 𝑥 2 − 𝑦 2 = 1
ቊ
𝑔2 𝑥, 𝑦, 𝑧 = 𝑥 + 𝑦 + 𝑧 = 2
By the Theorem, any constrained critical points (𝑥0 , 𝑦0 , 𝑧0 ) must
satisfy ∇𝑓 𝑥0 , 𝑦0 , 𝑧0 = 𝜆1 ∇𝑔1 𝑥0 , 𝑦0 , 𝑧0 + 𝜆2 ∇𝑔2 𝑥0 , 𝑦0 , 𝑧0
and the two constrained →system
2 = 2𝑥𝜆1 + 𝜆2
2𝑦 = −2𝑦𝜆1 + 𝜆2
2 = 𝜆2
𝑔1 (𝑥, 𝑦, 𝑧) = 𝑥 2 − 𝑦 2 = 1
𝑔2 (𝑥, 𝑦, 𝑧) = 𝑥 + 𝑦 + 𝑧 = 2
34
Solution
2 = 2𝑥𝜆1 + 𝜆2
2𝑦 = −2𝑦𝜆1 + 𝜆2
2 = 𝜆2
𝑔1 (𝑥, 𝑦, 𝑧) = 𝑥 2 − 𝑦 2 = 1
𝑔2 (𝑥, 𝑦, 𝑧) = 𝑥 + 𝑦 + 𝑧 = 2
2 = 𝜆2 ⇒ 2𝑥𝜆1 = 0 ⇒ 𝜆1 = 0 or 𝑥 = 0
If 𝑥 = 0 ⇒ 𝑥 2 − 𝑦 2 = 1 ⇒ −𝑦 2 = 1 – no solution
If 𝜆1 = 0 ⇒ 2𝑦 = 2 ⇒ 𝑦 = 1
From 4th eq 𝑥 2 = 2 ⇒ 𝑥 = ± 2
From 5th eq. 𝑧 = 1 ∓ 2
The critical points are 2, 1,1 − 2 and − 2, 1,1 + 2
35
Hessian Criterion for
Constrained Extrema
Optional
Although sometimes the determination of the nature of a critical
point (constrained or unconstrained) can be done from
considerations it is better to have a more automatic way to find
the type of a constrained critical point.
→ Hessian criterion for constrained critical points
Like the one in the unconstrained case, Hessian criterion only
determines the local nature of a critical point and no information
about global constrained extrema
36
The Hessian Criterion: Set-up
Find extrema of a function f : X ⊆ Rn → R subject to the k
constraints
g1(x1,…, xn) = c1
g2(x1,…, xn) = c2
gk(x1,…, xn) = ck
Assume that g1(x),…gk(x) are linearly independent at the
constrained critical point a. By the theorem, any constrained
extremum a must satisfy
f (x) = 1g1(x) +…+ kgk(x)
for some scalars 1, . . . , k . Then we can consider a constrained
critical point to be a pair of vectors (; a) = (1,…, k; a1,…, an)
37
The Hessian Criterion: Set-up
● Consider a constrained critical point of f subject to
● g1 = c1,…, gk = ck to be a pair of vectors
● (; a) = (1,…, k; a1,…, an)
● In fact, (; a) is an unconstrained critical point of the
function 𝐿 defined by
● 𝐿 𝑙1 , 𝑙2 , … , 𝑙𝑘 ; 𝑥1 , 𝑥2 , … , 𝑥𝑛 = 𝑓 𝑥1 , 𝑥2 , … , 𝑥𝑛
𝑘
σ
− 𝑖=1 𝑙𝑖 𝑔𝑖 𝑥1 , 𝑥2 , … , 𝑥𝑛 − 𝑐𝑖
Lagrangian function L
The Hessian Criterion: Set-up
The Hessian criterion comes from considering the
Hessian of L at the critical point (λ; a).
𝐿 𝑙1 , 𝑙2 , … , 𝑙𝑘 ; 𝑥1 , 𝑥2 , … , 𝑥𝑘
𝑘
= 𝑓 𝑥1 , 𝑥2 , … , 𝑥𝑘 − 𝑙𝑖 𝑔𝑖 𝑥1 , 𝑥2 , … , 𝑥𝑘 − 𝑐𝑖
𝑖=1
2 2 2
f g1 gk
hij = (a) − 1 (a) − − k (a).
x j xi x j xi x j xi
The Hessian Criterion: Set-up
From linear algebra: Since g1(x),…gk(x) are linearly independent
at the constrained critical point a. Then derivative matrix of
g = (g1, . . . , gk) at a,
𝜕𝑔1 𝜕𝑔1
𝒂 … 𝒂
𝜕𝑥1 𝜕𝑥𝑛
𝑫𝒈 𝒂 = ⋮ ⋱ ⋮
𝜕𝑔𝑘 𝜕𝑔𝑘
𝒂 𝒂
𝜕𝑥1 𝜕𝑥𝑛
has a k × k submatrix (obtained by deleting n − k columns of Dg(a)) with
nonzero determinant. By relabeling the variables, we will assume
𝜕𝑔1 𝜕𝑔1
𝒂 … 𝒂
𝜕𝑥1 𝜕𝑥𝑘
𝑑𝑒𝑡 ⋮ ⋱ ⋮ ≠0
𝜕𝑔𝑘 𝜕𝑔𝑘
𝒂 𝒂
𝜕𝑥1 𝜕𝑥𝑘
(i.e., that we may delete the last n − k columns).
The Hessian Criterion: Set-up
Look at the Hessian HL(; a) of L at (; a):
k n
0 g1 g1
0 − (a) − (a)
x1 xn
k
g k g k
0 0 − (a) − (a)
x1 xn
g1 g k
− x1 (a) −
x1
(a) h11 h1n
n g g k
−
x 1 (a) − x (a) hn1 hnn
n n
HL(; a) is (𝑛 + 𝑘) × (𝑛 + 𝑘) matrix
The Hessian Criterion: Set-up
45
Solution
An open rectangular box is to be manufactured having a (fixed)
volume of 4 m3. Use the Lagrange multipliers to find what
dimensions should the box have so as to minimize the amount of
material used to make it.
➔to minimize the surface area
𝐴 𝑥, 𝑦, 𝑧 = 2𝑥𝑦 + 2𝑦𝑧 + 𝑥𝑧
subject to the constrain
𝑉 𝑥, 𝑦, 𝑧 = 𝑥𝑦𝑧 = 4
1. ∇𝐴 𝑥, 𝑦, 𝑧 = 𝜆∇𝑉 𝑥, 𝑦, 𝑧
2. System
2𝑦 + 𝑧 = 𝜆𝑦𝑧
2𝑥 + 2𝑧 = 𝜆𝑥𝑧
2𝑦 + 𝑥 = 𝜆𝑥𝑦
𝑥𝑦𝑧 = 4
46
Solution
1. ∇𝐴 𝑥, 𝑦, 𝑧 = 𝜆∇𝑉 𝑥, 𝑦𝑧
2𝑦 + 𝑧 = 𝜆𝑦𝑧
2𝑥 + 2𝑧 = 𝜆𝑥𝑧
2. System 2𝑦 + 𝑥 = 𝜆𝑥𝑦
𝑥𝑦𝑧 = 4
2𝑦 + 𝑧 2𝑥 + 2𝑧 2𝑦 + 𝑥
𝜆= = =
𝑦𝑧 𝑥𝑧 𝑥𝑦
2 1 2 2 2 1
+ = + = +
𝑧 𝑦 𝑧 𝑥 𝑥 𝑦
2 1 2 2
+ = + ⇒ 𝑥 = 2𝑦
𝑧 𝑦 𝑧 𝑥
2 2 2 1
+ = + ⇒ 𝑧 = 2𝑦
𝑧 𝑥 𝑥 𝑦
𝑥𝑦𝑧 = 4 ⇒ 2𝑦 𝑦 2𝑦 = 4 ⇒ 𝑦 = 1
𝑥 = 2, 𝑦 = 1, 𝑧 = 2 ⇒ 𝜆 = 2 47
Solution
One critical point 𝑥 = 2, 𝑦 = 1, 𝑧 = 2 ⇒ 𝜆 = 2
Lagrangian function L
𝐿 𝑙; 𝑥, 𝑦, 𝑧 = 𝐴 𝑥, 𝑦, 𝑧 − 𝑙 𝑉 𝑥, 𝑦, 𝑧 − 4
= 2𝑥𝑦 + 2𝑦𝑧 + 𝑥𝑧 − 𝑙(𝑥𝑦𝑧 − 4)
𝜕2𝐿 𝜕2𝐿 𝜕2𝐿 𝜕2𝐿
𝜕𝑙 2 𝜕𝑙𝜕𝑥 𝜕𝑙𝜕𝑦 𝜕𝑙𝜕𝑧
𝜕2𝐿 𝜕2𝐿 𝜕2𝐿 𝜕2𝐿
𝜕𝑥𝜕𝑙 𝜕𝑥 2 𝜕𝑥𝜕𝑦 𝜕𝑥𝜕𝑧
𝐻𝐿 𝑙; 𝑥, 𝑦, 𝑧 =
𝜕2𝐿 𝜕2𝐿 𝜕2𝐿 𝜕2𝐿
𝜕𝑦𝜕𝑙 𝜕𝑦𝜕𝑥 𝜕𝑦 2 𝜕𝑦𝜕𝑧
𝜕2𝐿 𝜕2𝐿 𝜕2𝐿 𝜕2𝐿
𝜕𝑧𝜕𝑙 𝜕𝑧𝜕𝑥 𝜕𝑧𝜕𝑦 𝜕𝑧 2
48
Solution
One critical point 𝑥 = 2, 𝑦 = 1, 𝑧 = 2 ⇒ 𝜆 = 2
Lagrangian function L
𝐿 𝑙; 𝑥, 𝑦, 𝑧 = 𝐴 𝑥, 𝑦, 𝑧 − 𝑙 𝑉 𝑥, 𝑦, 𝑧 − 4
= 2𝑥𝑦 + 2𝑦𝑧 + 𝑥𝑧 − 𝑙(𝑥𝑦𝑧 − 4)
0 −𝑦𝑧 −𝑥𝑧 −𝑥𝑦
−𝑦𝑧 0 2 − 𝑙𝑧 1 − 𝑙𝑦
𝐻𝐿 𝑙; 𝑥, 𝑦, 𝑧 = −𝑥𝑧
2 − 𝑙𝑧 0 2 − 𝑙𝑥
−𝑥𝑦 1 − 𝑙𝑦 2 − 𝑙𝑥 0
0 −2 −4 −2
𝐻𝐿 2; 2,1,2 = −2 0 −2 −1
−4 −2 0 −2
−2 −1 −2 0
(–1)kh2k+1=?
0 −2 −4
(−1)1 det 𝐻2 1 +1 = −1 det −2 0 −2 = 32
−4 −2 0 49
Solution
0 −2 −4 −2
𝐻𝐿 2; 2,1,2 = −2 0 −2 −1
−4 −2 0 −2
−2 −1 −2 0
(–1)kh2k+1=?
𝑘 = 1, 𝑛 = 3 ⇒
0 −2 −4
(−1)1 det 𝐻2 1 +1 = −1 det −2 0 −2 = 32
−4 −2 0
0 −2 −4 −2
(−1)1 det 𝐻1+3 = −1 det −2 0 −2 −1 = 48
−4 −2 0 −2
−2 −1 −2 0
Since the sequence of (–1)kh2k+1 are both positive, the
critical point (2, 1, 2) indeed minimizes the area of the box
subject to the constant volume=4.
50
Exercise
a) Find the critical points of 𝑓 𝑥, 𝑦 = 𝑥 2 + 𝑦, subject to the
constrain 𝑥 2 + 2𝑦 2 = 1
b) Use the Hessian criterion to determine the nature of the critical
point.
51
Solution
a) Find the critical points of 𝑓 𝑥, 𝑦 = 𝑥 2 + 𝑦, subject to the constrain 𝑥 2
+ 2𝑦 2 = 1
Let 𝑔 𝑥, 𝑦 = 𝑥 2 + 2𝑦 2 = 1
∇𝑓 𝑥, 𝑦 = 𝜆∇𝑔 𝑥, 𝑦
2𝑥 = 2𝑥𝜆
ቐ 1 = 4𝑦𝜆
𝑥 2 + 2𝑦 2 = 1
From 1st eq. 𝑥 = 0 or 𝜆 = 1.
If 𝑥 = 0 ⇒ 𝑦 = ± 1/2
1
If 𝜆 = 1 ⇒ 𝑦 = ⇒ 𝑥 = ± 7/8
4
7 1
The critical points are ± , for 𝜆 = 1
8 4
1
and 0, ± for 𝜆 = 2/4
2 52
Solution
b) Use the Hessian criterion to determine the nature of the critical
2𝑥 = 2𝑥𝜆
point. ∇𝑓 𝑥, 𝑦 = 𝜆∇𝑔 𝑥, 𝑦 ⇒ ቐ 1 = 4𝑦𝜆
𝑥 2 + 2𝑦 2 = 1
7 1 1
Thus the critical points are ± , and 0, ±
8 4 2
𝐿 𝜆; 𝑥, 𝑦 = 𝑥 2 + 𝑦 − 𝜆 𝑥 2 + 2𝑦 2 − 1
𝜕2𝐿 𝜕2𝐿 𝜕2𝐿
𝜕𝜆2 𝜕𝜆𝜕𝑥 𝜕𝜆𝜕𝑦
𝜕2𝐿 𝜕2𝐿 𝜕2𝐿
𝐻𝐿 𝜆; 𝑥, 𝑦 =
𝜕𝑥𝜕𝜆 𝜕𝑥 2 𝜕𝑥𝜕𝑦
𝜕2𝐿 𝜕2𝐿 𝜕2𝐿
𝜕𝑦𝜕𝜆 𝜕𝑦𝜕𝑥 𝜕𝑦 2
53
Solution
b) Use the Hessian criterion to determine the nature of the critical
point.
𝐿 𝜆; 𝑥, 𝑦 = 𝑥 2 + 𝑦 − 𝜆 𝑥 2 + 2𝑦 2 − 1
𝜕2𝐿 𝜕2𝐿 𝜕2𝐿
𝜕𝜆2 𝜕𝜆𝜕𝑥 𝜕𝜆𝜕𝑦
𝜕2𝐿 𝜕2𝐿 𝜕2𝐿
𝐻𝐿 𝑙; 𝑥, 𝑦 =
𝜕𝑥𝜕𝜆 𝜕𝑥 2 𝜕𝑥𝜕𝑦
𝜕2𝐿 𝜕2𝐿 𝜕2𝐿
𝜕𝑦𝜕𝜆 𝜕𝑦𝜕𝑥 𝜕𝑦 2
0 −2𝑥 −4𝑦
𝐻𝐿 𝑙; 𝑥, 𝑦 = −2𝑥 2 − 2𝜆 0
−4𝑦 0 −4𝜆
54
Solution
b) Use the Hessian criterion to determine the nature of the critical
point.
0 −2𝑥 −4𝑦
𝐻𝐿 𝜆; 𝑥, 𝑦 = −2𝑥 2 − 2𝜆 0
−4𝑦 0 −4𝜆
(–1)kh2k+1=?
𝑘 = 1, 𝑛 = 2 ⇒ (−1)h3 = −[16𝜆𝑥 2 − 32𝑦 2 + 32𝜆𝑦 2 ]
7 1
At ± , for 𝜆 = 1
8 4
56
Applications of Gradient
➢ Directional Derivatives
➢ Critical points
➢ Spherical gradient, Gradient field and
potential
➢ Lagrange Multiplier
➢ Normal Vector
57
Normal Vector
58
Applications of gradient
59
Level Curves
➢ The level curves of a scalar field Φ(x,y) are
defined by the equation Φ(x,y) = k , where k
is real, constant and in the range of Φ(x,y)
60
Level Surface
● 2D: Level Curve → 3D: Level Surface
● The level surfaces of a scalar field Φ(x,y,z) are
defined by the equation Φ(x,y,z) = k , where k is
real, constant and in the range of Φ(x,y,z)
● The gradient Φ(x0,y0,z0) is perpendicular to the
level surface Φ(x,y,z) = k at the point (x0,y0,z0)
→ The gradient can be used to construct a normal
vector to a surface at a given point
61
Normal Vector
63
Normal vector to surface
Method steps:
1) Convert surface formula 𝑓 𝑥, 𝑦 = 𝑧 into
scalar field
Φ 𝑥, 𝑦, 𝑧 = 𝑓 𝑥, 𝑦 − 𝑧
→ Φ 𝑥, 𝑦, 𝑧 = 0 – level surface
2 2 2
𝐹 𝒓 = 𝑥 + 𝑦 + 𝑧 = 𝑐(> 0)
65
Exercise
66
Solution
68
Solution
𝛻𝐹 𝑥, 𝑦, 𝑧 𝛻𝐹 𝑥, 𝑦, 𝑧 =?
ෝ=
𝒏
𝛻𝐹 𝑥, 𝑦, 𝑧
70
Solution
Find normal vector to the surface
𝑒 𝑥𝑦 + 𝑒 𝑥𝑧 − 2𝑒 𝑦𝑧 = 0
at point 𝑥0 , 𝑦0 , 𝑧0 = (−1, −1, −1)
𝛻𝐹 𝑥, 𝑦, 𝑧
ෝ=
𝒏
𝛻𝐹 𝑥, 𝑦, 𝑧 𝛻𝐹 𝑥, 𝑦, 𝑧 =?
𝛻𝐹 𝑥, 𝑦, 𝑧 = 𝑦𝑒 𝑥𝑦 + 𝑧𝑒 𝑥𝑧 , 𝑥𝑒 𝑥𝑦 − 2𝑧𝑒 𝑦𝑧 , 𝑥𝑒 𝑥𝑧 − 2𝑦𝑒 𝑦𝑧
𝛻𝐹 −1, −1, −1 =?
𝛻𝐹 −1, −1, −1 = 𝑒(−2,1,1)
ෝ −1, −1, −1 =?
𝒏
𝑒(−2,1,1) (−2,1,1)
ෝ −1, −1, −1 =
𝒏 = 71
𝑒 6 6
Exercise
Find the normal vector of surface
𝑧 𝑥, 𝑦 = cos 2 𝑥 + sin 𝑥 + cos 𝑦
at a point (𝑥 = 0, 𝑦 = 0 )
72
Solution
Find the normal vector of surface
𝑧 𝑥, 𝑦 = cos2 𝑥 + sin 𝑥 + cos 𝑦
at a point (x=0,y=0) 𝑧 =? 𝑧 = 2
1) Convert surface formula 𝑓 𝑥, 𝑦 = 𝑧 into scalar field
Φ 𝑥, 𝑦, 𝑧 = 𝑓 𝑥, 𝑦 − 𝑧
→ Φ 𝑥, 𝑦, 𝑧 = 0 – level surface
Φ 𝑥, 𝑦, 𝑧 = cos 2 𝑥 + sin 𝑥 + cos 𝑦 − 𝑧
to which Φ 𝑥, 𝑦, 𝑧 = 0 is a level surface
2) Calculate the gradients of the scalar field
−2cos 𝑥 sin 𝑥 + cos 𝑥
𝛻Φ 𝑥, 𝑦, 𝑧 = −sin 𝑦
−1
The gradient of Ф(x,y,z) is perpendicular to the surface 73
Solution
The gradient of Ф(x,y,z) is perpendicular to the surface:
−2cos 𝑥 sin 𝑥 + cos 𝑥
𝛻Φ 𝑥, 𝑦, 𝑧 = −sin 𝑦
−1
3) Insert the point at which the normal vector is to be
calculated into the gradient formula
75
Solution
Steps:
Calculate the angle between
the red and the blue surface at point P: 1) Convert surface formula
red: 𝑧 = 2𝑥 2 − 𝑦
1 𝑓 𝑥, 𝑦 = 𝑧 into scalar field
blue: 𝑧 = −𝑥 4 − 2𝑦 2 + 4 , 𝑃 = 1
1 Φ 𝑥, 𝑦, 𝑧 = 𝑓 𝑥, 𝑦 − 𝑧
2) Calculate the gradients of the
scalar fields from both surfaces
3) Insert the point at which the
angle is to be calculated into the
gradient formulas
4) Calculate angle by dot-
product
76
Solution
Step 1: Φ𝑟 = 2𝑥 2 − 𝑦 − 𝑧 , Φ𝑏 = −𝑥 4 − 2𝑦 2 + 4 − 𝑧
Step 2:
4𝑥 −4𝑥 3
𝛻Φ𝑟 = −1 𝛻Φ𝑏 = −4𝑦 Step 3:
−1 −1 P: x= 1 , y=1 , z=1
4 −4
𝐴𝑟 = −1 𝐴𝑏 = −4
−1 −1
Step 4:
Θ −16 + 4 + 1
= arccos
𝐴𝑟 ⋅ 𝐴𝑏 18 33
= arccos −11
𝐴𝑟 𝐴𝑏 = arccos
594
= 116.83𝑑𝑒𝑔 77
Solution The angle between
Θ = arccos
𝐴𝑟 ⋅𝐴𝑏
= 116.83𝑑𝑒𝑔 surfaces can not be
𝐴𝑟 𝐴𝑏 larger than 90 deg
(unless we define the
4 surfaces to have a
Ԧ𝑏 = 4
𝐴′ Take the negative of
preferential side ! ) –
1 one normal vector
the gradient gives us
one normal vector of
𝐴 𝑟 ⋅ Ԧ𝑏
𝐴′ 16 − 4 − 1 the two possible ones
′
Θ = arccos = arccos
Ԧ𝑏
𝐴𝑟 𝐴′ 18 33
11
= arccos = 63.17𝑑𝑒𝑔
594
Θ′ = 180𝑑𝑒𝑔 − Θ Subtract from
= 180.0 − 116.83 𝑑𝑒𝑔 180 deg to get
= 63.17𝑑𝑒𝑔 actual angle78
Implicit and Explicit Representation of
Surfaces
● Implicit: ● Explicit:
𝑓 𝑥, 𝑦, 𝑧 = 0 𝑓 𝑥, 𝑦 = 𝑧
79
Parametric Representation of Surfaces
𝑅 𝑢 = 𝑅1 𝑢 𝑖Ԧ + 𝑅2 𝑢 𝑗Ԧ + 𝑅3 𝑢 𝑘
𝑅 𝑢, 𝑣 = 𝑅1 𝑢, 𝑣 𝑖Ԧ + 𝑅2 𝑢, 𝑣 𝑗Ԧ + 𝑅3 𝑢, 𝑣 𝑘
80
Example
Sphere (radius r): One possible parametrization, many more exist
sin 𝑢 cos 𝑣
0≤𝑢≤π
– parametric: 𝑅 𝑢, 𝑣 = 𝑟 sin 𝑢 sin 𝑣
0 ≤ 𝑣 ≤ 2π
cos 𝑢
– implicit: 𝑥2 + 𝑦2 + 𝑧2 − 𝑟2 = 0
– explicit:
● not possible for the whole sphere
● for the upper half only: 𝑧= 𝑟2 − 𝑥2 − 𝑦2
81
Example
Paraboloid:
– explicit: 𝑧 = 𝑎𝑥 2 + 𝑏𝑦 2 + 𝑐
– implicit: 𝑎𝑥 2 + 𝑏𝑦 2 + 𝑐 − 𝑧 = 0
𝑢
– parametric: 𝑅 𝑢, 𝑣 = 𝑣
𝑎𝑢2 + 𝑏𝑣 2 + 𝑐
One possible parametrization, many more exist
82
Normal Vector to Parametrized Surfaces
The partial derivatives with respect to the parameters of the
surface are tangent vectors to the surface:
𝜕𝑅1 𝜕𝑅2 𝜕𝑅3 𝜕𝑅1 𝜕𝑅2 𝜕𝑅3
𝑅𝑢 = 𝑖Ԧ + 𝑗Ԧ + 𝑘, 𝑅𝑣 = 𝑖Ԧ + 𝑗Ԧ + 𝑘
𝜕𝑢 𝜕𝑢 𝜕𝑢 𝜕𝑣 𝜕𝑣 𝜕𝑣
They are base vectors of the tangent plane to the surface
From these two vectors, the normal vector to the surface can be
constructed by the cross-product:
𝑁1 𝑢, 𝑣 = 𝑅𝑢 𝑢, 𝑣 × 𝑅𝑣 𝑢, 𝑣
𝑁2 𝑢, 𝑣 = −𝑁1 𝑢, 𝑣 = 𝑅𝑣 𝑢, 𝑣 × 𝑅𝑢 𝑢, 𝑣
The sign is arbitrary and depends on the parametrization
For closed or convex surfaces, the outer side is usually
regarded as the positive normal vector direction
83
Exercise
Find the normal vector to the paraboloid parametrized by
𝑣cos 𝑢
0 ≤ 𝑢 ≤ 2π
𝑅 𝑢, 𝑣 = 𝑣sin 𝑢 ,
2
0≤𝑣≤1
𝑣
at point (𝑥 = 1, 𝑦 = 0, 𝑧 = 1)
84
Solution
Find the normal vector to the paraboloid parametrized by
𝑣cos 𝑢
0 ≤ 𝑢 ≤ 2π
𝑅 𝑢, 𝑣 = 𝑣sin 𝑢 ,
2
0≤𝑣≤1
𝑣
at point (𝑥 = 1, 𝑦 = 0, 𝑧 = 1)
−𝑣sin 𝑢 cos 𝑢
Tangent vectors: 𝑅𝑢 = 𝑅𝑣 = sin 𝑢
𝑣cos 𝑢
0 2𝑣
are base vectors of the tangent plane to the surface. The normal
vector to the surface
𝑖Ԧ 𝑗Ԧ 𝑘 2𝑣 2 cos 𝑢
𝑅𝑢 × 𝑅𝑣= −𝑣sin 𝑢 𝑣cos 𝑢 0 = 2𝑣 2 sin 𝑢
cos 𝑢 sin 𝑢 2𝑣 −𝑣sin2 𝑢 − 𝑣cos2 𝑢
2𝑣 2 cos 𝑢
= 2𝑣 2 sin 𝑢
85
−𝑣
Solution
Find the normal vector to the paraboloid parametrized by
𝑣cos 𝑢
0 ≤ 𝑢 ≤ 2π
𝑅 𝑢, 𝑣 = 𝑣sin 𝑢 ,
2
0≤𝑣≤1
𝑣
at point (𝑥 = 1, 𝑦 = 0, 𝑧 = 1)
−𝑣sin 𝑢 cos 𝑢
Tangent vectors: 𝑅𝑢 = 𝑣cos 𝑢 , 𝑅𝑣 = sin 𝑢
2𝑣 2 cos 𝑢 0 2𝑣
𝑅𝑢 × 𝑅𝑣 = 2𝑣 2 sin 𝑢
−𝑣
At point (𝑥 = 1, 𝑦 = 0, 𝑧 = 1), → 𝑧 = 1 = 𝑣 2𝑣=1
→ 𝑥 = 1 = 𝑣cos 𝑢 = cos 𝑢 , 𝑢=0
2
𝑁 𝑥 = 1, 𝑦 = 0, 𝑧 = 1 = 𝑁 𝑢 = 0, 𝑣 = 1 = 0
Normal vector at an example point −1 86
Exercise
Calculating the Angle between a Line
(Vector) and a Surface