1 Directional Derivatives and The Gradient Vector
1 Directional Derivatives and The Gradient Vector
1 Directional Derivatives and The Gradient Vector
Directional Derivatives
We want the rate of change of z at (x0 , y0 ) in the
direction of an unit vector u = ⟨a, b⟩.
Consider the surface S of z = f (x, y), the verti-
cal plane that passes through P (x0 , y0 , z0 ) in the
direction of u intersects S a curve C.
The slope of tangent line T to C at P is what we
need.
If Q(x, y, z) is another point on C and P ′ , Q′ are the projections of P, Q onto the xy-plane, then the vector
# ′ »′
P Q is parallel to u,
# »
P ′ Q′ = hu = ⟨ha, hb⟩
f (x, y) = x3 − 3xy + 4y 2
1
The Gradient Vector
Definition : Gradient
∂f ∂f
∇f (x, y) = ⟨fx (x, y), fy (x, y)⟩ = i+ j
∂x ∂y
v 2 5
The unit vector in the direction of v is u = = √ i+ √ j
|v| 29 29
Therefore we have
!
2 5
Du f (2, −1) = ∇f (2, −1) · u = (−4i + 8j) · √ i+ √ j
29 29
−4·2+8·5 32
= √ =√
29 29
+ EXAMPLE. If f (x, y, z) = x sin yz, (a) find ∇f and (b) find Du f (1, 3, 0) in the direction of v = i + 2j − k.
SOLUTION.
∇f = sin yz · i + xz cos yz · j + xy cos xz · k
The unit vector in the direction of v is
1 2 1
u= √ i+ √ j− √ k
6 6 6
Therefore
Du = ∇f (1, 3, 0) · u
1 2 1
= 3k · √ i + √ j − √ k
6 6 6
s
3
=−
2
2
1.1 Maximizing the Directional Derivative
The maximum value of Du f (x) is |∇f (x)|, when u has the same direction as the gradient vector ∇f (x).
+ EXAMPLE.
(a) If f (x, y) = xey , find the rate of change of f at P (2, 0) in the direction
from P to Q( 21 , 2).
(b) In what direction, f has max Du f and what’s it?
SOLUTION.
(a)
3 4
Du f (2, 0) = ∇f (2, 0) · u = ⟨1, 2⟩ · − ,
5 5
3 4
=1 − +2 =1
5 5
∇F (x0 , y0 , z0 ) · r′ (t0 ) = 0
We see that the gradient vector ∇F (x0 , y0 , z0 ) is perpendicular to the tangent vector to any curve C on
S that pass through P .
The normal line to S at P is the line passing through P and perpendicular to the tangent plane. The
direction of it is given by ∇F (x0 , y0 , z0 ) and its symmetric equation*s are
x − x0 y − y0 z − z0
= =
Fx (x0 , y0 , z0 ) Fy (x0 , y0 , z0 ) Fz (x0 , y0 , z0 )
+ EXAMPLE. Find the tangent plane and normal line at (−2, 1, −3) to the ellipsoid
x2 z2
+ y2 + =3
4 9
SOLUTION. The ellipsoid is the level surface (k = 3) of the function
x2 z2
F (x, y, z) = + y2 +
4 9
Therefore we have
x 2z
Fx (x, y, z) = Fy (x, y, z) = 2y Fz (x, y, z) =
2 9
2
Fx (−2, 1, −3) = −1 Fy (−2, 1, −3) = 2 Fz (−2, 1, −3) = −
3
3
The equation of the tangent plane at (-2, 1, -3) is
2
−1(x + 2) + 2(y − 1) − (z + 3) = 0
3
The symmetric equations of the normal line are
If we put fx (a, b) = 0 and fy (a, b) = 0 in the equation of a tangent plane, we get z = z0 . So the tangent
plane at a local extrema must be horizontal. A point (a, b) is a critical point (or stationary point) of f if
fx (a, b) = fy (a, b) = 0, or if one of these does not exist.
fx (x, y) = 2x − 2 fy (x, y) = 2y − 6
4
+ EXAMPLE. Find the local maximum and minimum ad saddle points of
f (x, y) = x4 + y 4 − 4xy + 1.
First we have
fx = 4x3 − 4y fy = 4y 3 − 4x
x3 − y = 0 y3 − x = 0
Since D(0, 0) = −16 < 0, it follows that (0,0) is a saddle point. And
D(1, 1) = 128 > 0, fxx (1, 1) = 12 > 0, so it’s a local minimum. Similarly,
(−1, −1) is a local minimum.
+ EXAMPLE. Find the shortest distance from (1, 0, −2) to the plane x + 2y + z = 4.
fx = 4x + 4y − 14 = 0
fy = 4x + 10y − 24 = 0
11 5
we find that the only critical point is 6 , 3 . Since fxx = 4, fxy = 4, fyy = 10, D(x, y) = fxx fyy − (fxy )2 =
11 5
24 > 0, so f has a local minimum at 6 , 3 . There must be a point on the given plane that is closest to
√
(1,0,-2). We also find that d = 56 6.
If f is continuous on a closed, bounded set D ∈ R2 then f attains an absolute maximum value f (x1 , y1 )
and an absolute minimum value f (x2 , y2 ). To find it,
1. Find the values of f at the critical points of f in D.
2. Find the extreme values of f on the boundary of D.
3. Determine the largest and smallest ones.
+ EXAMPLE. Find the absolute maximum and minimum of f (x, y) = x2 − 2xy + 2y on the rectangle
D = {(x, y)| 0 ≤ x ≤ 3, 0 ≤ y ≤ 2}.
Since f is a polynominal, it’s continuous on D. First find the critical points
fx = 2x − 2y = 0 fy = −2x + 2 = 0
Now we look at the values of f on the boundary of D, which consists of the four line segments L1 , L2 , L3 , L4 .
5
■ On L1 , we have y = 0 and
f (x, 0) = x2 0≤x≤3
f (3, y) = 9 − 4y 0≤y≤2
f (0, y) = 2y 0≤y≤2
Lagrange Multipliers
We will discover Lagrange’s methods for maximizing or minimizing a
general function f (x, y, z) to a constraint (or side contidition) of the
form g(x, y, z) = k.
To find the maximum and minimum values of f (x, y, z) to the constraint g(x, y, z) = k (assume they
exist and ∇g ̸= 0 on the surface g(x, y, z) = k):
(a) Find all x, y, z and λ (Lagrange multiplier) such that
∇f (x, y, z) = λ∇g(x, y, z)
g(x, y, z) = k
(b) Evaluate f at all these points and find the largest and smallest ones.
SOLUTION. We wish to maximize V = xyz, where x, y, z are the length, width and height of the box,
subject to the constraint
g(x, y, z) = 2xz + 2yz + xy = 12
Vx = λgx
Vy = λgy
Vz = λgz
2xz + 2yz + xy = 12
6
which become
yz = λ(2z + y)
xz = λ(2z + x)
xy = λ(2x + 2y)
2xz + 2yz + xy = 12
Observe that λ ̸= 0, and we have 2xz + xy = 2yz + xy which gives xz = yz. But z ̸= 0, or V = 0. So x = y.
We also have x = y = 2z.
4z 2 + 4z 2 + 4z 2 = 12
■ x = 0, then y = ±1.
■ λ = 1, then y = 0, and x = ±1.
Evaluating f at these 4 points, we find that fmax = f (0, ±1) = 2 and
fmin = f (±1, 0) = 1.
+ EXAMPLE. Find the points on the sphere x2 + y 2 + z 2 = 4 that are closest and farthest from (3, 1, −1).
The constraint is that the point (x, y, z) lies on the sphere, that is
g(x, y, z) = x2 + y 2 + z 2 = 4
2(x − 3) = 2xλ
2(y − 1) = 2yλ
2(z + 1) = 2zλ
x + y2 + z2 = 4
2
3 1 1
Hence, we got x = ,y = ,z = − . Then we have
1−λ 1−λ 1−λ
32 12 (−1)2
+ + =4
(1 − λ)2 (1 − λ)2 (1 − λ)2
7
√
11
which gives λ = 1 ± , which give the corresponding (x, y, z)
2
! !
6 2 2 6 2 2
√ , √ , −√ and −√ , −√ , √
11 11 11 11 11 11
Two Constraints
We want to find the maximum and minimum values of f (x, y, z) subject to 2 constraints of the form
g(x, y, z) = k and g(x, y, z) = c. Geometrically, we are looking for the extreme values of f when (x, y, z) lies
on the curve of intersection C of g and h.
Solving 5 equations
fx = λgx + µhx
fy = λgy + µhy
fz = λgz + µhz
g(x, y, z) = k
h(x, y, z) = c
+ EXAMPLE. Find the maximum value of f (x, y, z) = x + 2y + 3z on the curve of intersection of the plane
x − y + z = 1 and the cylinder x2 + y 2 = 1.
1 = λ + 2xµ
2 = −λ + 2yµ
3=λ
x−y+z =1
x2 + y 2 = 1
1 25
+ =1
µ2 4µ2
√ √ √ √
and so µ = ± 229 . Then x = ∓2/ 29, y = ±5/ 29, z = 1 ± 7/ 29.
√
The corresponding values of f are 3 ± 29. The maximum value of f on
√
the given curve is 3 + 29.