M408M Learning Module Pages

Main page

Chapter 10: Parametric Equations and Polar Coordinates

Chapter 12: Vectors and the Geometry of Space


Chapter 13: Vector Functions


Chapter 14: Partial Derivatives


Learning module LM 14.1: Functions of 2 or 3 variables:

Learning module LM 14.3: Partial derivatives:

Learning module LM 14.4: Tangent planes and linear approximations:

Learning module LM 14.5: Differentiability and the chain rule:

Learning module LM 14.6: Gradients and directional derivatives:

      Gradients
      Gradients and hill climbing
      Wind and weather
      Directional derivatives
      Worked problems

Learning module LM 14.7: Local maxima and minima:

Learning module LM 14.8: Absolute maxima and Lagrange multipliers:

Chapter 15: Multiple Integrals



Directional derivatives

Directional Derivatives

We defined the partial derivatives $f_x$ and $f_y$ to be the rate at which the function $f(x,y)$ changes as we move parallel to the coordinate axes. That is, due east or due north. Often we are interested in the rate at which $f(x,y)$ changes as we move northeast, or southwest, or 37 degrees south of east. These rates of change as we move in a particular direction are called directional derivatives. Suppose that ${\bf u} = h\,{\bf i} + k\, {\bf j}$ is a unit vector.

Definition: The Directional Derivative of $f(x, \,y)$ at $(a, b)$ in the direction $\bf u$ is defined by $$(D_{\bf u}f)(a,\, b) \ = \ \lim_{t \to 0} \frac{f(a+th, b+tk) - f(a, b)}{t} \,.$$ Of course, $$D_{\bf i}f(a,\,b) \ = \ \frac{\partial f}{\partial x}\Bigl|_{(a,\,b)}\,,\qquad \qquad D_{\bf j}f(a,\,b) \ = \ \frac{\partial f}{\partial y}\Bigl|_{(a,\,b)}\,.$$

By the Chain Rule for Paths, if ${\bf r}(t) = {\bf a} + t\,{\bf u}$ is the equation in vector form of the line through $P(a,\,b)$ in the direction $\bf u$, then $$\frac{d}{dt} f({\bf r}(t)) \ = \ (\nabla f)({\bf r}(t))\Big|_{{\bf r}(t)} \, {\bf r}'(t) \ = \ (\nabla f)({\bf r}(t))\Big|_{(a,\,b)}\, {\Large \cdot} \ {\bf u}\,,$$ since ${\bf r}'(t) = {\bf v}$. Consequently,

The Directional Derivative of $f(x,\, y)$ at $(a, \, b)$ in the direction of the unit vector $\mathbf u$ is the component $$D_{\bf u}f(a,\,b) \ = \ (\nabla f)(a,\,b) \, {\Large \cdot} \ {\bf u}$$ of the Gradient $(\nabla f) (a,\, b)$.

If ${\bf u}$ is pointing an angle $\theta$ counterclockwise of the positive $x$-axis, then ${\bf u} = \cos(\theta) {\bf i} + \sin(\theta) {\bf j}$, and $$D_{\bf u}f(a,\,b) \ = \ \cos(\theta) f_x(a,\,b) + \sin(\theta) f_y(a,\,b).$$


Directional derivatives of functions of three variables work similarly, only with one more term. That is, $$D_{\bf u}f(a,\,b,\,c) \ = \ (\nabla f)(a,\,b,\,c) \, {\Large \cdot} \ {\bf u} \ = \ u_1 f_x(a,\,b,\,c) + u_2 f_y(a,\,b,\,c) + u_3 f_z(a,\,b,\,c)\,.$$


We now turn to the geometry of directional derivatives and gradients. By the definition of the dot product, $$ D_{{\bf u}}f(a,\,b) \ = \ \bigl \| (\nabla f)(a,\, b)\bigl \| \,\bigl\| {\bf u} \bigr\| \cos (\phi) \ = \ \bigl \| (\nabla f)(a,\, b)\bigl \| \,\cos (\phi) $$ where $\phi$ is the angle between $(\nabla f)(a,\, b)$ and $\bf u$. (We call this angle $\phi$ rather than $\theta$ since $\theta$ is the angle between ${\bf u}$ and the $x$-axis.) Thus $ D_{{\bf u}}f(a,\,b)$ will be maximized when $\cos (\phi) = 0$, i.e., when $Df_{{\bf u}}(a,\,b)$ and $(\nabla f)(a,\, b) $ are parallel and point in the same direction. This shows that at $(a,\, b)$

     the length of $(\nabla f)(a,\, b)$ is the maximum value of $D_{\bf u}f(a,\,b)$,

     $(\nabla f)(a,\, b)$ points in the direction of the maximum value of $D_{\bf u}f(a,\,b)\,.$

These results are essentially the same as the properties of the gradient on the previous page, only viewed in terms of directional derivatives rather than slopes of tangent lines.

If ${\bf u}$ is tangent to a level curve of the function $f(x,\,y)$ (or a level surface of $f(x,\,y,\,z)$), then the directional derivative $D_{\bf u}f$ is zero. Since $D_{\bf u}f = {\bf u} \cdot \nabla f$, this shows yet again that gradient vectors are perpendicular to level surfaces.

Finally, we consider directional derivatives described by vectors that aren't unit vectors. If ${\bf v}$ is any nonzero vector, then the directional derivative in the direction of ${\bf v}$ is $D_{\bf u}f$, where ${\bf u} = {\bf v}/\|{\bf v}\|$ is the unit vector pointing in the same direction as ${\bf v}$.

Example: Find the directional derivative of $f(x,y,z)=x^2+y^2+z^2$ at $(1,2,1)$ in the direction of the vector ${\bf v} = \langle 1,2,2 \rangle$.

Solution: We first compute ${\bf u}= {\bf v}/\|{\bf v}\|= \langle 1,\,2,\,2\rangle/3$.
Then we compute the gradient $\nabla f = \langle 2x,\, 2y,\, 2z \rangle$ and evaluate it at $(1,2,1)$ to get $\langle 2,\, 4, \,2 \rangle$. Finally we compute $$D_{\bf u} f = {\bf u} \cdot \nabla f = \frac{14}{3}.$$

[Warning: When ${\bf v}$ isn't a unit vector, some authors define $D_{\bf v}f$ to be ${\bf v} \cdot \nabla f$, while other authors define $D_{\bf v}f$ to be $D_{\bf u}f = {\bf v} \cdot \nabla f/\|{\bf v}\|$. To avoid this ambiguity, we will only use the notation $D_{\bf v}f$ when ${\bf v}$ is a unit vector.]