Skip to main content

Section 7.2 Computing a Directional Derivative Using the Definition

Before developing shortcuts, it is worth evaluating a directional derivative directly from DefinitionΒ 7.1, so that the limit behind the definition becomes concrete.

Example 7.6. Example I.

Consider the function \(f(x,y) = 1 + x^2 + y^2\text{,}\) the point \(P_0(1,1)\text{,}\) and the unit vector \(\mathbf u = \dfrac{1}{\sqrt 2}\mathbf i + \dfrac{1}{\sqrt 2}\mathbf j\text{.}\) Use the definition of directional derivative to compute \(\left(D_{\mathbf u} f\right)_{P_0}\text{.}\)
Solution.
We substitute \(x_0 = y_0 = 1\) and \(u_1 = u_2 = \dfrac{1}{\sqrt 2}\) in the definition:
\begin{align*} \left(\frac{df}{ds}\right)_{\mathbf u,P_0} \amp= \lim_{s\to 0}\frac{f(x_0 + su_1,\, y_0 + su_2) - f(x_0,y_0)}{s}\\ \amp= \lim_{s\to 0} \frac{f\!\left(1 + \tfrac{s}{\sqrt 2},\, 1 + \tfrac{s}{\sqrt 2}\right) - f(1,1)}{s}\\ \amp= \lim_{s\to 0} \frac{1 + \left(1 + \tfrac{s}{\sqrt 2}\right)^2 + \left(1 + \tfrac{s}{\sqrt 2}\right)^2 - 3}{s}\\ \amp= \lim_{s\to 0}\frac{\tfrac{4s}{\sqrt 2} + s^2}{s} = \lim_{s\to 0}\left(\tfrac{4}{\sqrt 2} + s\right)\\ \amp= 2\sqrt 2. \end{align*}
The computation has a useful geometric picture, illustrated in the interactive 3D figure below. Along the ray through \(P_0(1,1)\) in the direction \(\mathbf u\text{,}\) the values of \(f\) are the single-variable function
\begin{align} g(s) \amp= f\!\left(1 + \tfrac{s}{\sqrt 2},\, 1 + \tfrac{s}{\sqrt 2}\right)\notag\\ \amp= 3 + 2\sqrt 2\, s + s^2,\tag{7.2} \end{align}
and the difference quotient in the limit above is the slope of the secant line of \(g\) through \(s = 0\) and \(s\text{.}\) As \(s \to 0\) the secant lines approach the tangent line at \(s = 0\text{,}\) whose slope is \(g'(0) = 2\sqrt 2 = \left(D_{\mathbf u} f\right)_{P_0}\text{.}\)
Instructions.
The surface \(z = 1 + x^2 + y^2\) is cut by the vertical plane through \(P_0(1,1)\) in the direction \(\mathbf u\text{.}\) Drag the slider to change \(s\text{:}\) the point \(P\) slides along \(\mathbf u\) in the \(xy\)-plane, and the secant line through the surface points \((1,\,1,\,f(P_0))\) and \((1+su_1,\,1+su_2,\,f(P))\) rotates toward the tangent line. Press β€œs \(\to\) 0” to animate the limit; the readout shows the secant slope \(2\sqrt 2 + s\) approaching the directional derivative \(2\sqrt 2\text{.}\) Drag the figure to view it from a different angle, or press the β€œRotate” button.
Figure 7.7. The secant line on the surface \(z=1+x^2+y^2\) rotating onto the tangent line as \(s \to 0\text{,}\) giving the directional derivative \(2\sqrt2\text{.}\)

Activity 7.2.1. The Partial Derivatives Are Directional Derivatives.

DefinitionΒ 7.1 measures the rate of change of \(f\) in an arbitrary direction \(\mathbf u\text{.}\) Two directions are already familiar from \(f_x\) and \(f_y\text{.}\) In this activity you will check that the definition reproduces exactly those two derivatives when \(\mathbf u\) points along a coordinate axis. Use only (7.1); nothing beyond the definition is needed.

(a)

Take \(\mathbf u = \mathbf i\text{,}\) so that \(u_1 = 1\) and \(u_2 = 0\text{.}\) Substitute these into (7.1) and simplify. Which single-variable limit is left, and what is its value?
Hint.
Ask yourself which of the two inputs of \(f\) actually changes as \(s\) varies.
Answer.
Substituting \(u_1 = 1\) and \(u_2 = 0\) leaves the second slot of \(f\) fixed at \(y_0\text{:}\)
\begin{align*} \left(\frac{df}{ds}\right)_{\mathbf i,\,P_0} \amp= \lim_{s\to 0}\frac{f(x_0 + s\cdot 1,\; y_0 + s\cdot 0) - f(x_0,y_0)}{s}\\ \amp= \lim_{s\to 0}\frac{f(x_0 + s,\; y_0) - f(x_0,y_0)}{s} = f_x(x_0,y_0). \end{align*}
Only the first variable moves, so this is precisely the limit that defines the partial derivative with respect to \(x\text{.}\) That is, \(\left(D_{\mathbf i} f\right)_{P_0} = f_x(x_0,y_0)\text{.}\)

(b)

Repeat the computation with \(\mathbf u = \mathbf j\text{,}\) and state the conclusion.
Answer.
Now \(u_1 = 0\) and \(u_2 = 1\text{,}\) so the first slot is held at \(x_0\text{:}\)
\begin{align*} \left(\frac{df}{ds}\right)_{\mathbf j,\,P_0} \amp= \lim_{s\to 0}\frac{f(x_0,\; y_0 + s) - f(x_0,y_0)}{s} = f_y(x_0,y_0), \end{align*}
so \(\left(D_{\mathbf j} f\right)_{P_0} = f_y(x_0,y_0)\text{.}\) The partial derivatives are the directional derivatives in the two coordinate directions, and \(D_{\mathbf u} f\) is the common generalization of both.

(c)

Test this on the function of ExampleΒ 7.6. With \(f(x,y) = 1 + x^2 + y^2\) and \(P_0(1,1)\text{,}\) compute \(\left(D_{\mathbf i} f\right)_{P_0}\) straight from the definition, then compute \(f_x(1,1)\) in the usual way and compare.
Answer.
From the definition,
\begin{align*} \left(D_{\mathbf i} f\right)_{P_0} \amp= \lim_{s\to 0}\frac{f(1+s,\,1) - f(1,1)}{s} = \lim_{s\to 0}\frac{\left[1 + (1+s)^2 + 1\right] - 3}{s}\\ \amp= \lim_{s\to 0}\frac{2s + s^2}{s} = \lim_{s\to 0}\,(2 + s)\\ \amp= 2 . \end{align*}
Differentiating instead, \(f_x = 2x\text{,}\) so \(f_x(1,1) = 2\text{.}\) The two agree. By symmetry \(\left(D_{\mathbf j} f\right)_{P_0} = f_y(1,1) = 2\) as well. Note that both are smaller than the value \(2\sqrt 2\) found in ExampleΒ 7.6: the function climbs faster along the diagonal than along either axis.

(d)

Finally, take \(\mathbf u = -\mathbf i\text{.}\) Show that \(\left(D_{-\mathbf i} f\right)_{P_0} = -f_x(x_0,y_0)\text{,}\) and say in a sentence why this is what you should expect.
Answer.
Here \(u_1 = -1\) and \(u_2 = 0\text{,}\) so
\begin{align*} \left(D_{-\mathbf i} f\right)_{P_0} \amp= \lim_{s\to 0}\frac{f(x_0 - s,\; y_0) - f(x_0,y_0)}{s} . \end{align*}
Putting \(h = -s\) turns this into \(-\lim_{h\to 0}\dfrac{f(x_0+h,\,y_0) - f(x_0,y_0)}{h} = -f_x(x_0,y_0)\text{.}\) Walking the opposite way along the same line makes \(f\) change at the same rate with the opposite sign, so reversing \(\mathbf u\) reverses the sign of \(D_{\mathbf u} f\text{.}\)
Every partial derivative is a directional derivative, so nothing already known about \(f_x\) and \(f_y\) is lost. What the definition adds is the freedom to point \(\mathbf u\) anywhere. Keep in mind that this depends on \(\mathbf u\) being a unit vector: the parameter \(s\) measures actual distance travelled in the \(xy\)-plane only when \(|\mathbf u| = 1\text{.}\)
You have attempted of activities on this page.