Skip to main content
\(\require{cancel}\newcommand{\highlight}[1]{{\color{blue}{#1}}} \newcommand{\apex}{A\kern -1pt \lower -2pt\mbox{P}\kern -4pt \lower .7ex\mbox{E}\kern -1pt X} \newcommand{\colorlinecolor}{blue!95!black!30} \newcommand{\bwlinecolor}{black!30} \newcommand{\thelinecolor}{\colorlinecolor} \newcommand{\colornamesuffix}{} \newcommand{\linestyle}{[thick, \thelinecolor]} \newcommand{\bmx}[1]{\left[\hskip -3pt\begin{array}{#1} } \newcommand{\emx}{\end{array}\hskip -3pt\right]} \newcommand{\ds}{\displaystyle} \newcommand{\fp}{f'} \newcommand{\fpp}{f''} \newcommand{\lz}[2]{\frac{d#1}{d#2}} \newcommand{\lzn}[3]{\frac{d^{#1}#2}{d#3^{#1}}} \newcommand{\lzo}[1]{\frac{d}{d#1}} \newcommand{\lzoo}[2]{{\frac{d}{d#1}}{\left(#2\right)}} \newcommand{\lzon}[2]{\frac{d^{#1}}{d#2^{#1}}} \newcommand{\lzoa}[3]{\left.{\frac{d#1}{d#2}}\right|_{#3}} \newcommand{\plz}[2]{\frac{\partial#1}{\partial#2}} \newcommand{\plzoa}[3]{\left.{\frac{\partial#1}{\partial#2}}\right|_{#3}} \newcommand{\inflim}[1][n]{\lim\limits_{#1 \to \infty}} \newcommand{\infser}[1][1]{\sum_{n=#1}^\infty} \newcommand{\Fp}{F\primeskip'} \newcommand{\Fpp}{F\primeskip''} \newcommand{\yp}{y\primeskip'} \newcommand{\gp}{g\primeskip'} \newcommand{\dx}{\Delta x} \newcommand{\dy}{\Delta y} \newcommand{\ddz}{\Delta z} \newcommand{\thet}{\theta} \newcommand{\norm}[1]{\left\lVert#1\right\rVert} \newcommand{\vnorm}[1]{\left\lVert\vec #1\right\rVert} \newcommand{\snorm}[1]{\left|\left|\ #1\ \right|\right|} \newcommand{\la}{\left\langle} \newcommand{\ra}{\right\rangle} \newcommand{\dotp}[2]{\vec #1 \cdot \vec #2} \newcommand{\proj}[2]{\text{proj}_{\,\vec #2}{\,\vec #1}} \newcommand{\crossp}[2]{\vec #1 \times \vec #2} \newcommand{\veci}{\vec i} \newcommand{\vecj}{\vec j} \newcommand{\veck}{\vec k} \newcommand{\vecu}{\vec u} \newcommand{\vecv}{\vec v} \newcommand{\vecw}{\vec w} \newcommand{\vecx}{\vec x} \newcommand{\vecy}{\vec y} \newcommand{\vrp}{\vec r\, '} \newcommand{\vsp}{\vec s\, '} \newcommand{\vrt}{\vec r(t)} \newcommand{\vst}{\vec s(t)} \newcommand{\vvt}{\vec v(t)} \newcommand{\vat}{\vec a(t)} \newcommand{\px}{\partial x} \newcommand{\py}{\partial y} \newcommand{\pz}{\partial z} \newcommand{\pf}{\partial f} \newcommand{\mathN}{\mathbb{N}} \newcommand{\zerooverzero}{\ds \raisebox{8pt}{\text{``\ }}\frac{0}{0}\raisebox{8pt}{\textit{ ''}}} \newcommand{\deriv}[2]{\myds\frac{d}{dx}\left(#1\right)=#2} \newcommand{\myint}[2]{\myds\int #1\ dx= {\ds #2}} \DeclareMathOperator{\sech}{sech} \DeclareMathOperator{\csch}{csch} \newcommand{\primeskip}{\hskip.75pt} \newcommand{\plotlinecolor}{blue} \newcommand{\colorone}{blue} \newcommand{\colortwo}{red} \newcommand{\coloronefill}{blue!15!white} \newcommand{\colortwofill}{red!15!white} \newcommand{\abs}[1]{\left\lvert #1\right\rvert} \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \)

Section12.6Directional Derivatives

Partial derivatives give us an understanding of how a surface changes when we move in the \(x\) and \(y\) directions. We made the comparison to standing in a rolling meadow and heading due east: the amount of rise/fall in doing so is comparable to \(f_x\text{.}\) Likewise, the rise/fall in moving due north is comparable to \(f_y\text{.}\) The steeper the slope, the greater in magnitude \(f_y\text{.}\)

But what if we didn't move due north or east? What if we needed to move northeast and wanted to measure the amount of rise/fall? Partial derivatives alone cannot measure this. This section investigates directional derivatives, which do measure this rate of change.

We begin with a definition.

Definition12.6.1Directional Derivatives

Let \(z=f(x,y)\) be continuous on an open set \(S\) and let \(\vec u = \la u_1,u_2\ra\) be a unit vector. For all points \((x,y)\text{,}\) the directional derivative of \(f\) at \((x,y)\) in the direction of \(\vec u\) is \begin{equation*} D_{\vec u\,}f(x,y) = \lim_{h\to 0} \frac{f(x+hu_1,y+hu_2) - f(x,y)}h. \end{equation*}

The partial derivatives \(f_x\) and \(f_y\) are defined with similar limits, but only \(x\) or \(y\) varies with \(h\text{,}\) not both. Here both \(x\) and \(y\) vary with a weighted \(h\text{,}\) determined by a particular unit vector \(\vec u\text{.}\) This may look a bit intimidating but in reality it is not too difficult to deal with; it often just requires extra algebra. However, the following theorem reduces this algebraic load.

Example12.6.3Computing directional derivatives

Let \(z= 14-x^2-y^2\) and let \(P=(1,2)\text{.}\) Find the directional derivative of \(f\text{,}\) at \(P\text{,}\) in the following directions:

  1. toward the point \(Q=(3,4)\text{,}\)

  2. in the direction of \(\la 2,-1\ra\text{,}\) and

  3. toward the origin.

Solution

As we study directional derivatives, it will help to make an important connection between the unit vector \(\vec u = \la u_1,u_2\ra\) that describes the direction and the partial derivatives \(f_x\) and \(f_y\text{.}\) We start with a definition and follow this with a Key Idea.

Definition12.6.5Gradient

Let \(z=f(x,y)\) be differentiable on an open set \(S\) that contains the point \((x_0,y_0)\text{.}\)

  1. The gradient of \(f\) is \(\nabla f(x,y) = \la f_x(x,y),f_y(x,y)\ra\text{.}\)

  2. The gradient of \(f\) at \((x_0,y_0)\) is \(\nabla f(x_0,y_0) = \la f_x(x_0,y_0),f_y(x_0,y_0)\ra\text{.}\)

The symbol “\(\nabla\)” is named “nabla,” derived from the Greek name of a Jewish harp. Oddly enough, in mathematics the expression \(\nabla f\) is pronounced “del \(f\text{.}\)”

To simplify notation, we often express the gradient as \(\nabla f = \la f_x, f_y\ra\text{.}\) The gradient allows us to compute directional derivatives in terms of a dot product.

Key Idea12.6.6The Gradient and Directional Derivatives

The directional derivative of \(z=f(x,y)\) in the direction of \(\vec u\) is \begin{equation*} D_{\vec u\,}f = \nabla f\cdot \vec u. \end{equation*}

The properties of the dot product previously studied allow us to investigate the properties of the directional derivative. Given that the directional derivative gives the instantaneous rate of change of \(z\) when moving in the direction of \(\vec u\text{,}\) three questions naturally arise:

  1. In what direction(s) is the change in \(z\) the greatest (i.e., the “steepest uphill”)?

  2. In what direction(s) is the change in \(z\) the least (i.e., the “steepest downhill”)?

  3. In what direction(s) is there no change in \(z\text{?}\)

Using the key property of the dot product, we have \begin{equation} \nabla f\cdot \vec u = \norm{\nabla f}\,\vnorm u \cos(\theta) = \norm{\nabla f}\cos(\theta) , \label{eq_gradient}\tag{12.6.1} \end{equation} where \(\theta\) is the angle between the gradient and \(\vec u\text{.}\) (Since \(\vec u\) is a unit vector, \(\vnorm{u} = 1\text{.}\)) This equation allows us to answer the three questions stated previously.

  1. Equation (12.6.1) is maximized when \(\cos(\theta) =1\text{,}\) i.e., when the gradient and \(\vec u\) have the same direction. We conclude the gradient points in the direction of greatest \(z\) change.

  2. Equation (12.6.1) is minimized when \(\cos(\theta) = -1\text{,}\) i.e., when the gradient and \(\vec u\) have opposite directions. We conclude the gradient points in the opposite direction of the least \(z\) change.

  3. Equation (12.6.1) is 0 when \(\cos(\theta) = 0\text{,}\) i.e., when the gradient and \(\vec u\) are orthogonal to each other. We conclude the gradient is orthogonal to directions of no \(z\) change.

This result is rather amazing. Once again imagine standing in a rolling meadow and face the direction that leads you steepest uphill. Then the direction that leads steepest downhill is directly behind you, and side–stepping either left or right (i.e., moving perpendicularly to the direction you face) does not change your elevation at all.

Recall that a level curve is defined as a curve in the \(x\)-\(y\) plane along which the \(z\)-values of a function do not change. Let a surface \(z=f(x,y)\) be given, and let's represent one such level curve as a vector–valued function, \(\vrt = \la x(t), y(t)\ra\text{.}\) As the output of \(f\) does not change along this curve, \(f\big(x(t),y(t)\big) = c\) for all \(t\text{,}\) for some constant \(c\text{.}\)

Since \(f\) is constant for all \(t\text{,}\) \(\frac{df}{dt} = 0\text{.}\) By the Multivariable Chain Rule, we also know \begin{align*} \frac{df}{dt} \amp = f_x(x,y)x'(t) + f_y(x,y)y'(t)\\ \amp = \la f_x(x,y),f_y(x,y)\ra \cdot \la x'(t),y'(t)\ra\\ \amp = \nabla f \cdot \vrp(t)\\ \amp =0. \end{align*}

This last equality states \(\nabla f \cdot \vrp(t) = 0\text{:}\) the gradient is orthogonal to the derivative of \(\vec r\text{,}\) meaning the gradient is orthogonal to \(\vec r\) itself. Our conclusion: at any point on a surface, the gradient at that point is orthogonal to the level curve that passes through that point.

We restate these ideas in a theorem, then use them in an example.

Example12.6.8Finding directions of maximal and minimal increase

Let \(f(x,y) = \sin(x) \cos(y)\) and let \(P=(\pi/3,\pi/3)\text{.}\) Find the directions of maximal/minimal increase, and find a direction where the instantaneous rate of \(z\) change is 0.

Solution
Example12.6.12Understanding when \(\nabla f = \vec 0\)

Let \(f(x,y) = -x^2+2x-y^2+2y+1\text{.}\) Find the directional derivative of \(f\) in any direction at \(P=(1,1)\text{.}\)

Solution

The fact that the gradient of a surface always points in the direction of steepest increase/decrease is very useful, as illustrated in the following example.

Example12.6.14The flow of water downhill

Consider the surface given by \(f(x,y)= 20-x^2-2y^2\text{.}\) Water is poured on the surface at \((1,1/4)\text{.}\) What path does it take as it flows downhill?

Solution

Subsection12.6.1Functions of Three Variables

The concepts of directional derivatives and the gradient are easily extended to three (and more) variables. We combine the concepts behind Definitions 12.6.1 and 12.6.5 and Theorem 12.6.2 into one set of definitions.

Definition12.6.18Directional Derivatives and Gradient with Three Variables

Let \(w=F(x,y,z)\) be differentiable on an open ball \(B\) and let \(\vec u\) be a unit vector in \(\mathbb{R}^3\text{.}\)

  1. The gradient of \(F\) is \(\nabla F = \la F_x,F_y,F_z\ra\text{.}\)

  2. The directional derivative of \(F\) in the direction of \(\vec u\) is \begin{equation*} D_{\vec u\,}F=\nabla F\cdot \vec u. \end{equation*}

The same properties of the gradient given in Theorem 12.6.7, when \(f\) is a function of two variables, hold for \(F\text{,}\) a function of three variables.

We interpret the third statement of the theorem as “the gradient is orthogonal to level surfaces,” the three–variable analogue to level curves.

Example12.6.20Finding directional derivatives with functions of three variables

If a point source \(S\) is radiating energy, the intensity \(I\) at a given point \(P\) in space is inversely proportional to the square of the distance between \(S\) and \(P\text{.}\) That is, when \(S=(0,0,0)\text{,}\) \(\ds I(x,y,z) = \frac{k}{x^2+y^2+z^2}\) for some constant \(k\text{.}\)

Let \(k=1\text{,}\) let \(\vec u = \la 2/3, 2/3, 1/3\ra\) be a unit vector, and let \(P = (2,5,3)\text{.}\) Measure distances in inches. Find the directional derivative of \(I\) at \(P\) in the direction of \(\vec u\text{,}\) and find the direction of greatest intensity increase at \(P\text{.}\)

Solution

The directional derivative allows us to find the instantaneous rate of \(z\) change in any direction at a point. We can use these instantaneous rates of change to define lines and planes that are tangent to a surface at a point, which is the topic of the next section.

Subsection12.6.2Exercises

In the following exercises, a function \(z=f(x,y)\) is given. Find \(\nabla f\text{.}\)

In the following exercises, a function \(z=f(x,y)\) and a point \(P\) are given. Find the directional derivative of \(f\) in the indicated directions. Note: these are the same functions as in Exercises 12.6.2.712.6.2.12.

In the following exercises, a function \(z=f(x,y)\) and a point \(P\) are given.

  1. Find the direction of maximal increase of \(f\) at \(P\text{.}\)

  2. What is the maximal value of \(D_{\vec u}\,f\) at \(P\text{?}\)

  3. Find the direction of maximal decrease in \(f\) at \(P\text{.}\)

  4. Give a direction \(\vec u\) such that \(D_{\vec u}\,f=0\) at \(P\text{.}\)

Note: these are the same functions and points as in Exercises 12.6.2.13 through 12.6.2.18.

In the following exercises, a function \(w=F(x,y,z)\text{,}\) a vector \(\vec v\) and a point \(P\) are given.

  1. Find \(\nabla F(x,y,z)\text{.}\)

  2. Find \(D_{\vec u}\,F\) at \(P\text{.}\)