Tutorials › Calculus III › Related Rates in Scalar Fields

Directional Derivatives and Gradients · Tutorial 392 of 999

Related Rates in Scalar Fields

Combine a field’s gradient with an object’s velocity to calculate and interpret the field’s instantaneous rate of change along its motion.

Intermediate 10 min read

What You'll Learn

  • State the conditions for differentiating a scalar field along a path.
  • Apply the gradient–velocity dot product to calculate an instantaneous rate.
  • Distinguish a rate per unit distance from a rate per unit time.
  • Interpret positive, negative, and zero rates of change.
  • Check a related-rates result by differentiating the field along the path.

Introduction

An object moving through a region may experience a changing temperature, pressure, or elevation. To find the instantaneous rate of that change, we need both a description of the field and a description of the object’s motion.

A scalar field assigns one number to each position. A path describes how position changes with time. The gradient records how the field changes with position, while velocity records how position changes with time. Their dot product gives the field’s rate of change along the motion.

Key idea: The rate of change of a differentiable scalar field along a differentiable path is the dot product of the field’s gradient and the path’s velocity.

Scalar Fields and Motion

For a field in two or three spatial dimensions, write \(f:\mathbb{R}^n\to\mathbb{R}\), where \(n=2\) or \(n=3\). A path is a vector-valued function \(\mathbf{r}(t)\) that gives the object’s position at time \(t\). The value of the field experienced by the moving object is the composite function \(f(\mathbf{r}(t))\).

For example, if \(T(x,y)\) gives temperature at each point in a region and \(\mathbf{r}(t)=(x(t),y(t))\) describes an object’s position, then \(T(\mathbf{r}(t))\) is the temperature experienced by the object over time. The related-rates question asks for the derivative of this quantity with respect to time.

Definition: Suppose \(f:\mathbb{R}^n\to\mathbb{R}\) is differentiable at \(\mathbf{r}(t_0)\), and the path \(\mathbf{r}(t)\) is differentiable at \(t_0\). The instantaneous rate of change of \(f\) along the path at \(t_0\) is \[ \left.\frac{d}{dt}f(\mathbf{r}(t))\right|_{t=t_0}. \] The velocity at that time is \(\mathbf{r}'(t_0)\).

The Gradient–Velocity Formula

The gradient contains the spatial partial derivatives of the field. The path’s velocity gives the rates of change of its spatial coordinates. Combining them by the chain rule gives the desired rate.

Theorem: If \(f:\mathbb{R}^n\to\mathbb{R}\) is differentiable at \(\mathbf{r}(t_0)\), and \(\mathbf{r}\) is differentiable at \(t_0\), then \[ \left.\frac{d}{dt}f(\mathbf{r}(t))\right|_{t=t_0} = \nabla f(\mathbf{r}(t_0))\cdot\mathbf{r}'(t_0). \]

In two variables, this says that if \(\mathbf{r}(t)=(x(t),y(t))\), then the rate is \(f_x x'(t)+f_y y'(t)\), with the partial derivatives evaluated at the current position. In three variables, the corresponding sum has three terms. The formula requires differentiability of the field at the position in question and differentiability of the path at the time in question.

Why the Formula Works

The formula follows because a small change in position produces, to first order, a change in the field given by the gradient dotted with that displacement. The path’s velocity is the displacement per unit time in the limit.

1
Approximate the field’s change.
At a differentiability point, a small spatial displacement \(\Delta\mathbf{r}\) changes the field by \(\nabla f(\mathbf{r}(t_0))\cdot\Delta\mathbf{r}\), up to an error that is smaller than the displacement.
2
Use the path’s velocity.
For a time increment \(h\), differentiability of the path gives \(\mathbf{r}(t_0+h)-\mathbf{r}(t_0)=h\mathbf{r}'(t_0)+o(|h|)\).
3
Divide by elapsed time.
Substitute the path displacement into the field approximation and divide by \(h\). As \(h\) tends to zero, the error divided by \(h\) tends to zero, leaving \(\nabla f(\mathbf{r}(t_0))\cdot\mathbf{r}'(t_0)\).

More explicitly, differentiability of \(f\) gives a remainder \(o(\|\Delta\mathbf{r}\|)\), meaning that the remainder divided by \(\|\Delta\mathbf{r}\|\) tends to zero as the displacement tends to zero. Since \(\Delta\mathbf{r}/h\) tends to the finite vector \(\mathbf{r}'(t_0)\), the displacement is \(O(|h|)\). Therefore the remainder divided by \(h\) tends to zero, which justifies the limit and the formula.

Worked Examples

Worked Example: Temperature Along a Moving Path

Suppose the temperature field is \(T(x,y)=100-x^2-2y^2\) degrees Celsius, with \(x\) and \(y\) measured in kilometres. At time \(t=0\), an object is at \((1,2)\) and has velocity \((3,-1)\) kilometres per hour. Find the instantaneous rate of change of temperature.

First find the gradient:

$$ \nabla T(x,y)=(-2x,-4y). $$

Evaluate it at the object’s position:

$$ \nabla T(1,2)=(-2,-8). $$

Now take the dot product with the velocity:

$$ \frac{dT}{dt} = (-2,-8)\cdot(3,-1) = (-2)(3)+(-8)(-1) = -6+8 = 2. $$

The temperature is increasing at \(2\) degrees Celsius per hour at that instant. Check by writing the path as \(x(t)=1+3t\), \(y(t)=2-t\). Then

$$ T(\mathbf{r}(t)) = 100-(1+3t)^2-2(2-t)^2, $$

so differentiation gives \(\frac{dT}{dt}=-6(1+3t)+4(2-t)\). At \(t=0\), this is \(-6+8=2\), matching the gradient–velocity calculation.

Worked Example: Pressure in Three Dimensions

Consider a pressure model \(P(x,y,z)=x^2y+3z\), measured in kilopascals, with dimensionless spatial coordinates. At \(t=0\), an object is at \((1,2,0)\) and moves with velocity \((2,-1,3)\) coordinate units per hour. Find the pressure’s instantaneous rate of change.

The gradient is

$$ \nabla P(x,y,z)=(2xy,x^2,3). $$

At the specified position,

$$ \nabla P(1,2,0)=(2(1)(2),1^2,3)=(4,1,3). $$

Thus

$$ \frac{dP}{dt} = (4,1,3)\cdot(2,-1,3) = 4(2)+1(-1)+3(3) = 8-1+9 = 16. $$

The pressure is increasing at \(16\) kilopascals per hour. To check, the path is \((1+2t,2-t,3t)\), so the pressure along it is \((1+2t)^2(2-t)+9t\). Differentiating the product gives \(4(1+2t)(2-t)-(1+2t)^2+9\). At \(t=0\), the result is \(8-1+9=16\), as required.

Worked Example: Elevation and a Change of Direction

Let \(H(x,y)=x^2+xy+2y^2\) be an elevation model in metres, where the horizontal coordinates are measured in kilometres. At the position \((2,1)\), an object moves with velocity \((-1,2)\) kilometres per hour. Find its instantaneous elevation rate.

Compute the partial derivatives and evaluate them at the position:

$$ \nabla H(x,y)=(2x+y,x+4y), \qquad \nabla H(2,1)=(2(2)+1,2+4(1))=(5,6). $$

The rate is

$$ \frac{dH}{dt} = (5,6)\cdot(-1,2) = 5(-1)+6(2) = -5+12 = 7\text{ metres per hour}. $$

Although the object moves in the negative \(x\)-direction, its motion in the positive \(y\)-direction contributes more to the elevation change, so the net rate is positive. For a direct check, use \(x(t)=2-t\) and \(y(t)=1+2t\). The derivative of \(H(x(t),y(t))\) at \(t=0\) is \(H_x(2,1)(-1)+H_y(2,1)(2)=-5+12=7\) metres per hour.

Interpreting the Rate and Its Units

The dot product combines the contributions of all coordinate directions. A positive result means the field value is increasing along the motion at that instant; a negative result means it is decreasing. A zero result means there is no instantaneous first-order change along that velocity, though the field may change at later times.

Units provide an important check. If the field is measured in degrees Celsius and position in kilometres, then the gradient is measured in degrees Celsius per kilometre. If velocity is measured in kilometres per hour, the dot product is in degrees Celsius per hour. The velocity should be the actual rate of motion, not merely a direction.

When the velocity is nonzero, let \(\mathbf{u}=\mathbf{r}'(t)/\|\mathbf{r}'(t)\|\) be the unit vector pointing in the direction of travel. The directional derivative in that direction is \(\nabla f\cdot\mathbf{u}\), a rate per unit distance. The rate per unit time is that directional derivative multiplied by the speed \(\|\mathbf{r}'(t)\|\).

A Common Mistake: Using Direction Without Speed

In the temperature example, the velocity is \((3,-1)\), whose speed is \(\sqrt{10}\) kilometres per hour. A common error is to use only the unit direction \((3,-1)/\sqrt{10}\) and report the resulting directional derivative as the rate per hour:

$$ (-2,-8)\cdot\frac{(3,-1)}{\sqrt{10}} = \frac{2}{\sqrt{10}}. $$

This is a rate of \(2/\sqrt{10}\) degrees Celsius per kilometre, not per hour. It describes change per unit distance in the direction of travel. To obtain the time rate, multiply by the speed:

$$ \frac{2}{\sqrt{10}}\cdot\sqrt{10} = 2\text{ degrees Celsius per hour}. $$

Alternatively, use the actual velocity directly in the gradient–velocity formula. That method includes direction and speed together and avoids this unit mismatch.

When the Field Also Depends Explicitly on Time

The formula above treats the field as a fixed spatial field. If a quantity also changes independently with time—for example, if the temperature at each location is changing as the day progresses—write it as \(f(x,y,t)\). Along a path \(\mathbf{r}(t)=(x(t),y(t))\), the total rate then includes both the field’s explicit time change and the change caused by motion through space:

$$ \frac{d}{dt}f(\mathbf{r}(t),t) = \nabla_{\mathbf{r}}f(\mathbf{r}(t),t)\cdot\mathbf{r}'(t) + \frac{\partial f}{\partial t}(\mathbf{r}(t),t). $$

Here \(\nabla_{\mathbf{r}}\) means the gradient with respect to the spatial coordinates only. When the field has no explicit time dependence, the partial derivative with respect to time is zero, leaving the gradient–velocity formula used throughout the examples.

Check Your Understanding

For each question, identify the field, position, and velocity before calculating.

  1. If \(f(x,y)=3x^2+y^2\), a path passes through \((1,2)\) with velocity \((2,-1)\). What is the instantaneous rate of change of \(f\) along the path?
  2. A field has gradient \((4,-3)\) at a point. What is its rate of change along velocity \((1,2)\)? Interpret the sign.
  3. Why does a directional derivative along a unit vector generally not equal the time rate of change for a moving object?
  4. If an object’s instantaneous velocity is the zero vector, what does the gradient–velocity formula say about the field’s instantaneous rate along the path?
  5. In the temperature example, what units does the gradient have, and why does its dot product with velocity have units per hour?