<< Chapter < Page Chapter >> Page >

Three-dimensional gradients and directional derivatives

The definition of a gradient can be extended to functions of more than two variables.

Definition

Let w = f ( x , y , z ) be a function of three variables such that f x , f y , and f z exist. The vector f ( x , y , z ) is called the gradient of f and is defined as

f ( x , y , z ) = f x ( x , y , z ) i + f y ( x , y , z ) j + f z ( x , y , z ) k .

f ( x , y , z ) can also be written as grad f ( x , y , z ) .

Calculating the gradient of a function in three variables is very similar to calculating the gradient of a function in two variables. First, we calculate the partial derivatives f x , f y , and f z , and then we use [link] .

Finding gradients in three dimensions

Find the gradient f ( x , y , z ) of each of the following functions:

  1. f ( x , y ) = 5 x 2 2 x y + y 2 4 y z + z 2 + 3 x z
  2. f ( x , y , z ) = e −2 z sin 2 x cos 2 y

For both parts a. and b., we first calculate the partial derivatives f x , f y , and f z , then use [link] .


  1. f z ( x , y , z ) = 10 x 2 y + 3 z , f y ( x , y , z ) = −2 x + 2 y 4 z and f z ( x , y , z ) = 3 x 4 y + 2 z , so f ( x , y , z ) = f x ( x , y , z ) i + f y ( x , y , z ) j + f z ( x , y , z ) k = ( 10 x 2 y + 3 z ) i + ( −2 x + 2 y 4 z ) j + ( −4 x + 3 y + 2 z ) k .

  2. f x ( x , y , z ) = −2 e −2 z cos 2 x cos 2 y , f y ( x , y , z ) = −2 e −2 z sin 2 x sin 2 y and f z ( x , y , z ) = −2 e −2 z sin 2 x cos 2 y , so f ( x , y , z ) = f x ( x , y , z ) i + f y ( x , y , z ) j + f z ( x , y , z ) k = ( 2 e −2 z cos 2 x cos 2 y ) i + ( −2 e −2 z ) j + ( −2 e −2 z ) = 2 e −2 z ( cos 2 x cos 2 y i sin 2 x sin 2 y j sin 2 x cos 2 y k ) .
Got questions? Get instant answers now!
Got questions? Get instant answers now!

Find the gradient f ( x , y , z ) of f ( x , y , z ) = x 2 3 y 2 + z 2 2 x + y 4 z .

f ( x , y , z ) = 2 x 2 + 2 x y + 6 y 2 8 x z 2 z 2 ( 2 x + y 4 z ) 2 i x 2 + 12 x y + 3 y 2 24 y z + z 2 ( 2 x + y 4 z ) 2 j + 4 x 2 12 y 2 4 z 2 + 4 x z + 2 y z ( 2 x + y 4 z ) 2 k .

Got questions? Get instant answers now!

The directional derivative can also be generalized to functions of three variables. To determine a direction in three dimensions, a vector with three components is needed. This vector is a unit vector, and the components of the unit vector are called directional cosines . Given a three-dimensional unit vector u in standard form (i.e., the initial point is at the origin), this vector forms three different angles with the positive x , y , and z- axes. Let’s call these angles α , β , and γ . Then the directional cosines are given by cos α , cos β , and cos γ . These are the components of the unit vector u ; since u is a unit vector, it is true that cos 2 α + cos 2 β + cos 2 γ = 1 .

Definition

Suppose w = f ( x , y , z ) is a function of three variables with a domain of D . Let ( x 0 , y 0 , z 0 ) D and let u = cos α i + cos β j + cos γ k be a unit vector. Then, the directional derivative of f in the direction of u is given by

D u f ( x 0 , y 0 , z 0 ) = lim t 0 f ( x 0 + t cos α , y 0 + t cos β , z 0 + t cos γ ) f ( x 0 , y 0 , z 0 ) t ,

provided the limit exists.

We can calculate the directional derivative of a function of three variables by using the gradient, leading to a formula that is analogous to [link] .

Directional derivative of a function of three variables

Let f ( x , y , z ) be a differentiable function of three variables and let u = cos α i + cos β j + cos γ k be a unit vector. Then, the directional derivative of f in the direction of u is given by

D u f ( x , y , z ) = f ( x , y , z ) · u = f x ( x , y , z ) cos α + f y ( x , y , z ) cos β + f z ( x , y , z ) cos γ .

The three angles α , β , and γ determine the unit vector u . In practice, we can use an arbitrary (nonunit) vector, then divide by its magnitude to obtain a unit vector in the desired direction.

Finding a directional derivative in three dimensions

Calculate D u f ( 1 , −2 , 3 ) in the direction of v = i + 2 j + 2 k for the function

f ( x , y , z ) = 5 x 2 2 x y + y 2 4 y z + z 2 + 3 x z .

First, we find the magnitude of v :

v = ( −1 ) 2 + ( 2 ) 2 = 3 .

Therefore, v v = i + 2 j + 2 k 3 = 1 3 i + 2 3 j + 2 3 k is a unit vector in the direction of v , so cos α = 1 3 , cos β = 2 3 , and cos γ = 2 3 . Next, we calculate the partial derivatives of f :

f x ( x , y , z ) = 10 x 2 y + 3 z f y ( x , y , z ) = −2 x + 2 y 4 z f z ( x , y , z ) = −4 y + 2 z + 3 x ,

then substitute them into [link] :

D u f ( x , y , z ) = f x ( x , y , z ) cos α + f y ( x , y , z ) cos β + f z ( x , y , z ) cos γ = ( 10 x 2 y + 3 z ) ( 1 3 ) + ( −2 x + 2 y 4 z ) ( 2 3 ) + ( −4 y + 2 z + 3 x ) ( 2 3 ) = 10 x 3 + 2 y 3 3 z 3 4 x 3 + 4 y 3 8 z 3 8 y 3 + 4 z 3 + 6 x 3 = 8 x 3 2 y 3 7 z 3 .

Last, to find D u f ( 1 , −2 , 3 ) , we substitute x = 1 , y = −2 , and z = 3 :

D u f ( 1 , −2 , 3 ) = 8 ( 1 ) 3 2 ( −2 ) 3 7 ( 3 ) 3 = 8 3 + 4 3 21 3 = 25 3 .
Got questions? Get instant answers now!
Got questions? Get instant answers now!
Practice Key Terms 2

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Calculus volume 3. OpenStax CNX. Feb 05, 2016 Download for free at http://legacy.cnx.org/content/col11966/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Calculus volume 3' conversation and receive update notifications?

Ask