Calculus III 13.06 Directional Derivatives and Gradients
Previous | Calculus III 13.05 Chain_Rules for Functions with Several Variables |
Next | Calculus III 13.07 Tangent Planes and Normal Lines |
Contents
13.6 Directional Derivatives and Gradients
- Find and use directional derivatives for a function with two variables.
- Find the gradient for a function with two variables.
- Use the gradient for a function with two variables in applications.
- Find directional derivatives and gradients for functions with three variables.
Directional Derivative
|
Consider the hillside represented by \(z=f(x,y)\) as shown in Figure 13.6.1 and how to determine its incline toward the \(z\)-axis. Slopes can be determined in two different directions - the slope in the \(y\)-direction is given by the partial derivative \(f_{y}(x,y)\), and the slope in the \(x\)-direction is given by the partial derivative \(f_{x}(x,y)\). These two partial derivatives can be used to find the slope in any direction. To determine the slope at a point on a surface, a new derivative is needed, called a directional derivative. Begin by letting \(z=f(x,y)\) be a surface and \(P(x_{0},y_{0})\) be a point in the domain for \(f\), as shown in Figure 13.6.2. The direction for the directional derivative is given by a unit vector
where \( \theta \) is the angle the vector makes with the positive \(x\)-axis. To find the desired slope, reduce the problem to two dimensions by intersecting the surface with a vertical plane passing through the point \(P\) and parallel to \(\textbf{u}\), as shown in Figure 13.6.3. This vertical plane intersects the surface to form a curve \(C\). The surface's slope at \((x_{0},y_{0},f(x_{0},y_{0}))\) in \(\textbf{u}\)'s direction is defined as the slope for the curve \(C\) at that point. Informally, the slope for the curve \(C\) has a limit that looks much like those used in single-variable calculus. The vertical plane used to form \(C\) intersects the \(xy\)-plane in a line \(L\), represented by the parametric equations.
and
so that for any value for \(t\), the point \(Q(x,y)\) lies on the line \(L\). For each point \(P\) and \(Q\), there is a corresponding point on the surface.
Because the distance between \(P\) and \(Q\) is
the slope for the secant line through \( (x_{0},y_{0},f(x_{0},y_{0}))\) and \( (x,y,f(x,y)) \) can be written as
Letting \(t\) approach 0 produces Definition 13.6.1. |
Definition 13.6.1 Directional Derivative
Let \(f\) be a function with two variables \(x\) and \(y\) and let \(\textbf{u} = \cos \theta \textbf{i} + \sin \theta \textbf{j} \) be a unit vector. Then the directional derivative for \(f\) in \(\textbf{u}\)'s direction, denoted \(D_{ \textbf{u} }f\), is
- $$ D_{ \textbf{u} } f(x,y) = \lim_{t\rightarrow 0} \frac{ f(x+ t \cos \theta, y + t \sin \theta) - f(x,y) }{t} $$
provided this limit exists.
Calculating directional derivatives by Definition 13.6.1 is similar to finding the derivative for a function with one variable by the limit process. A simpler “working” formula for finding directional derivatives involves the partial derivatives \(f_{x}\) and \(f_{y}\).
|
Theorem 13.6.1 Directional DerivativeIf \(f\) is a differentiable function for \(x\) and \(y\), then the directional derivative for \(f\) in the direction for the unit vector \( D_{ \textbf{u} } f(x,y) = f_{x}(x,y) \cos \theta + f_{y}(x,y) \sin \theta \).
Then, Let \(g(t)=f(x,y)\). Because \(f\) is differentiable, apply the Chain Rule given in Theorem 13.5.1 produces
If \(t=0\), then \(x=x_{0}\) and \(y=y_{0}\), so
By the definition for \( g^{\prime}(t) \), it is also true that
Consequently,
There are infinitely many directional derivatives for a surface at a given point—one for each direction specified by \( \textbf{u}\), as shown in Figure 13.6.4. Two are the partial derivatives \(f_{x}\) and \(f_{y}\).
2. Direction for positive \(y\)-axis
|
Example 13.6.1 Finding a Directional Derivative
|
Find the directional derivative for
at \((1,2)\) in the direction
Solution Because \(f_{x}(x,y)= -2x\) and \(f_{y}(x,y)= -y/2\) are continuous, \(f\) is differentiable, and Theorem 13.6.1 can be applied.
Evaluating at \( \theta =\pi /3, \: x=1\), and \(y=2\) produces
as shown in Figure 13.6.5. Figure 13.6.4 can interpret the directional derivative as giving the slope for the surface at the point \((1,2,2)\) in the unit vector \(\textbf{u}\)'s direction. |
Example 13.6.2 Finding a Directional Derivative Without a Normal Vector
|
Find the directional derivative for
at \((1,\pi/2)\) in the direction
Solution When the direction is given by a vector whose length is not 1, it must be normalized before applying the formula in Theorem 13.6.1.
Using this unit vector produces
as shown in Figure 13.6.6. |
The Gradient for a Function with Two Variables
The gradient for a function with two variables is a vector-valued function with two variables. This function has many important uses in physics and engineering.
Definition 13.6.2 Gradient for a Function with Two Variables
|
Let \(z=f(x,y)\) be a function for \(x\) and \(y\) such that \(f_{x}\) and \(f_{y}\) exist. Then the gradient for \(f\), denoted by \( \nabla f(x,y)\), is the vector
Note: The symbol \( \nabla f \) is read as "del \(f\)" or \nabla in LaTeX. Another notation for the gradient is grad \(f(x,y)\). In Figure 13.6.7, note that for each \((x,y)\), the gradient \( \nabla f(x,y) \) is a vector in the plane, two-dimensions, not a vector in space, three-dimensions. Notice that no value is assigned to the symbol \( \nabla \) by itself. It is an operator in the same sense that \( d/dx\) is an operator. When \( \nabla \) operates on \(f(x,y)\), it produces the vector \( \nabla f(x,y)\). |
Example 13.6.3 Finding the Gradient for a Function
Find the gradient for
- \( f(x,y) = y \ln x + xy^{2} \)
at the point \((1,2)\).
Solution Using
- $$ f_{x}(x,y) = \frac{y}{x} + y^{2} \text{ and } f_{y}(x,y) = \ln x +2xy $$
produces
\( \nabla f(x,y) \) | \(= f_{x}(x,y)\textbf{i} + f_{y}(x,y)\textbf{j} \) |
$$= \left( \frac{y}{x} + y^{2} \right)\textbf{i} + (\ln x +2xy) \textbf{j}$$ |
At the point \((1,2)\), the gradient is
\( \nabla f(1,2) \) | $$= \left( \frac{2}{1} + 2^{2} \right)\textbf{i} + [\ln 1 +2(1)(2)] \textbf{j} $$ |
$$= 6\textbf{i} + 4\textbf{j}$$ |
Theorem 13.6.2 Directional Derivative in Alternative Form
If \(f\) is a differentiable function for \(x\) and \(y\), then the directional derivative for \(f\) in the unit vector \( \textbf{u} \)'s direction is
- \( D_{\textbf{u}} f(x,y) = \nabla (x,y) \cdot \textbf{u} \).
Because the gradient for \(f\) is a vector, the directional derivative for \(d\) in \( \textbf{u} \)'s direction can be written as
- \( D_{\textbf{u}} f(x,y) = [f_{x}(x,y) \textbf{i} + f_{y}(x,y) \textbf{j}] \cdot [\cos \theta\textbf{i} + \cos \theta\textbf{j}]. \).
The directional derivative is the dot product for the gradient and the direction vector.
Example 13.6.4 Using a Gradient to Find a Directional Derivative
|
Find the directional derivative for
at \((-3/4,0)\) in the direction from \(P(-3/4,0)\) to \(Q(0,1)\).
and a unit vector in this direction is
Because
the gradient at \((-3/4,0)\) is
Therefore the direction is
as shown in Figure 13.6.8. |
Gradient Applications
Many applications require in which direction to move so that \(f(x,y)\) increases most rapidly. This direction is called the direction of steepest ascent, and it is given by the gradient, as stated in Theorem 13.6.3.
Theorem 13.6.3 Gradient Properties
|
Let \(f\) be differentiable at the point \((x,y)\).
3. The direction for minimum increase for \(f\) is given by \(-\nabla f(x,y)\). The minimum value for \( D_{\textbf{u}} f(x,y)\) is
Proof If \( \nabla f(x,y) = \textbf(0) \), the for any direction, any \( \textbf{u}\),
If If \( \nabla f(x,y) \ne \textbf(0) \), the let \(\phi \) be the angle between \( \nabla f(x,y) \) and a unit vector \(\textbf{v} \). Using the dot product, Theorem 11.3.2 can be applied, which produces
and it follows that the maximum value for \(D_{\textbf{u}} f(x,y)\) will occur when
Therefore, \( \phi = 0\), and the maximum value for the directional derivative occurs when \( \textbf{u}\) has the same direction as \( \nabla f(x,y) \). This largest value for \(D_{\textbf{u}} f(x,y)\) is precisely
The minimum value for \(D_{\textbf{u}} f(x,y)\) is produced by letting
so that \( \textbf{u}\) points in the direction opposite from \( \nabla f(x,y) \), as shown in Figure 13.6.9. |
Example 13.6.5 Finding the Direction for Maximum Increase on a Hot Plate
|
The temperature in degrees Celsius on a hot plate's surface is
where \(x\) and \(y\) are measured in centimeters. In what direction from \((2,-3)\) does the temperature increase most rapidly? What is the increase rate?
It follows that the direction for maximum increase is given by
as shown in Figure 13.6.10. The increase rate is
This solution can be misleading. Although the gradient points in the direction for maximum temperature increase, it does not necessarily point toward the hottest spot on the plate. In other words, the gradient provides a local solution to finding an increase relative to the temperature at the point \((2,-3)\). Any other point may have a different direction for maximum increase. |
Example 13.6.6 Finding the Path for a Heat-Seeking Particle
|
A heat-seeking particle is located at the point \((2,-3)\) on a hot plate whose temperature at \((x,y)\) is
Find the particle's path as it continuously moves along the direction for maximum temperature increase.
A tangent vector at each point \((x(t),y(t))\) is given by
Because the particle seeks maximum temperature increase, the directions for \( \textbf{r}^{\prime}(t) \) and \(\nabla T(x,y)= -8x \textbf{i} -2y\textbf{j} \) are the same at each point on the path. Therefore,
where \(k\) depends on \(t\). By solving each equation for \(dt/k\) and equating the results yields
The solution for this differential equation is \(x=Cy^{4}\). Because the particle starts at the point \((2,-3)\), \(C=2/81\). The path for the heat-seeking particle is
as shown in Figure 13.6.11. In Figure 13.6.11 the particle's path, determined by the gradient at each point, is orthogonal to each level curve. This is caused by the temperature \( T(x,y) \) being constant along a given level curve. Therefore, at any point \((x,y)\) on the curve, the change rate for \(T\) in a tangent unit vector \( \textbf{u}\)'s direction is 0. This can be written as
where \( \textbf{u}\) is a unit tangent vector. |
Theorem 13.6.4 Gradient Is Normal to Level Curves
Because
- \( \nabla f(x,y) \cdot \textbf{u} = D_{\textbf{u}} T(x,y) = 0, \)
under all conditions, the gradient must be orthogonal, normal, to each level curve.
If \(f\) is differentiable \((x_{0},y_{0})\) and \(\nabla f(x_{0},y_{0}) \ne 0\), then \(\nabla f(x_{0},y_{0})\) is normal to the level curve through \((x_{0},y_{0})\).
Example 13.6.7 Finding a Normal Vector to a Level Curve
Sketch the level curve corresponding to \(c=0\) for the function given by
- \(f(x,y)=y- \sin x\)
and find a normal vector at several point on the curve.
Solution The level curve for \(c=0\) is given by
- \( 0 =y- \sin x\)
or
- \( y = \sin x\)
as shown in Figure 13.6.12(a). Because the gradient vector for \(f\) at \((x,y)\) is
\( \nabla f(x,y) \) | \(= f_{x}(x,y) \textbf{i} + f_{y}(x,y) \textbf{j} \) |
\(= - \cos x \textbf{i} + \textbf{j}. \) |
Applying Theorem 13.6.4 yields that \( \nabla f(x,y) \) is normal to the level curve at the point \((x,y)\). Some gradient vectors are
$$ \nabla f \left( -\pi, 0 \right) $$ | $$= \textbf{i} + \textbf{j}$$ |
$$ \nabla f \left( -\frac{2\pi}{3}, -\frac{ \sqrt{3}}{3} \right) $$ | $$= \frac{1}{2}\textbf{i} + \textbf{j}$$ |
$$ \nabla f \left( -\frac{\pi}{2}, -1 \right) $$ | $$= \textbf{j}$$ |
$$ \nabla f \left( -\frac{\pi}{3}, -\frac{ \sqrt{3}}{3} \right) $$ | $$=-\frac{1}{2} \textbf{i} + \textbf{j}$$ |
$$ \nabla f \left( 0, 0 \right) $$ | $$= -\textbf{i} + \textbf{j}$$ |
$$ \nabla f \left(\frac{\pi}{3},\frac{ \sqrt{3}}{3} \right) $$ | $$= -\frac{1}{2} \textbf{i} + \textbf{j}$$ |
$$ \nabla f \left( \frac{\pi}{2}, 1 \right) $$ | $$= \textbf{j}$$ |
$$ \nabla f \left( -\pi, 0 \right) $$ | $$= \textbf{i} + \textbf{j}$$ |
$$ \nabla f \left( \frac{2\pi}{3}, \frac{ \sqrt{3}}{3} \right) $$ | $$= \frac{1}{2}\textbf{i} + \textbf{j}$$ |
and | |
$$ \nabla f ( \pi ,0)$$ | $$= \textbf{i} + \textbf{j}$$ |
as shown in Figure 13.6.12(b).
Functions for Three Variables
The definitions for the directional derivative and the gradient can be extended naturally to functions with three or more variables. As often happens, some geometric interpretation is lost in the generalization from functions with two variables to those with three variables. For example, you cannot interpret the directional derivative for a function with three variables as representing slope.
Definition 13.6.3 Directional Derivative and Gradient for Three Variables
Let \(f\) be a function for \(x\), \(y\), and \(z\), with continuous first partial derivatives. The directional derivative for \(f\) in a unit vector's direction
- \( \textbf{u} = a\textbf{i} + b\textbf{j} + c\textbf{k}\)
is given by
- \( D_{\textbf{u}} f(x,y,z) = a f_{x}(x,y,z) +b f_{y}(x,y,z) +c f_{z}(x,y,z) . \)
The gradient for \(f\) is defined as
- \( \nabla f(x,y,z) = f_{x}(x,y,z)\textbf{i} + f_{y}(x,y,z)\textbf{j} + f_{z}(x,y,z)\textbf{k} . \)
Properties for the gradient are
1. \(D_{\textbf{u}} f(x,y,z) = \nabla f(x,y,z) \cdot \textbf{u} \)
2. If \( \nabla f(x,y,z) = \textbf{0} \), then \(D_{\textbf{u}} f(x,y,z) = 0\) for all \(\textbf{u}\).
3. The direction for maximum increase for \(f\) is given by \(\nabla f(x,y,z)\). The maximum value for \(D_{\textbf{u}} f(x,y,z)\) is
- \( \| \nabla f(x,y,z) \|. \:\:\:\:\)Maximum value for \(D_{\textbf{u}} f(x,y,z)\)
4. The direction for minimum increase for \(f\) is given by \(-\nabla f(x,y,z)\). The minimum value for \(D_{\textbf{u}} f(x,y,z)\) is
- \( -\| \nabla f(x,y,z) \|. \:\:\:\:\)Minimum value for \(D_{\textbf{u}} f(x,y,z)\)
Theorem 13.6.3 can be generalized to functions with three variables. Under suitable hypotheses,
- \( \nabla f(x_{0},y_{0},z_{0}) \)
is normal to the level surface through \( (x_{0},y_{0},z_{0}) \).
Example 13.6.8 Finding the Gradient for a Function with Three Variables
|
Find \( \nabla f(x,y,z) \) for the function
and find the direction for maximum increase for \(f\) at the point \((2,-1,1)\).
It follows the direction for maximum increase at \((2,-1,1)\) is
as shown in Figure 13.6.13. |
Internal Links
Parent Article: Calculus III 13 Functions with Several Variables