Differentiation of Functions of Several Variables

26 Directional Derivatives and the Gradient

Learning Objectives

  • Determine the directional derivative in a given direction for a function of two variables.
  • Determine the gradient vector of a given real-valued function.
  • Explain the significance of the gradient vector with regard to direction of change along a surface.
  • Use the gradient to find the tangent to a level curve of a given function.
  • Calculate directional derivatives and gradients in three dimensions.

In Partial Derivatives we introduced the partial derivative. A function z=f\left(x,y\right) has two partial derivatives: \partial z\text{/}\partial x and \partial z\text{/}\partial y. These derivatives correspond to each of the independent variables and can be interpreted as instantaneous rates of change (that is, as slopes of a tangent line). For example, \partial z\text{/}\partial x represents the slope of a tangent line passing through a given point on the surface defined by z=f\left(x,y\right), assuming the tangent line is parallel to the x-axis. Similarly, \partial z\text{/}\partial y represents the slope of the tangent line parallel to the y\text{-axis.} Now we consider the possibility of a tangent line parallel to neither axis.

Directional Derivatives

We start with the graph of a surface defined by the equation z=f\left(x,y\right). Given a point \left(a,b\right) in the domain of f, we choose a direction to travel from that point. We measure the direction using an angle \theta , which is measured counterclockwise in the x, y-plane, starting at zero from the positive x-axis ((Figure)). The distance we travel is h and the direction we travel is given by the unit vector u=\left(\text{cos}\phantom{\rule{0.2em}{0ex}}\theta \right)i+\left(\text{sin}\phantom{\rule{0.2em}{0ex}}\theta \right)j. Therefore, the z-coordinate of the second point on the graph is given by z=f\left(a+h\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}\theta ,b+h\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}\theta \right).

Finding the directional derivative at a point on the graph of z=f\left(x,y\right). The slope of the black arrow on the graph indicates the value of the directional derivative at that point.

A shape in xyz space with point (a, b, f(a, b)). From the point, there is an arrow that represents the directional derivative. On the xy plane, the point (a, b) is marked and an angle of size θ is made between the projection of the directional derivative onto the plane and a line parallel to the x axis.

We can calculate the slope of the secant line by dividing the difference in z\text{-values} by the length of the line segment connecting the two points in the domain. The length of the line segment is h. Therefore, the slope of the secant line is

{m}_{\text{sec}}=\frac{f\left(a+h\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}\theta ,b+h\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}\theta \right)-f\left(a,b\right)}{h}.

To find the slope of the tangent line in the same direction, we take the limit as h approaches zero.

Definition

Suppose z=f\left(x,y\right) is a function of two variables with a domain of D. Let \left(a,b\right)\in D and define \text{u}=\text{cos}\phantom{\rule{0.2em}{0ex}}\theta i+\text{sin}\phantom{\rule{0.2em}{0ex}}\theta j. Then the directional derivative of f in the direction of u is given by

{D}_{u}f\left(a,b\right)=\underset{h\to 0}{\text{lim}}\frac{f\left(a+h\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}\theta ,b+h\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}\theta \right)-f\left(a,b\right)}{h},

provided the limit exists.

(Figure) provides a formal definition of the directional derivative that can be used in many cases to calculate a directional derivative.

Finding a Directional Derivative from the Definition

Let \theta =\text{arccos}\left(3\text{/}5\right). Find the directional derivative {D}_{u}f\left(x,y\right) of f\left(x,y\right)={x}^{2}-xy+3{y}^{2} in the direction of \text{u}=\left(\text{cos}\phantom{\rule{0.2em}{0ex}}\theta \right)i+\left(\text{sin}\phantom{\rule{0.2em}{0ex}}\theta \right)j. What is {D}_{u}f\left(-1,2\right)?

First of all, since \text{cos}\phantom{\rule{0.2em}{0ex}}\theta =3\text{/}5 and \theta is acute, this implies

\text{sin}\phantom{\rule{0.2em}{0ex}}\theta =\sqrt{1-{\left(\frac{3}{5}\right)}^{2}}=\sqrt{\frac{16}{25}}=\frac{4}{5}.

Using f\left(x,y\right)={x}^{2}-xy+3{y}^{2}, we first calculate f\left(x+h\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}\theta ,y+h\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}\theta \right)\text{:}

\begin{array}{cc}\hfill f\left(x+h\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}\theta ,y+h\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}\theta \right)& ={\left(x+h\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}\theta \right)}^{2}-\left(x+h\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}\theta \right)\left(y+h\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}\theta \right)+3{\left(y+h\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}\theta \right)}^{2}\hfill \\ & ={x}^{2}+2xh\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}\theta +{h}^{2}{\text{cos}}^{2}\theta -xy-xh\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}\theta -yh\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}\theta \hfill \\ & \phantom{\rule{0.5em}{0ex}}{\mathit{\text{−h}}}^{2}\text{sin}\phantom{\rule{0.2em}{0ex}}\theta \phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}\theta +3{y}^{2}+6yh\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}\theta +3{h}^{2}{\text{sin}}^{2}\theta \hfill \\ & ={x}^{2}+2xh\left(\frac{3}{5}\right)+\frac{9{h}^{2}}{25}-xy-\frac{4xh}{5}-\frac{3yh}{5}-\frac{12{h}^{2}}{25}+3{y}^{2}\hfill \\ & \phantom{\rule{0.5em}{0ex}}+6yh\left(\frac{4}{5}\right)+3{h}^{2}\left(\frac{16}{25}\right)\hfill \\ & ={x}^{2}-xy+3{y}^{2}+\frac{2xh}{5}+\frac{9{h}^{2}}{5}+\frac{21yh}{5}.\hfill \end{array}

We substitute this expression into (Figure):

\begin{array}{cc}\hfill {D}_{u}f\left(a,b\right)& =\underset{h\to 0}{\text{lim}}\frac{f\left(a+h\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}\theta ,b+h\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}\theta \right)-f\left(a,b\right)}{h}\hfill \\ & =\underset{h\to 0}{\text{lim}}\frac{\left({x}^{2}-xy+3{y}^{2}+\frac{2xh}{5}+\frac{9{h}^{2}}{5}+\frac{21yh}{5}\right)-\left({x}^{2}-xy+3{y}^{2}\right)}{h}\hfill \\ & =\underset{h\to 0}{\text{lim}}\frac{\frac{2xh}{5}+\frac{9{h}^{2}}{5}+\frac{21yh}{5}}{h}\hfill \\ & =\underset{h\to 0}{\text{lim}}\frac{2x}{5}+\frac{9h}{5}+\frac{21y}{5}\hfill \\ & =\frac{2x+21y}{5}.\hfill \end{array}

To calculate {D}_{u}f\left(-1,2\right), we substitute x=-1 and y=2 into this answer:

\begin{array}{cc}\hfill {D}_{u}f\left(-1,2\right)& =\frac{2\left(-1\right)+21\left(2\right)}{5}\hfill \\ & =\frac{-2+42}{5}\hfill \\ & =8.\hfill \end{array}

(See the following figure.)

Finding the directional derivative in a given direction u at a given point on a surface. The plane is tangent to the surface at the given point \left(-1,2,15\right).

The shape f(x, y) = x2 – xy + 3y2 in xyz space with tangent plane at point (–1, 2, 15). There are two arrows from the point, one seemingly along the surface of the shape and the other in a direction on the plane. The one that corresponds to the plane is marked u = 3/5 i + 4/5 j.

Another approach to calculating a directional derivative involves partial derivatives, as outlined in the following theorem.

Directional Derivative of a Function of Two Variables

Let z=f\left(x,y\right) be a function of two variables x\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}y, and assume that {f}_{x} and {f}_{y} exist. Then the directional derivative of f in the direction of \text{u}=\text{cos}\phantom{\rule{0.2em}{0ex}}\theta \text{i}+\text{sin}\phantom{\rule{0.2em}{0ex}}\theta \text{j} is given by

{D}_{u}f\left(x,y\right)={f}_{x}\left(x,y\right)\text{cos}\phantom{\rule{0.2em}{0ex}}\theta +{f}_{y}\left(x,y\right)\text{sin}\phantom{\rule{0.2em}{0ex}}\theta .

Proof

(Figure) states that the directional derivative of f in the direction of u=\text{cos}\phantom{\rule{0.2em}{0ex}}\theta i+\text{sin}\phantom{\rule{0.2em}{0ex}}\theta j is given by

{D}_{u}f\left(a,b\right)=\underset{t\to 0}{\text{lim}}\frac{f\left(a+t\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}\theta ,b+t\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}\theta \right)-f\left(a,b\right)}{t}.

Let x=a+t\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}\theta and y=b+t\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}\theta , and define g\left(t\right)=f\left(x,y\right). Since {f}_{x} and {f}_{y} both exist, we can use the chain rule for functions of two variables to calculate {g}^{\prime }\left(t\right)\text{:}

\begin{array}{cc}\hfill {g}^{\prime }\left(t\right)& =\frac{\partial \mathit{\text{f}}}{\partial \mathit{\text{x}}}\phantom{\rule{0.1em}{0ex}}\frac{dx}{dt}+\frac{\partial \mathit{\text{f}}}{\partial \mathit{\text{y}}}\phantom{\rule{0.1em}{0ex}}\frac{dy}{dt}\hfill \\ & ={f}_{x}\left(x,y\right)\text{cos}\phantom{\rule{0.2em}{0ex}}\theta +{f}_{y}\left(x,y\right)\text{sin}\phantom{\rule{0.2em}{0ex}}\theta .\hfill \end{array}

If t=0, then x={x}_{0} and y={y}_{0}, so

{g}^{\prime }\left(0\right)={f}_{x}\left({x}_{0},{y}_{0}\right)\text{cos}\phantom{\rule{0.2em}{0ex}}\theta +{f}_{y}\left({x}_{0},{y}_{0}\right)\text{sin}\phantom{\rule{0.2em}{0ex}}\theta .

By the definition of {g}^{\prime }\left(t\right), it is also true that

\begin{array}{cc}\hfill {g}^{\prime }\left(0\right)& =\underset{t\to 0}{\text{lim}}\frac{g\left(t\right)-g\left(0\right)}{t}\hfill \\ & =\underset{t\to 0}{\text{lim}}\frac{f\left({x}_{0}+t\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}\theta ,{y}_{0}+t\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}\theta \right)-f\left({x}_{0},{y}_{0}\right)}{t}.\hfill \end{array}

Therefore, {D}_{u}f\left({x}_{0},{y}_{0}\right)={f}_{x}\left(x,y\right)\text{cos}\phantom{\rule{0.2em}{0ex}}\theta +{f}_{y}\left(x,y\right)\text{sin}\phantom{\rule{0.2em}{0ex}}\theta .

Finding a Directional Derivative: Alternative Method

Let \theta =\text{arccos}\left(3\text{/}5\right). Find the directional derivative {D}_{u}f\left(x,y\right) of f\left(x,y\right)={x}^{2}-xy+3{y}^{2} in the direction of u=\left(\text{cos}\phantom{\rule{0.2em}{0ex}}\theta \right)i+\left(\text{sin}\phantom{\rule{0.2em}{0ex}}\theta \right)j. What is {D}_{u}f\left(-1,2\right)?

First, we must calculate the partial derivatives of f\text{:}

\begin{array}{c}{f}_{x}=2x-y\hfill \\ {f}_{y}=\text{−}x+6y,\hfill \end{array}

Then we use (Figure) with \theta =\text{arccos}\left(3\text{/}5\right)\text{:}

\begin{array}{cc}\hfill {D}_{u}f\left(x,y\right)& ={f}_{x}\left(x,y\right)\text{cos}\phantom{\rule{0.2em}{0ex}}\theta +{f}_{y}\left(x,y\right)\text{sin}\phantom{\rule{0.2em}{0ex}}\theta \hfill \\ & =\left(2x-y\right)\frac{3}{5}+\left(\text{−}x+6y\right)\frac{4}{5}\hfill \\ & =\frac{6x}{5}-\frac{3y}{5}-\frac{4x}{5}+\frac{24y}{5}\hfill \\ & =\frac{2x+21y}{5}.\hfill \end{array}

To calculate {D}_{u}f\left(-1,2\right), let x=-1 and y=2\text{:}

{D}_{u}f\left(-1,2\right)=\frac{2\left(-1\right)+21\left(2\right)}{5}=\frac{-2+42}{5}=8.

This is the same answer obtained in (Figure).

Find the directional derivative {D}_{u}f\left(x,y\right) of f\left(x,y\right)=3{x}^{2}y-4x{y}^{3}+3{y}^{2}-4x in the direction of u=\left(\text{cos}\phantom{\rule{0.2em}{0ex}}\frac{\pi }{3}\right)i+\left(\text{sin}\phantom{\rule{0.2em}{0ex}}\frac{\pi }{3}\right)j using (Figure). What is {D}_{u}f\left(3,4\right)?

\begin{array}{}\\ \\ {D}_{u}f\left(x,y\right)=\frac{\left(6xy-4{y}^{3}-4\right)\left(1\right)}{2}+\frac{\left(3{x}^{2}-12x{y}^{2}+6y\right)\sqrt{3}}{2}\hfill \\ {D}_{u}f\left(3,4\right)=\frac{72-256-4}{2}+\frac{\left(27-576+24\right)\sqrt{3}}{2}=-94-\frac{525\sqrt{3}}{2}\hfill \end{array}

Hint

Calculate the partial derivatives and determine the value of \theta .

If the vector that is given for the direction of the derivative is not a unit vector, then it is only necessary to divide by the norm of the vector. For example, if we wished to find the directional derivative of the function in (Figure) in the direction of the vector 〈-5,12〉, we would first divide by its magnitude to get u. This gives us u=〈\text{−}\left(5\text{/}13\right),12\text{/}13〉. Then

\begin{array}{cc}\hfill {D}_{u}f\left(x,y\right)& =\nabla f\left(x,y\right)·u\hfill \\ & =-\frac{5}{13}\left(2x-y\right)+\frac{12}{13}\left(\text{−}x+6y\right)\hfill \\ & =-\frac{22}{13}x+\frac{17}{13}y.\hfill \end{array}

Gradient

The right-hand side of (Figure) is equal to {f}_{x}\left(x,y\right)\text{cos}\phantom{\rule{0.2em}{0ex}}\theta +{f}_{y}\left(x,y\right)\text{sin}\phantom{\rule{0.2em}{0ex}}\theta , which can be written as the dot product of two vectors. Define the first vector as \nabla f\left(x,y\right)={f}_{x}\left(x,y\right)\text{i}+{f}_{y}\left(x,y\right)\text{j} and the second vector as u=\left(\text{cos}\phantom{\rule{0.2em}{0ex}}\theta \right)i+\left(\text{sin}\phantom{\rule{0.2em}{0ex}}\theta \right)j. Then the right-hand side of the equation can be written as the dot product of these two vectors:

{D}_{u}f\left(x,y\right)=\nabla f\left(x,y\right)·u.

The first vector in (Figure) has a special name: the gradient of the function f. The symbol \nabla is called nabla and the vector \nabla f is read \text{``del}\phantom{\rule{0.2em}{0ex}}f\text{.''}

Definition

Let z=f\left(x,y\right) be a function of x\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}y such that {f}_{x} and {f}_{y} exist. The vector \nabla f\left(x,y\right) is called the gradient of f and is defined as

\nabla f\left(x,y\right)={f}_{x}\left(x,y\right)i+{f}_{y}\left(x,y\right)j.

The vector \nabla f\left(x,y\right) is also written as \text{``grad}\phantom{\rule{0.2em}{0ex}}f\text{.''}

Finding Gradients

Find the gradient \nabla f\left(x,y\right) of each of the following functions:

  1. f\left(x,y\right)={x}^{2}-xy+3{y}^{2}
  2. f\left(x,y\right)=\text{sin}\phantom{\rule{0.2em}{0ex}}3x\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}3y

For both parts a. and b., we first calculate the partial derivatives {f}_{x} and {f}_{y}, then use (Figure).


  1. \begin{array}{ccc}\hfill {f}_{x}\left(x,y\right)& =\hfill & 2x-y\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}{f}_{y}\left(x,y\right)=\text{−}x+6y,\phantom{\rule{0.2em}{0ex}}\text{so}\hfill \\ \hfill \nabla f\left(x,y\right)& =\hfill & {f}_{x}\left(x,y\right)i+{f}_{y}\left(x,y\right)j\hfill \\ & =\hfill & \left(2x-y\right)i+\left(\text{−}x+6y\right)j.\hfill \end{array}

  2. \begin{array}{ccc}\hfill {f}_{x}\left(x,y\right)& =\hfill & 3\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}3x\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}3y\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}{f}_{y}\left(x,y\right)=-3\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}3x\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}3y,\phantom{\rule{0.2em}{0ex}}\text{so}\hfill \\ \hfill \nabla f\left(x,y\right)& =\hfill & {f}_{x}\left(x,y\right)i+{f}_{y}\left(x,y\right)j\hfill \\ & =\hfill & \left(3\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}3x\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}3y\right)i-\left(3\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}3x\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}3y\right)j.\hfill \end{array}

Find the gradient \nabla f\left(x,y\right) of f\left(x,y\right)=\left({x}^{2}-3{y}^{2}\right)\text{/}\left(2x+y\right).

\nabla f\left(x,y\right)=\frac{2{x}^{2}+2xy+6{y}^{2}}{{\left(2x+y\right)}^{2}}i-\frac{{x}^{2}+12xy+3{y}^{2}}{{\left(2x+y\right)}^{2}}j

Hint

Calculate the partial derivatives, then use (Figure).

The gradient has some important properties. We have already seen one formula that uses the gradient: the formula for the directional derivative. Recall from The Dot Product that if the angle between two vectors a and b is \phi , then a·\text{b}=‖a‖‖\text{b}‖\text{cos}\phantom{\rule{0.2em}{0ex}}\phi . Therefore, if the angle between \nabla f\left({x}_{0},{y}_{0}\right) and u=\left(\text{cos}\phantom{\rule{0.2em}{0ex}}\theta \right)i+\left(\text{sin}\phantom{\rule{0.2em}{0ex}}\theta \right)j is \phi , we have

{D}_{u}f\left({x}_{0},{y}_{0}\right)=\nabla f\left({x}_{0},{y}_{0}\right)·u=‖\nabla f\left({x}_{0},{y}_{0}\right)‖‖u‖\text{cos}\phantom{\rule{0.2em}{0ex}}\phi =‖\nabla f\left({x}_{0},{y}_{0}\right)‖\text{cos}\phantom{\rule{0.2em}{0ex}}\phi .

The ‖u‖ disappears because u is a unit vector. Therefore, the directional derivative is equal to the magnitude of the gradient evaluated at \left({x}_{0},{y}_{0}\right) multiplied by \text{cos}\phantom{\rule{0.2em}{0ex}}\phi . Recall that \text{cos}\phantom{\rule{0.2em}{0ex}}\phi ranges from -1 to 1. If \phi =0, then \text{cos}\phantom{\rule{0.2em}{0ex}}\phi =1 and \nabla f\left({x}_{0},{y}_{0}\right) and u both point in the same direction. If \phi =\pi , then \text{cos}\phantom{\rule{0.2em}{0ex}}\phi =-1 and \nabla f\left({x}_{0},{y}_{0}\right) and u point in opposite directions. In the first case, the value of {D}_{\text{u}}f\left({x}_{0},{y}_{0}\right) is maximized; in the second case, the value of {D}_{\text{u}}f\left({x}_{0},{y}_{0}\right) is minimized. If \nabla f\left({x}_{0},{y}_{0}\right)=0, then {D}_{u}f\left({x}_{0},{y}_{0}\right)=\nabla f\left({x}_{0},{y}_{0}\right)·u=0 for any vector u. These three cases are outlined in the following theorem.

Properties of the Gradient

Suppose the function z=f\left(x,y\right) is differentiable at \left({x}_{0},{y}_{0}\right) ((Figure)).

  1. If \nabla f\left({x}_{0},{y}_{0}\right)=0, then {D}_{u}f\left({x}_{0},{y}_{0}\right)=0 for any unit vector u.
  2. If \nabla f\left({x}_{0},{y}_{0}\right)\ne 0, then {D}_{u}f\left({x}_{0},{y}_{0}\right) is maximized when u points in the same direction as \nabla f\left({x}_{0},{y}_{0}\right). The maximum value of {D}_{u}f\left({x}_{0},{y}_{0}\right) is ‖\nabla f\left({x}_{0},{y}_{0}\right)‖\text{.}
  3. If \nabla f\left({x}_{0},{y}_{0}\right)\ne 0, then {D}_{u}f\left({x}_{0},{y}_{0}\right) is minimized when u points in the opposite direction from \nabla f\left({x}_{0},{y}_{0}\right). The minimum value of {D}_{u}f\left({x}_{0},{y}_{0}\right) is \text{−}‖\nabla f\left({x}_{0},{y}_{0}\right)‖\text{.}
The gradient indicates the maximum and minimum values of the directional derivative at a point.

An upward facing paraboloid in xyz space with point P0 (x0, y0, z0). From this point, there are arrows going up, down, and around the paraboloid. On the xy plane, the point (x0, y0) is marked, and the corresponding arrows are drawn onto the plane: the down arrow corresponds to −∇f (most rapid decrease in f), the up arrow corresponds to ∇f (most rapid increase in f), and the arrows around correspond to no change in f. The up/down arrows are perpendicular to the around arrows in their projection on the plane.

Finding a Maximum Directional Derivative

Find the direction for which the directional derivative of f\left(x,y\right)=3{x}^{2}-4xy+2{y}^{2} at \left(-2,3\right) is a maximum. What is the maximum value?

The maximum value of the directional derivative occurs when \nabla f and the unit vector point in the same direction. Therefore, we start by calculating \nabla f\left(x,y\right)\text{:}

\begin{array}{ccc}\hfill {f}_{x}\left(x,y\right)& =\hfill & 6x-4y\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}{f}_{y}\left(x,y\right)=-4x+4y,\phantom{\rule{0.2em}{0ex}}\text{so}\hfill \\ \hfill \nabla f\left(x,y\right)& =\hfill & {f}_{x}\left(x,y\right)i+{f}_{y}\left(x,y\right)j=\left(6x-4y\right)i+\left(-4x+4y\right)j.\hfill \end{array}

Next, we evaluate the gradient at \left(-2,3\right)\text{:}

\nabla f\left(-2,3\right)=\left(6\left(-2\right)-4\left(3\right)\right)i+\left(-4\left(-2\right)+4\left(3\right)\right)j=-24i+20j.

We need to find a unit vector that points in the same direction as \nabla f\left(-2,3\right), so the next step is to divide \nabla f\left(-2,3\right) by its magnitude, which is \sqrt{{\left(-24\right)}^{2}+{\left(20\right)}^{2}}=\sqrt{976}=4\sqrt{61}. Therefore,

\frac{\nabla f\left(-2,3\right)}{‖\nabla f\left(-2,3\right)‖}=\frac{-24}{4\sqrt{61}}i+\frac{20}{4\sqrt{61}}j=\frac{-6\sqrt{61}}{61}i+\frac{5\sqrt{61}}{61}j.

This is the unit vector that points in the same direction as \nabla f\left(-2,3\right). To find the angle corresponding to this unit vector, we solve the equations

\text{cos}\phantom{\rule{0.2em}{0ex}}\theta =\frac{-6\sqrt{61}}{61}\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}\theta =\frac{5\sqrt{61}}{61}

for \theta . Since cosine is negative and sine is positive, the angle must be in the second quadrant. Therefore, \theta =\pi -\text{arcsin}\left(\left(5\sqrt{61}\right)\text{/}61\right)\approx 2.45\phantom{\rule{0.2em}{0ex}}\text{rad.}

The maximum value of the directional derivative at \left(-2,3\right) is ‖\nabla f\left(-2,3\right)‖=4\sqrt{61} (see the following figure).

The maximum value of the directional derivative at \left(-2,3\right) is in the direction of the gradient.

An upward facing paraboloid f(x, y) = 3x2 – 4xy + 2y2 with tangent plane at the point (–2, 3, 54). The tangent plane has equation z = –24x + 20y – 54.

Find the direction for which the directional derivative of g\left(x,y\right)=4x-xy+2{y}^{2} at \left(-2,3\right) is a maximum. What is the maximum value?

The gradient of g at \left(-2,3\right) is \nabla g\left(-2,3\right)=i+14j. The unit vector that points in the same direction as \nabla g\left(-2,3\right) is \frac{\nabla g\left(-2,3\right)}{‖\nabla g\left(-2,3\right)‖}=\frac{1}{\sqrt{197}}i+\frac{14}{\sqrt{197}}j=\frac{\sqrt{197}}{197}i+\frac{14\sqrt{197}}{197}j, which gives an angle of \theta =\text{arcsin}\left(\left(14\sqrt{197}\right)\text{/}197\right)\approx 1.499\phantom{\rule{0.2em}{0ex}}\text{rad}. The maximum value of the directional derivative is ‖\nabla g\left(-2,3\right)‖=\sqrt{197}.

Hint

Evaluate the gradient of g at point \left(-2,3\right).

(Figure) shows a portion of the graph of the function f\left(x,y\right)=3+\text{sin}\phantom{\rule{0.2em}{0ex}}x\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}y. Given a point \left(a,b\right) in the domain of f, the maximum value of the gradient at that point is given by ‖\nabla f\left(a,b\right)‖. This would equal the rate of greatest ascent if the surface represented a topographical map. If we went in the opposite direction, it would be the rate of greatest descent.

A typical surface in {ℝ}^{3}. Given a point on the surface, the directional derivative can be calculated using the gradient.

An surface in xyz space with point at f(a, b). There is an arrow in the direction of greatest descent.

When using a topographical map, the steepest slope is always in the direction where the contour lines are closest together (see (Figure)). This is analogous to the contour map of a function, assuming the level curves are obtained for equally spaced values throughout the range of that function.

Contour map for the function f\left(x,y\right)={x}^{2}-{y}^{2} using level values between -5 and 5.

Two crossing dashed lines that pass through the origin and a series of curved lines approaching the crosses dashed lines as if they are asymptotes.

Gradients and Level Curves

Recall that if a curve is defined parametrically by the function pair \left(x\left(t\right),y\left(t\right)\right), then the vector {x}^{\prime }\left(t\right)i+{y}^{\prime }\left(t\right)j is tangent to the curve for every value of t in the domain. Now let’s assume z=f\left(x,y\right) is a differentiable function of x\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}y, and \left({x}_{0},{y}_{0}\right) is in its domain. Let’s suppose further that {x}_{0}=x\left({t}_{0}\right) and {y}_{0}=y\left({t}_{0}\right) for some value of t, and consider the level curve f\left(x,y\right)=k. Define g\left(t\right)=f\left(x\left(t\right),y\left(t\right)\right) and calculate {g}^{\prime }\left(t\right) on the level curve. By the chain Rule,

{g}^{\prime }\left(t\right)={f}_{x}\left(x\left(t\right),y\left(t\right)\right){x}^{\prime }\left(t\right)+{f}_{y}\left(x\left(t\right),y\left(t\right)\right){y}^{\prime }\left(t\right).

But {g}^{\prime }\left(t\right)=0 because g\left(t\right)=k for all t. Therefore, on the one hand,

{f}_{x}\left(x\left(t\right),y\left(t\right)\right){x}^{\prime }\left(t\right)+{f}_{y}\left(x\left(t\right),y\left(t\right)\right){y}^{\prime }\left(t\right)=0;

on the other hand,

{f}_{x}\left(x\left(t\right),y\left(t\right)\right){x}^{\prime }\left(t\right)+{f}_{y}\left(x\left(t\right),y\left(t\right)\right){y}^{\prime }\left(t\right)=\nabla f\left(x,y\right)·〈{x}^{\prime }\left(t\right),{y}^{\prime }\left(t\right)〉\text{.}

Therefore,

\nabla f\left(x,y\right)·〈{x}^{\prime }\left(t\right),{y}^{\prime }\left(t\right)〉=0.

Thus, the dot product of these vectors is equal to zero, which implies they are orthogonal. However, the second vector is tangent to the level curve, which implies the gradient must be normal to the level curve, which gives rise to the following theorem.

Gradient Is Normal to the Level Curve

Suppose the function z=f\left(x,y\right) has continuous first-order partial derivatives in an open disk centered at a point \left({x}_{0},{y}_{0}\right). If \nabla f\left({x}_{0},{y}_{0}\right)\ne 0, then \nabla f\left({x}_{0},{y}_{0}\right) is normal to the level curve of f at \left({x}_{0},{y}_{0}\right).

We can use this theorem to find tangent and normal vectors to level curves of a function.

Finding Tangents to Level Curves

For the function f\left(x,y\right)=2{x}^{2}-3xy+8{y}^{2}+2x-4y+4, find a tangent vector to the level curve at point \left(-2,1\right). Graph the level curve corresponding to f\left(x,y\right)=18 and draw in \nabla f\left(-2,1\right) and a tangent vector.

First, we must calculate \nabla f\left(x,y\right)\text{:}

{f}_{x}\left(x,y\right)=4x-3y+2\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}{f}_{y}=-3x+16y-4\phantom{\rule{0.2em}{0ex}}\text{so}\phantom{\rule{0.2em}{0ex}}\nabla f\left(x,y\right)=\left(4x-3y+2\right)i+\left(-3x+16y-4\right)j.

Next, we evaluate \nabla f\left(x,y\right) at \left(-2,1\right)\text{:}

\nabla f\left(-2,1\right)=\left(4\left(-2\right)-3\left(1\right)+2\right)i+\left(-3\left(-2\right)+16\left(1\right)-4\right)j=-9i+18j.

This vector is orthogonal to the curve at point \left(-2,1\right). We can obtain a tangent vector by reversing the components and multiplying either one by -1. Thus, for example, -18i-9j is a tangent vector (see the following graph).

Tangent and normal vectors to 2{x}^{2}-3xy+8{y}^{2}+2x-4y+4=18 at point \left(-2,1\right).

A rotated ellipse with equation f(x, y) = 10. At the point (–2, 1) on the ellipse, there are drawn two arrows, one tangent vector and one normal vector. The normal vector is marked ∇f(–2, 1) and is perpendicular to the tangent vector.

For the function f\left(x,y\right)={x}^{2}-2xy+5{y}^{2}+3x-2y+4, find the tangent to the level curve at point \left(1,1\right). Draw the graph of the level curve corresponding to f\left(x,y\right)=8 and draw \nabla f\left(1,1\right) and a tangent vector.

\nabla f\left(x,y\right)=\left(2x-2y+3\right)i+\left(-2x+10y-2\right)j
\nabla f\left(1,1\right)=3i+6j
Tangent vector: 6i-3j or -6i+3j

A rotated ellipse with equation f(x, y) = 8. At the point (1, 1) on the ellipse, there are drawn two arrows, one tangent vector and one normal vector. The normal vector is marked ∇f(1, 1) and is perpendicular to the tangent vector.

Hint

Calculate the gradient at point \left(1,1\right).

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\left(x,y,z\right) be a function of three variables such that {f}_{x},{f}_{y},\text{and}\phantom{\rule{0.2em}{0ex}}{f}_{z} exist. The vector \nabla f\left(x,y,z\right) is called the gradient of f and is defined as

\nabla f\left(x,y,z\right)={f}_{x}\left(x,y,z\right)i+{f}_{y}\left(x,y,z\right)j+{f}_{z}\left(x,y,z\right)k.

\nabla f\left(x,y,z\right) can also be written as \text{grad}\phantom{\rule{0.2em}{0ex}}f\left(x,y,z\right).

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 (Figure).

Finding Gradients in Three Dimensions

Find the gradient \nabla f\left(x,y,z\right) of each of the following functions:

  1. f\left(x,y\right)=5{x}^{2}-2xy+{y}^{2}-4yz+{z}^{2}+3xz
  2. f\left(x,y,z\right)={e}^{-2z}\text{sin}\phantom{\rule{0.2em}{0ex}}2x\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}2y

For both parts a. and b., we first calculate the partial derivatives {f}_{x},{f}_{y}, and {f}_{z}, then use (Figure).


  1. \begin{array}{ccc}\hfill {f}_{z}\left(x,y,z\right)& =\hfill & 10x-2y+3z,\phantom{\rule{0.2em}{0ex}}{f}_{y}\left(x,y,z\right)=-2x+2y-4z\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}{f}_{z}\left(x,y,z\right)=3x-4y+2z,\phantom{\rule{0.2em}{0ex}}\text{so}\hfill \\ \nabla f\left(x,y,z\right)\hfill & =\hfill & {f}_{x}\left(x,y,z\right)i+{f}_{y}\left(x,y,z\right)j+{f}_{z}\left(x,y,z\right)k\hfill \\ & =\hfill & \left(10x-2y+3z\right)i+\left(-2x+2y-4z\right)j+\left(-4x+3y+2z\right)k.\hfill \end{array}

  2. \begin{array}{ccc}\hfill {f}_{x}\left(x,y,z\right)& =\hfill & -2{e}^{-2z}\text{cos}\phantom{\rule{0.2em}{0ex}}2x\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}2y,\phantom{\rule{0.2em}{0ex}}{f}_{y}\left(x,y,z\right)=-2{e}^{-2z}\text{sin}\phantom{\rule{0.2em}{0ex}}2x\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}2y\phantom{\rule{0.2em}{0ex}}\text{and}\hfill \\ \hfill {f}_{z}\left(x,y,z\right)& =\hfill & -2{e}^{-2z}\text{sin}\phantom{\rule{0.2em}{0ex}}2x\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}2y,\phantom{\rule{0.2em}{0ex}}\text{so}\hfill \\ \hfill \nabla f\left(x,y,z\right)& =\hfill & {f}_{x}\left(x,y,z\right)i+{f}_{y}\left(x,y,z\right)j+{f}_{z}\left(x,y,z\right)k\hfill \\ & =\hfill & \left(2{e}^{-2z}\text{cos}\phantom{\rule{0.2em}{0ex}}2x\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}2y\right)i+\left(-2{e}^{-2z}\right)j+\left(-2{e}^{-2z}\right)\hfill \\ & =\hfill & 2{e}^{-2z}\left(\text{cos}\phantom{\rule{0.2em}{0ex}}2x\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}2y\phantom{\rule{0.2em}{0ex}}\text{i}-\text{sin}\phantom{\rule{0.2em}{0ex}}2x\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}2y\phantom{\rule{0.2em}{0ex}}\text{j}-\text{sin}\phantom{\rule{0.2em}{0ex}}2x\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}2y\phantom{\rule{0.2em}{0ex}}\text{k}\right).\hfill \end{array}

Find the gradient \nabla f\left(x,y,z\right) of f\left(x,y,z\right)=\frac{{x}^{2}-3{y}^{2}+{z}^{2}}{2x+y-4z}.

\begin{array}{cc}\hfill \nabla f\left(x,y,z\right)& =\frac{2{x}^{2}+2xy+6{y}^{2}-8xz-2{z}^{2}}{{\left(2x+y-4z\right)}^{2}}i-\frac{{x}^{2}+12xy+3{y}^{2}-24yz+{z}^{2}}{{\left(2x+y-4z\right)}^{2}}j\hfill \\ & +\frac{4{x}^{2}-12{y}^{2}-4{z}^{2}+4xz+2yz}{{\left(2x+y-4z\right)}^{2}}k.\hfill \end{array}

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 \alpha ,\beta , and \gamma . Then the directional cosines are given by \text{cos}\phantom{\rule{0.2em}{0ex}}\alpha ,\text{cos}\phantom{\rule{0.2em}{0ex}}\beta , and \text{cos}\phantom{\rule{0.2em}{0ex}}\gamma . These are the components of the unit vector u; since u is a unit vector, it is true that {\text{cos}}^{2}\alpha +{\text{cos}}^{2}\beta +{\text{cos}}^{2}\gamma =1.

Definition

Suppose w=f\left(x,y,z\right) is a function of three variables with a domain of D. Let \left({x}_{0},{y}_{0},{z}_{0}\right)\in D and let \text{u}=\text{cos}\phantom{\rule{0.2em}{0ex}}\alpha i+\text{cos}\phantom{\rule{0.2em}{0ex}}\beta j+\text{cos}\phantom{\rule{0.2em}{0ex}}\gamma k be a unit vector. Then, the directional derivative of f in the direction of u is given by

{D}_{u}f\left({x}_{0},{y}_{0},{z}_{0}\right)=\underset{t\to 0}{\text{lim}}\frac{f\left({x}_{0}+t\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}\alpha ,{y}_{0}+t\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}\beta ,{z}_{0}+t\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}\gamma \right)-f\left({x}_{0},{y}_{0},{z}_{0}\right)}{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 (Figure).

Directional Derivative of a Function of Three Variables

Let f\left(x,y,z\right) be a differentiable function of three variables and let u=\text{cos}\phantom{\rule{0.2em}{0ex}}\alpha i+\text{cos}\phantom{\rule{0.2em}{0ex}}\beta j+\text{cos}\phantom{\rule{0.2em}{0ex}}\gamma k be a unit vector. Then, the directional derivative of f in the direction of u is given by

\begin{array}{cc}\hfill {D}_{u}f\left(x,y,z\right)& =\nabla f\left(x,y,z\right)·u\hfill \\ & ={f}_{x}\left(x,y,z\right)\text{cos}\phantom{\rule{0.2em}{0ex}}\alpha +{f}_{y}\left(x,y,z\right)\text{cos}\phantom{\rule{0.2em}{0ex}}\beta +{f}_{z}\left(x,y,z\right)\text{cos}\phantom{\rule{0.2em}{0ex}}\gamma .\hfill \end{array}

The three angles \alpha ,\beta ,\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}\gamma 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\left(1,-2,3\right) in the direction of \text{v}=\text{−}i+2j+2k for the function

f\left(x,y,z\right)=5{x}^{2}-2xy+{y}^{2}-4yz+{z}^{2}+3xz.

First, we find the magnitude of v\text{:}

‖v‖=\sqrt{{\left(-1\right)}^{2}+{\left(2\right)}^{2}}=3.

Therefore, \frac{v}{‖v‖}=\frac{\text{−}i+2j+2k}{3}=-\frac{1}{3}i+\frac{2}{3}j+\frac{2}{3}k is a unit vector in the direction of v, so \text{cos}\phantom{\rule{0.2em}{0ex}}\alpha =-\frac{1}{3},\text{cos}\phantom{\rule{0.2em}{0ex}}\beta =\frac{2}{3},\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}\gamma =\frac{2}{3}. Next, we calculate the partial derivatives of f\text{:}

\begin{array}{ccc}\hfill {f}_{x}\left(x,y,z\right)& =\hfill & 10x-2y+3z\hfill \\ \hfill {f}_{y}\left(x,y,z\right)& =\hfill & -2x+2y-4z\hfill \\ \hfill {f}_{z}\left(x,y,z\right)& =\hfill & -4y+2z+3x,\hfill \end{array}

then substitute them into (Figure):

\begin{array}{cc}\hfill {D}_{u}f\left(x,y,z\right)& ={f}_{x}\left(x,y,z\right)\text{cos}\phantom{\rule{0.2em}{0ex}}\alpha +{f}_{y}\left(x,y,z\right)\text{cos}\phantom{\rule{0.2em}{0ex}}\beta +{f}_{z}\left(x,y,z\right)\text{cos}\phantom{\rule{0.2em}{0ex}}\gamma \hfill \\ & =\left(10x-2y+3z\right)\left(-\frac{1}{3}\right)+\left(-2x+2y-4z\right)\left(\frac{2}{3}\right)+\left(-4y+2z+3x\right)\left(\frac{2}{3}\right)\hfill \\ & =-\frac{10x}{3}+\frac{2y}{3}-\frac{3z}{3}-\frac{4x}{3}+\frac{4y}{3}-\frac{8z}{3}-\frac{8y}{3}+\frac{4z}{3}+\frac{6x}{3}\hfill \\ & =-\frac{8x}{3}-\frac{2y}{3}-\frac{7z}{3}.\hfill \end{array}

Last, to find {D}_{u}f\left(1,-2,3\right), we substitute x=1,y=-2,\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}z=3\text{:}

\begin{array}{cc}\hfill {D}_{u}f\left(1,-2,3\right)& =-\frac{8\left(1\right)}{3}-\frac{2\left(-2\right)}{3}-\frac{7\left(3\right)}{3}\hfill \\ & =-\frac{8}{3}+\frac{4}{3}-\frac{21}{3}\hfill \\ & =-\frac{25}{3}.\hfill \end{array}

Calculate {D}_{u}f\left(x,y,z\right) and {D}_{u}f\left(0,-2,5\right) in the direction of \text{v}=-3i+12j-4k for the function f\left(x,y,z\right)=3{x}^{2}+xy-2{y}^{2}+4yz-{z}^{2}+2xz.

\begin{array}{ccc}\hfill {D}_{u}f\left(x,y,z\right)& =\hfill & -\frac{3}{13}\left(6x+y+2z\right)+\frac{12}{13}\left(x-4y+4z\right)-\frac{4}{13}\left(2x+4y-2z\right)\hfill \\ \hfill {D}_{u}f\left(0,-2,5\right)& =\hfill & \frac{384}{13}\hfill \end{array}

Hint

First, divide v by its magnitude, calculate the partial derivatives of f, then use (Figure).

Key Concepts

  • A directional derivative represents a rate of change of a function in any given direction.
  • The gradient can be used in a formula to calculate the directional derivative.
  • The gradient indicates the direction of greatest change of a function of more than one variable.

Key Equations

  • directional derivative (two dimensions)
    {D}_{u}f\left(a,b\right)=\underset{h\to 0}{\text{lim}}\frac{f\left(a+h\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}\theta ,b+h\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}\theta \right)-f\left(a,b\right)}{h}
    or
    {D}_{u}f\left(x,y\right)={f}_{x}\left(x,y\right)\text{cos}\phantom{\rule{0.2em}{0ex}}\theta +{f}_{y}\left(x,y\right)\text{sin}\phantom{\rule{0.2em}{0ex}}\theta
  • gradient (two dimensions)
    \nabla f\left(x,y\right)={f}_{x}\left(x,y\right)i+{f}_{y}\left(x,y\right)j
  • gradient (three dimensions)
    \nabla f\left(x,y,z\right)={f}_{x}\left(x,y,z\right)i+{f}_{y}\left(x,y,z\right)j+{f}_{z}\left(x,y,z\right)k
  • directional derivative (three dimensions)
    \begin{array}{cc}\hfill {D}_{u}f\left(x,y,z\right)& =\nabla f\left(x,y,z\right)·u\hfill \\ & ={f}_{x}\left(x,y,z\right)\text{cos}\phantom{\rule{0.2em}{0ex}}\alpha +{f}_{y}\left(x,y,z\right)\text{cos}\phantom{\rule{0.2em}{0ex}}\beta +{f}_{x}\left(x,y,z\right)\text{cos}\phantom{\rule{0.2em}{0ex}}\gamma \hfill \end{array}

For the following exercises, find the directional derivative using the limit definition only.

f\left(x,y\right)=5-2{x}^{2}-\frac{1}{2}{y}^{2} at point P\left(3,4\right) in the direction of \text{u}=\left(\text{cos}\phantom{\rule{0.2em}{0ex}}\frac{\pi }{4}\right)i+\left(\text{sin}\phantom{\rule{0.2em}{0ex}}\frac{\pi }{4}\right)j

f\left(x,y\right)={y}^{2}\text{cos}\left(2x\right) at point P\left(\frac{\pi }{3},2\right) in the direction of \text{u}=\left(\text{cos}\phantom{\rule{0.2em}{0ex}}\frac{\pi }{4}\right)i+\left(\text{sin}\phantom{\rule{0.2em}{0ex}}\frac{\pi }{4}\right)j

-3\sqrt{3}

Find the directional derivative of f\left(x,y\right)={y}^{2}\text{sin}\left(2x\right) at point P\left(\frac{\pi }{4},2\right) in the direction of u=5i+12j.

For the following exercises, find the directional derivative of the function at point P in the direction of v.

f\left(x,y\right)=xy,P\left(0,-2\right),\text{v}=\frac{1}{2}i+\frac{\sqrt{3}}{2}j

-1

h\left(x,y\right)={e}^{x}\text{sin}\phantom{\rule{0.2em}{0ex}}y,P\left(1,\frac{\pi }{2}\right),v=\text{−}i

h\left(x,y,z\right)=xyz,P\left(2,1,1\right),\text{v}=2i+j-k

\frac{2}{\sqrt{6}}

f\left(x,y\right)=xy,P\left(1,1\right),u=〈\frac{\sqrt{2}}{2},\frac{\sqrt{2}}{2}〉

f\left(x,y\right)={x}^{2}-{y}^{2},\begin{array}{cc}u=〈\frac{\sqrt{3}}{2},\frac{1}{2}〉,\hfill & P\left(1,0\right)\hfill \end{array}

\sqrt{3}

f\left(x,y\right)=3x+4y+7,\begin{array}{cc}u=〈\frac{3}{5},\frac{4}{5}〉,\hfill & P\left(0,\frac{\pi }{2}\right)\hfill \end{array}

\begin{array}{ccc}f\left(x,y\right)={e}^{x}\text{cos}\phantom{\rule{0.2em}{0ex}}y,\hfill & u=〈0,1〉,\hfill & P=\left(0,\frac{\pi }{2}\right)\hfill \end{array}

-1.0

\begin{array}{ccc}f\left(x,y\right)={y}^{10},\hfill & u=〈0,-1〉,\hfill & P=\left(1,-1\right)\hfill \end{array}

f\left(x,y\right)=\text{ln}\left({x}^{2}+{y}^{2}\right),\begin{array}{cc}u=〈\frac{3}{5},\frac{4}{5}〉,\hfill & P\left(1,2\right)\hfill \end{array}

\frac{22}{25}

f\left(x,y\right)={x}^{2}y,\begin{array}{cc}P\left(-5,5\right),\hfill & v=3i-4j\hfill \end{array}

f\left(x,y\right)={y}^{2}+xz,\begin{array}{cc}P\left(1,2,2\right),\hfill & v=〈2,-1,2〉\hfill \end{array}

\frac{2}{3}

For the following exercises, find the directional derivative of the function in the direction of the unit vector u=\text{cos}\phantom{\rule{0.2em}{0ex}}\theta i+\text{sin}\phantom{\rule{0.2em}{0ex}}\theta j.

f\left(x,y\right)={x}^{2}+2{y}^{2},\theta =\frac{\pi }{6}

f\left(x,y\right)=\frac{y}{x+2y},\theta =-\frac{\pi }{4}

\frac{\text{−}\sqrt{2}\left(x+y\right)}{2{\left(x+2y\right)}^{2}}

f\left(x,y\right)=\text{cos}\left(3x+y\right),\theta =\frac{\pi }{4}

w\left(x,y\right)=y{e}^{x},\theta =\frac{\pi }{3}

\frac{{e}^{x}\left(y+\sqrt{3}\right)}{2}

\begin{array}{cc}f\left(x,y\right)=x\phantom{\rule{0.2em}{0ex}}\text{arctan}\left(y\right),\hfill & \theta =\frac{\pi }{2}\hfill \end{array}

\begin{array}{cc}f\left(x,y\right)=\text{ln}\left(x+2y\right),\hfill & \theta =\frac{\pi }{3}\hfill \end{array}

\frac{1+2\sqrt{3}}{2\left(x+2y\right)}

For the following exercises, find the gradient.

Find the gradient of f\left(x,y\right)=\frac{14-{x}^{2}-{y}^{2}}{3}. Then, find the gradient at point P\left(1,2\right).

Find the gradient of f\left(x,y,z\right)=xy+yz+xz at point P\left(1,2,3\right).

〈5,4,3〉

Find the gradient of f\left(x,y,z\right) at P and in the direction of u\text{:} f\left(x,y,z\right)=\text{ln}\left({x}^{2}+2{y}^{2}+3{z}^{2}\right),\begin{array}{cc}P\left(2,1,4\right),\hfill & u=\frac{-3}{13}i-\frac{4}{13}j-\frac{12}{13}k\hfill \end{array}.

f\left(x,y,z\right)=4{x}^{5}{y}^{2}{z}^{3},\begin{array}{cc}P\left(2,-1,1\right),\hfill & u=\frac{1}{3}i+\frac{2}{3}j-\frac{2}{3}k\hfill \end{array}

-320

For the following exercises, find the directional derivative of the function at point P in the direction of Q.

f\left(x,y\right)={x}^{2}+3{y}^{2},\begin{array}{cc}P\left(1,1\right),\hfill & Q\left(4,5\right)\hfill \end{array}

f\left(x,y,z\right)=\frac{y}{x+z},\begin{array}{cc}P\left(2,1,-1\right),\hfill & Q\left(-1,2,0\right)\hfill \end{array}

\frac{3}{\sqrt{11}}

For the following exercises, find the derivative of the function at P in the direction of u.

f\left(x,y\right)=-7x+2y,\begin{array}{cc}P\left(2,-4\right),\hfill & u=4i-3j\hfill \end{array}

f\left(x,y\right)=\text{ln}\left(5x+4y\right),\begin{array}{cc}P\left(3,9\right),\hfill & u=6i+8j\hfill \end{array}

\frac{31}{255}

[T] Use technology to sketch the level curve of f\left(x,y\right)=4x-2y+3 that passes through P\left(1,2\right) and draw the gradient vector at P.

[T] Use technology to sketch the level curve of f\left(x,y\right)={x}^{2}+4{y}^{2} that passes through P\left(-2,0\right) and draw the gradient vector at P.

The top of half of an ellipse centered at the origin with major axis horizontal and of length 4 and minor axis 2. The point (–2, 0) is marked, and there is an arrow pointing out from it to the left marked –4i.

For the following exercises, find the gradient vector at the indicated point.

f\left(x,y\right)=x{y}^{2}-y{x}^{2},P\left(-1,1\right)

f\left(x,y\right)=x{e}^{y}-\text{ln}\left(x\right),P\left(-3,0\right)

\frac{4}{3}i-3j

f\left(x,y,z\right)=xy-\text{ln}\left(z\right),P\left(2,-2,2\right)

f\left(x,y,z\right)=x\sqrt{{y}^{2}+{z}^{2}},P\left(-2,-1,-1\right)

\sqrt{2}i+\sqrt{2}j+\sqrt{2}k

For the following exercises, find the derivative of the function.

f\left(x,y\right)={x}^{2}+xy+{y}^{2} at point \left(-5,-4\right) in the direction the function increases most rapidly

f\left(x,y\right)={e}^{xy} at point \left(6,7\right) in the direction the function increases most rapidly

1.6\left({10}^{19}\right)

f\left(x,y\right)=\text{arctan}\left(\frac{y}{x}\right) at point \left(-9,9\right) in the direction the function increases most rapidly

f\left(x,y,z\right)=\text{ln}\left(xy+yz+zx\right) at point \left(-9,-18,-27\right) in the direction the function increases most rapidly

\frac{5\sqrt{2}}{99}

f\left(x,y,z\right)=\frac{x}{y}+\frac{y}{z}+\frac{z}{x} at point \left(5,-5,5\right) in the direction the function increases most rapidly

For the following exercises, find the maximum rate of change of f at the given point and the direction in which it occurs.

f\left(x,y\right)=x{e}^{\text{−}y},\left(1,0\right)

\sqrt{5},〈1,2〉

f\left(x,y\right)=\sqrt{{x}^{2}+2y},\left(4,10\right)

f\left(x,y\right)=\text{cos}\left(3x+2y\right),\left(\frac{\pi }{6},-\frac{\pi }{8}\right)

\sqrt{\frac{13}{2}},〈-3,-2〉

For the following exercises, find equations of

  1. the tangent plane and
  2. the normal line to the given surface at the given point.

The level curve f\left(x,y,z\right)=12 for f\left(x,y,z\right)=4{x}^{2}-2{y}^{2}+{z}^{2} at point \left(2,2,2\right).

f\left(x,y,z\right)=xy+yz+xz=3 at point \left(1,1,1\right)

a. x+y+z=3, b. x-1=y-1=z-1

f\left(x,y,z\right)=xyz=6 at point \left(1,2,3\right)

f\left(x,y,z\right)=x{e}^{y}\text{cos}\phantom{\rule{0.2em}{0ex}}z-z=1 at point \left(1,0,0\right)

a. x+y-z=1, b. x-1=y=\text{−}z

For the following exercises, solve the problem.

The temperature T in a metal sphere is inversely proportional to the distance from the center of the sphere (the origin: \left(0,0,0\right)\right). The temperature at point \left(1,2,2\right) is 120\text{°}\text{C}.

  1. Find the rate of change of the temperature at point \left(1,2,2\right) in the direction toward point \left(2,1,3\right).
  2. Show that, at any point in the sphere, the direction of greatest increase in temperature is given by a vector that points toward the origin.

The electrical potential (voltage) in a certain region of space is given by the function V\left(x,y,z\right)=5{x}^{2}-3xy+xyz.

  1. Find the rate of change of the voltage at point \left(3,4,5\right) in the direction of the vector 〈1,1,-1〉.
  2. In which direction does the voltage change most rapidly at point \left(3,4,5\right)?
  3. What is the maximum rate of change of the voltage at point \left(3,4,5\right)?

a. \frac{32}{\sqrt{3}}, b. 〈38,6,12〉, c. 2\sqrt{406}

If the electric potential at a point \left(x,y\right) in the xy-plane is V\left(x,y\right)={e}^{-2x}\text{cos}\left(2y\right), then the electric intensity vector at \left(x,y\right) is E=\text{−}\nabla V\left(x,y\right).

  1. Find the electric intensity vector at \left(\frac{\pi }{4},0\right).
  2. Show that, at each point in the plane, the electric potential decreases most rapidly in the direction of the vector E.

In two dimensions, the motion of an ideal fluid is governed by a velocity potential \phi . The velocity components of the fluid u in the x-direction and v in the y-direction, are given by 〈u,v〉=\nabla \phi . Find the velocity components associated with the velocity potential \phi \left(x,y\right)=\text{sin}\phantom{\rule{0.2em}{0ex}}\pi x\phantom{\rule{0.2em}{0ex}}\text{sin}\phantom{\rule{0.2em}{0ex}}2\pi y.

〈u,v〉=〈\pi \phantom{\rule{0.2em}{0ex}}\text{cos}\left(\pi x\right)\text{sin}\left(2\pi y\right),2\pi \phantom{\rule{0.2em}{0ex}}\text{sin}\left(\pi x\right)\text{cos}\left(2\pi y\right)〉

Glossary

directional derivative
the derivative of a function in the direction of a given unit vector
gradient
the gradient of the function f\left(x,y\right) is defined to be \nabla f\left(x,y\right)=\left(\partial f\text{/}\partial x\right)i+\left(\partial f\text{/}\partial y\right)j, which can be generalized to a function of any number of independent variables

License

Share This Book