Professional Documents
Culture Documents
Gradient and Directional Derivatives
Gradient and Directional Derivatives
Chapter 7
Gradient and
Directional
Derivatives
At the end of this module, students should be able to:
Define and evaluate gradient of function
Define directional derivatives
Evaluate directional derivatives
Evaluate directional derivatives using gradient
7.1 Introduction
x-direction (i.e. slope parallel to x-axis) and f y is the slope of f in the positive
y-direction (i.e. slope parallel to y-axis). In this module we are going to learn
to find slopes at other directions often called as directional derivatives. There
are several ways to evaluate directional derivatives in which one is of the
methods is by using gradient vectors.
89
Part 1 PARTIAL DERIVATIVES MAT 295
Definition
Let z f ( x, y ) be a function of x and y such that f x and f y exists. Then the
y
x
(x,y)
Figure 7.1
Steps : Gradient
Identify f ( x, y )
Find f x and fy
Write gradient as f ( x, y ) f x , fy
Example 1
Solution
Identify f ( x, y )
f ( x, y ) 2x 2 y 3y
Find f x and f y
90
Part 1 PARTIAL DERIVATIVES MAT 295
f x ( x, y ) 4xy ,
fy ( x, y ) 2x 2 3
Example 2
Solution
Identify f ( x, y )
f ( x, y ) y ln x xy 2
Find f x and f y
y
f x ( x, y ) y2 , fy ( x, y ) ln x 2xy
x
Find the gradient of f at any point
f ( x, y ) f x ( x, y )i fy ( x, y ) j
y
f ( x, y ) ( y 2 ) i (ln x 2 xy ) j
x
y
y 2 , ln x 2 xy
x
Evaluate the gradient of f at the point (1,3)
f (1, 2) f x (1, 3) i fy (1,3) j
3
f (1, 2) ( 3 2 ) i (ln 1 (2)(1)(3)) j
1
12 i 6 j or 12 , 6
91
Part 1 PARTIAL DERIVATIVES MAT 295
Warm up exercise
3 3
Let f ( x, y ) 3y x y 3x .
Definition
The directional derivative of f ( x, y ) at the point (a, b) and in the direction of
u u1, u2 is given by
f (a hu1, b hu 2 )
Du f (a, b) lim
h 0 h
Note that Du f ( x, y ) is a constant value (representing a slope). In fact, the
directional derivative is the same as a partial derivative if u points in the
positive x or positive y direction.
z
y
x u
Figure 7.2
92
Part 1 PARTIAL DERIVATIVES MAT 295
Theorem
Directional derivative
If f is a differentiable function of x and y, then the directional derivative of f in
the direction of the unit vector u cos i sin j (or u cos , sin ) is
Du f ( x, y ) fx ( x, y ) cos fy ( x, y ) sin
Theorem
Directional derivative
If f is a differentiable function of x and y, then f has a directional derivative in
the direction of any unit vector u a i b j (or, u a, b ) and
Du f ( x, y ) f ( x, y ) uˆ
f x ( x, y ), f y ( x, y ) a, b
f x ( x, y ).a fy ( x, y ).b
In this case, the directional derivative is calculated by taking the dot product of
the gradient vector of f and the unit vector in the direction or parallel to the
slope needed.
Identify f ( x, y )
Compute the gradient f ( x, y )
Identify direction v
Compute magnitude v : v
v
Compute unit vector u
v
Compute directional derivative : u f
93
Part 1 PARTIAL DERIVATIVES MAT 295
Example 3
y2
Let f ( x, y ) 4 x 2 . Find the directional derivative of f at (1,2) in the
4
direction of the unit vector u cos , sin .
3 3
Solution
Find f x and fy
y
f x ( x, y ) 2x , f y ( x, y )
2
Find the directional derivative of f at point (1,2) in the direction of the
unit vector u
Du f ( x, y ) f x ( x, y ) cos fy ( x, y ) sin
y
( 2x ) cos ( ) sin
3 2 3
Thus, 6 2
3
Du f (1,2) f x (1,2) cos fy (1,2) sin
3
2 1
( 2)(1) cos ( ) sin
3 2 3
1 3
( 2) ( 1)
2 2
1.866
Example 4
Solution
Find f x and fy
f x ( x, y ) 3 x 2 y , fy ( x, y ) x 3
Since the direction is not given in the form of a unit vector, then we
need to find the unit vector u in the same direction as v
94
Part 1 PARTIAL DERIVATIVES MAT 295
v 1
u 1,3
v 12 3 2
1 3
,
10 10
Example 5
Solution
Find f x and f y
f x ( x, y ) 2x 3 , fy ( x, y ) 4y
95
Part 1 PARTIAL DERIVATIVES MAT 295
f (1,1) (2 1) i 4(1) j
i 4 j
1, 4
1 1
1,4 ,
2 2
1 1
( 1)( ) ( 4)( )
2 2
3
2.121
2
Example 6
Solution
Find f x and f y
f x ( x, y ) cos x ye xy , fy ( x, y ) xe xy
96
Part 1 PARTIAL DERIVATIVES MAT 295
v 1
u 3,4
v 3 2 ( 4)2
3 4
,
5 5
Example 7
Find the directional derivative of f ( x, y ) x 2 y 3y in the direction 4i 3 j
at the point (1, -1).
Solution
Identify f ( x, y )
f ( x, y ) x 2 y 3y
Compute the gradient f ( x, y )
f 2xy, x 2 3
Identify direction v
v 4, 3
Compute magnitude v : v
v 4 2 ( 3)2
16 9
25 5
v
Compute unit vector u
v
1
u 4, 3
5
Compute directional derivative
97
Part 1 PARTIAL DERIVATIVES MAT 295
Du f ( x, y ) u f
1
4, 5 2 xy, x 2 3
5
1
4(2 xy ) 5( x 2 3
5
1
5 x 2 8 xy 15
5
Directional derivative at (1, -1)
Du f (1,1) 5 8(1)(1) 15
1
5
12
5
Example 8
Solution
Identify f ( x, y )
f ( x, y ) 3x 2 3y 2
f ( x, y ) 6x, 6y
Identify direction v
v j 0,1
Compute magnitude v
v 1
98
Part 1 PARTIAL DERIVATIVES MAT 295
Example 9
direction given by the angle .
4
Solution
f ( x, y ) 2xy 3 , 3 x 2 y 2 4y 3
while the unit vector u is
u cos i sin j
4 4
1 1
, .
2 2
4 2
1
4
1
1 1
point (1, 2) in the direction of v cos , sin or v , .
4 4 2 2
99
Part 1 PARTIAL DERIVATIVES MAT 295
Warm up exercise
Let f ( x, y ) x 3 3xy 4y 2 at the point (1, 2) in the direction of
(a) (b) 3, 4
6
(i) Compute the gradient f ( x, y ) .
(ii) Identify the direction.
(iii) Compute the magnitude of the direction vector.
(iv) Compute the unit vector.
(v) Compute the directional derivative.
Exercise 7
a) f ( x, y ) sin x e xy at (0, 1)
b) f ( x, y ) x 2 y 3 4y at (2, -1)
c) f ( x, y ) x 2 y 2 z 2 at (1, 4, 2)
100
Part 1 PARTIAL DERIVATIVES MAT 295
a) the y-axis
b) PQ where Q is (4,5).
4. Compute Du f (2,1) , where u is a unit vector in the direction of the vector
v 1, 3 and f ( x, y ) x 4 x 2 y 3 .
y t
5. Find the directional derivatives of f ( x, y , t ) t at (2,1,-1) in the direction
xy
of v 3i j k .
x
7. Find the directional derivative of f ( x, y ) in the direction of
xy
u cos i sin j when .
6
101