Directional Derivatives and the Gradient
Directional derivatives
Suppose is a function of two variables and is a point in the domain of . Its partial derivatives and are the slope of the curve on the graph of in the direction of x-axis and y-axis respectively. In fact, we can also consider the slope of the curve on the graph in any direction. Let be a unit vector. We have the following definition:
Definition: The directional derivative of at in the direction of , denoted by , is as follows:
(Note: By definition, and .)
The applet below illustrates the geometric meaning of directional derivatives of a function of two variables. You can drag the point and the red unit vector to see the change in the value of .
For a function of three variables , we can define its directional derivative in a similar way. Let be a point in the domain of and be a unit vector in . Then we have the following definition:
Definition: The directional derivative of at in the direction of is
The following useful theorem is a formula for computing directional derivatives:
Theorem: Suppose and is a unit vector in , then
For and is a unit vector in , then
Proof:
We only prove the result for functions of two variables here. The three variable version can be proved by similar argument.
Let and . By chain rule, we have
Example: Let and . Find the directional derivative of at in the direction of .
Answer:
and . Moreover, it can be easily checked that is already a unit vector.
(If the given vector is not a unit vector, we need to first normalize it into a unit vector pointing towards the same direction.)
Exercise: Let and . Find the directional derivative of at in the direction of .
Remark: For any unit vector in , it can be written as , where is the angle measured from the positive x-axis to the direction of in anticlockwise direction. Therefore, we have the following formula for directional derivatives in terms of :
Gradient
Suppose is a function of two variables that is differentiable at . The gradient of at is the vector in , denoted by , is defined as follows:
Similarly, let be a function of three variables that is differentiable at . The gradient of at is
Then by the theorem above, for any unit vector in ,
For any unit vector in ,
Remark: When , all directional derivatives of at is zero.
Geometric meaning of gradient
Let be a differentiable function of two variables and be any unit vector. Then we have
where is the angle between and . Then when will the directional derivative be the maximum/minimum?
has the greatest value when (). Therefore, attains its maximum value when i.e. and are in the same direction. Moreover, the maximum value of is .
has the smallest value when (. Therefore, attains its minimum value when i.e. and are in opposite directions. Moreover, the minimum value of is .
Geometrically, the above results imply that when we consider point and its corresponding point on the graph of , the slope of the curve in the direction of the gradient of at is the greatest i.e. the is direction when the steepest ascent occurs at . On the other hand, is direction when the steepest descent occurs at .
In the applet below, you can check the checkbox "Gradient" to reveal the gradient of the function and its norm.
Example: Suppose . Find the directions of the steepest ascent and descent on the graph of when . Moreover, find the maximum rate of the steepest ascent.
Answer: and . Therefore, we have
, which is the direction of the steepest ascent. Moreover, is the direction of the steepest descent.
The maximum rate of ascent at is .
Exercise: Let . Find the maximum value of the directional derivative of at .
Gradient and level curves
Suppose is a differentiable function and is any real number. Then the equation of the level curve of when is . Suppose such level curve is parametrized by . Then we have
Differentiate both sides and use chain rule, we have
Therefore, is orthogonal to the tangent vector of the level curve for all .
In the applet above, you can check the checkbox "Level curve" to reveal the level curve. You can see that the gradient vector is always normal to the level curve i.e. orthogonal to the tangent vector of the level curve.
Exercise: Let . Find the equation of line tangent to the level curve at .
Gradient and level surfaces
Suppose is a function of three variables such that its partial derivatives are all continuous (Note: This implies that is differentiable). Let be any real number. Then the equation of the level surface of when is
Consider any curve in the level surface, which is parametrized by . Then we have
Differentiate both sides and use chain rule, we have
Therefore, is orthogonal to the tangent vector at for any . Fix and let . Then is orthogonal to the tangent vector of any curve on the level surface at . In other words, if is non-zero, then it is normal to the tangent plane of the level surface at .
Therefore, if , the equation of the plane tangent to the level surface at is
,
or more explicitly,
In the applet below, the level surface is shown. For any point in the level surface, the gradient vector is normal to the tangent plane of the level surface at .
Exercise: Find the equation of the tangent plane of a unit sphere centered at the origin at the point .