Three-Dimensional Gradients and Directional Derivatives

Learning Objectives

  • Calculate directional derivatives and gradients in three dimensions.

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 fxfy, and fz exist. The vector f(x,y,z) is called the gradient of f and is defined as

f(x,y,z)=fx(x,y,z)i+fy(x,y,z)j+fz(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 fxfy, and fz, and then we use the Equation for f(x,y,z).

Example: finding gradients in three dimensions

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

a. f(x,y,z)=5x22xy+y24yz+z2+3xz

b. f(x,y,z)=e2zsin2xcos2y

Try it

Find the gradient f(x,y,z) of f(x,y,z)=x23y2+z22x+y4z.

Watch the following video to see the worked solution to the above Try It

>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 zaxes. 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 cos2α+cos2β+cos2γ=1.

Definition


Suppose w=f(x,y,z) is a function of three variables with a domain of D, Let (x0,y0,z0)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

Duf(x0,y0,z0)=limt0f(x0+tcosα,y0+tcosβ,z0+tcosγ)f(x0,y0,z0)t,

providing 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 the dot product definition of the Directional Derivative of a Function of Two Variables.

Theorem: 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

[latex]\hspace{6cm}\begin{align}

D_{\bf{u}}f(x,y,z)&=\nabla{f}(x,y,z)\cdot{\bf{u}} \\ &=f_x(x,y,z)\cos\alpha+f_y(x,y,z)\cos\beta+f_z(x,y,z)\cos\gamma. \end{align}[/latex]

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.

Example: finding a directional derivative in three dimensions

Calculate Duf(1,2,3) in the direction of v=i+2j+2k for the function

f(x,y,z)=5x22xy+y24yz+z2+3xz.

Try it

Calculate Duf(x,y,z) and Duf(0,2,5) in the direction of v=3i+12j4k for the function f(x,y,z)=3x2+xy2y2+4yzz2+2xz.

Watch the following video to see the worked solution to the above Try It