Tutorials › Calculus III › Directional Derivatives as Rates Along Lines

Directional Derivatives and Gradients · Tutorial 376 of 999

Directional Derivatives as Rates Along Lines

Learn to compute a directional derivative from its defining limit and interpret it as the instantaneous rate of change along a specified line.

Intermediate 9 min read

What You'll Learn

  • Define the directional derivative using a limit along a line through a point.
  • Interpret the derivative’s sign and magnitude as a rate with respect to the line parameter.
  • Compute directional derivatives directly from the limit in polynomial examples.
  • Distinguish a two-sided directional derivative from a one-sided rate.
  • Identify when a directional derivative does not exist.
  • Avoid confusing a rate along a parameterized line with a rate per unit distance.

Introduction

A scalar function of several variables assigns one numerical output to each point in its domain. If the input point moves, the output may change. A directional derivative measures the instantaneous change in the function’s value when the input moves along a specified line through a given point.

The key is to turn the motion along a line into a one-variable function. Its ordinary derivative at the starting point is the rate of change we seek. The defining limit also makes clear what the derivative means, when it exists, and how its sign should be interpreted.

Definition: Rate Along a Line

Let \(f:A\to\mathbb{R}\) be a scalar function, where \(A\) contains an open neighborhood of a point \(\mathbf{p}\in\mathbb{R}^n\). Let \(\mathbf{v}\in\mathbb{R}^n\) be a nonzero vector. The line through \(\mathbf{p}\) in the direction \(\mathbf{v}\) can be parameterized as \(\mathbf{p}+t\mathbf{v}\). For sufficiently small \(t\), these points lie in the domain of \(f\).

Definition: The directional derivative of \(f\) at \(\mathbf{p}\) in the direction \(\mathbf{v}\), when the two-sided limit exists as a finite real number, is $$ D_{\mathbf{v}}f(\mathbf{p}) = \lim_{h\to 0} \frac{f(\mathbf{p}+h\mathbf{v})-f(\mathbf{p})}{h}. $$

The numerator records the change in the function’s value after the input moves from \(\mathbf{p}\) to \(\mathbf{p}+h\mathbf{v}\). Dividing by \(h\) gives the average rate of change with respect to the line parameter over that step. Taking the limit as \(h\) approaches zero gives the instantaneous rate at the starting point.

This definition uses a two-sided limit. Thus, values of \(h\) approaching zero from both the positive and negative sides must produce the same finite limit. Some settings use a one-sided limit to describe motion only for positive parameter values; that is a distinct convention, which we will distinguish when needed.

The vector \(\mathbf{v}\) specifies how the line is parameterized, not necessarily a displacement of length one. Consequently, \(D_{\mathbf{v}}f(\mathbf{p})\) is a rate per unit change in the parameter \(h\). If \(\mathbf{v}\) is multiplied by a positive constant, the point moves faster along the same oriented line per unit parameter, and the derivative generally changes by that factor.

Why the Limit Is an Instantaneous Rate

Consider the one-variable function \(g(t)=f(\mathbf{p}+t\mathbf{v})\). It records the values of \(f\) as the input travels along the line, with \(t=0\) corresponding to \(\mathbf{p}\). Applying the ordinary derivative definition to \(g\) at zero gives the following result.

Result: If the line restriction \(g(t)=f(\mathbf{p}+t\mathbf{v})\) is defined near \(t=0\), then \(D_{\mathbf{v}}f(\mathbf{p})\) exists exactly when \(g'(0)\) exists, and in that case $$ D_{\mathbf{v}}f(\mathbf{p})=g'(0). $$

Indeed, by the definition of the one-variable derivative,

$$ g'(0) = \lim_{h\to 0}\frac{g(0+h)-g(0)}{h} = \lim_{h\to 0} \frac{f(\mathbf{p}+h\mathbf{v})-f(\mathbf{p})}{h}. $$

The right-hand side is precisely the defining limit for the directional derivative. This proves the result. It also shows that differentiability of \(f\) in every possible direction is not required merely to define one directional derivative: what matters for this limit is the behavior of \(f\) along the particular line.

When \(f\) depends on two variables, say \(f(x,y)\), and \(\mathbf{p}=(a,b)\), \(\mathbf{v}=(v_1,v_2)\), the points on the line have coordinates \((a+hv_1,b+hv_2)\). Therefore the same definition becomes

$$ D_{\mathbf{v}}f(a,b) = \lim_{h\to 0} \frac{f(a+hv_1,b+hv_2)-f(a,b)}{h}, $$

provided this limit exists. This coordinate form is often convenient for direct calculation.

Worked Examples: Computing and Interpreting the Limit

Worked Example: A Positive Directional Rate

Let \(f(x,y)=x^2+3y\), let \(\mathbf{p}=(1,2)\), and let \(\mathbf{v}=(2,-1)\). Find \(D_{\mathbf{v}}f(1,2)\).

First evaluate the function at the starting point:

$$ f(1,2)=1^2+3(2)=1+6=7. $$

Next, move a parameter distance \(h\) along the given vector. The new point is

$$ (1,2)+h(2,-1)=(1+2h,\,2-h). $$

Evaluate \(f\) there and expand:

$$ \begin{aligned} f(1+2h,2-h) &=(1+2h)^2+3(2-h)\\ &=1+4h+4h^2+6-3h\\ &=7+h+4h^2. \end{aligned} $$

Substitute these values into the defining quotient:

$$ \frac{f(1+2h,2-h)-f(1,2)}{h} = \frac{(7+h+4h^2)-7}{h} = \frac{h+4h^2}{h} = 1+4h $$

for \(h\ne 0\). Hence

$$ D_{\mathbf{v}}f(1,2) = \lim_{h\to 0}(1+4h)=1. $$

The rate is positive, so \(f\) is increasing at the starting point as the input moves in this parameterized direction. As a check, the line restriction is \(g(h)=7+h+4h^2\), whose ordinary derivative is \(g'(h)=1+8h\); thus \(g'(0)=1\), matching the limit.

Worked Example: A Negative Rate and a Change of Scale

Let \(f(x,y)=x^2+y^2\), \(\mathbf{p}=(1,2)\), and \(\mathbf{v}=(-1,0)\). Find the directional derivative and interpret its sign.

The starting value is

$$ f(1,2)=1^2+2^2=5. $$

The point reached after parameter change \(h\) is \((1-h,2)\). Therefore

$$ \begin{aligned} f(1-h,2) &=(1-h)^2+2^2\\ &=1-2h+h^2+4\\ &=5-2h+h^2. \end{aligned} $$

The difference quotient and its limit are

$$ \begin{aligned} \frac{f(1-h,2)-f(1,2)}{h} &=\frac{(5-2h+h^2)-5}{h}\\ &=\frac{-2h+h^2}{h}\\ &=-2+h, \end{aligned} $$

so

$$ D_{\mathbf{v}}f(1,2)=\lim_{h\to 0}(-2+h)=-2. $$

The negative value means the function decreases instantaneously as \(h\) increases from zero along this line. To check, the line restriction is \(g(h)=5-2h+h^2\), so \(g'(h)=-2+2h\) and \(g'(0)=-2\).

Now replace the vector by \(\widetilde{\mathbf{v}}=(-3,0)=3\mathbf{v}\). The point becomes \((1-3h,2)\), and

$$ \begin{aligned} f(1-3h,2)&=(1-3h)^2+4\\ &=1-6h+9h^2+4\\ &=5-6h+9h^2. \end{aligned} $$

Thus its difference quotient is \((-6h+9h^2)/h=-6+9h\), giving \(D_{\widetilde{\mathbf{v}}}f(1,2)=-6\). This agrees with the faster parameterized motion: the rate is three times \(-2\). The sign remains negative because the oriented direction has not changed.

Interpreting the Value and Its Units

The sign and magnitude answer different questions. A positive directional derivative means the function increases instantaneously as the parameter increases; a negative derivative means it decreases; and a zero derivative means there is no first-order change along that line at the point. The magnitude measures how rapidly the output changes per unit change in the line parameter.

For example, if \(f\) represents temperature and the line parameter measures seconds, the derivative has units of temperature per second. If the parameter instead measures distance along the line, the rate has units of temperature per distance. The vector determines the input displacement associated with one unit of parameter, so interpreting the rate requires knowing how that parameter is being used.

A zero directional derivative does not, by itself, say that \(f\) is constant along the whole line. It only says that the instantaneous rate at the specified point is zero. Likewise, a positive rate at one point does not guarantee that the function increases over a long interval; its rate could change farther along the line.

When the Two-Sided Directional Derivative Fails

Worked Example: A One-Sided Rate Without a Two-Sided Derivative

Let \(f(x,y)=|y|\), \(\mathbf{p}=(0,0)\), and \(\mathbf{v}=(0,1)\). Along this line, the input is \((0,h)\). Since \(f(0,0)=0\), the difference quotient is

$$ \frac{f(0,h)-f(0,0)}{h} = \frac{|h|}{h}. $$

For \(h>0\), this quotient equals \(1\). For \(h<0\), it equals \(-1\). The two one-sided limits are therefore

$$ \lim_{h\to 0^+}\frac{|h|}{h}=1, \qquad \lim_{h\to 0^-}\frac{|h|}{h}=-1. $$

Because they are unequal, the two-sided directional derivative does not exist. Under a one-sided convention, the rate for positive \(h\) would be \(1\). The check is direct: the line restriction is \(g(h)=|h|\), which has unequal left and right derivatives at zero.

This example emphasizes that evaluating the quotient on only one side is not enough for the two-sided definition. A finite answer from positive \(h\) does not establish that the two-sided directional derivative exists.

A Common Mistake: Forgetting to Divide by the Parameter Change

In the negative-rate example, the change in function value was \(-2h+h^2\). A tempting but incorrect calculation is to let \(h\) approach zero in this change and conclude that the rate is zero:

$$ \lim_{h\to 0}(-2h+h^2)=0. $$

This computes the limiting change in the function value, not the rate of change. The derivative requires dividing that change by \(h\) before taking the limit:

$$ \lim_{h\to 0}\frac{-2h+h^2}{h} = \lim_{h\to 0}(-2+h) = -2. $$

The division removes the scale of the small parameter step and reveals the instantaneous rate. Always form the complete difference quotient first, simplify it for \(h\ne 0\), and only then take the limit.

Check Your Understanding

Use the line-limit definition in each question. Pay attention to whether the limit is two-sided and to what the parameter measures.

  1. For \(f(x,y)=x+2y\), \(\mathbf{p}=(1,0)\), and \(\mathbf{v}=(1,1)\), write the difference quotient and compute the directional derivative.
  2. In the definition of \(D_{\mathbf{v}}f(\mathbf{p})\), what does a negative value tell you about the function as \(h\) increases from zero?
  3. If the direction vector is replaced by \(3\mathbf{v}\), what happens to the parameterized path and its rate, when the directional derivative exists?
  4. For \(f(x,y)=|y|\) at \((0,0)\) in direction \((0,1)\), why does the two-sided directional derivative fail to exist?
  5. What is the difference between the change \(f(\mathbf{p}+h\mathbf{v})-f(\mathbf{p})\) and the difference quotient used to define a directional derivative?