We have learned that the rates of change of a function along the coordinate axes are its first partial derivatives. Now we want to generalize this concept and find the rate of change of along any arbitrary direction.
Consider a function and a unit vector . Let’s approach to the point along a ray that is parallel to . Then the rate of change of at the point with respect to distance is called the directional derivative of at in the direction .
For a geometrical interpretation, consider the point on the surface and the points and in the -plane, as illustrated in in Fig. 1. Note that is parallel to . The plane through and and perpendicular to the -plane1 intersects the surface in the curve . The slope of the tangent line to the curve at the point in the plane is the directional derivative of in the direction , and is denoted by .
Figure 1.
Definition 1. The directional derivative of a function at in the direction of , denoted by is given by:
whenever the limit on the right hand side exists.
The above definition is also meaningful when is not a unit vector. However, when , then is NOT equal to the rate of change of in the direction . The rate of change of in the direction or the slope of tangent line to the curve at is equal to .
The rate of change of at along an arbitrary line parallel to () is equal to:
If , Definition 1 gives:
for every in the domain of .
If , we have from the above definition
which is clearly the partial derivative of with respect to , .Similarly, if , the directional derivative of in the direction of is the partial derivative of with respect to . So
Example 1
Given and , find .
Solution
It follows from Definition 1 that
If , then .
To prove, we use the definition of : Also we note where To find we can use the chain rule:
When , we have and . Thus:
Therefore, we could prove the following theorem.
Theorem 1. If is a differentiable function at , and , then
Example 2
Given and , find using Theorem 1.
Solution
First we need to calculate and .
Therefore:
Does the Existence of Directional Derivatives in All Directions Guarantee Differentiability?
We learned that if the first partial derivatives of a function are continuous in a neighbourhood of a point, the function is differentiable at that point However, the mere existence of the first partial derivatives does imply that the function is differentiable. We may face this question: will a stronger condition that the directional derivatives of in all directions (not just along the coordinate axes) exist guarantee the differentiability of ? The answer is still “no.” Consider the following example.
Example 3
Let
Find for every unit vector . Is differentiable at the origin?
Graph of
Solution
Let be any unit vector. If we use the polar coordinates, we have This means along any ray from the origin making an angle with the positive side of the -axes, the graph is the straight line of slope . Therefore, . If this argument has not been convincing for you, let’s calculate :
Because the function is constant () on the and axes, we conclude . Therefore, if the function were differentiable, according to 1 we should have However, we showed that which is not zero if (for ). Therefore we conclude the function cannot be differentiable at the origin.
Even if a function has finite directional derivatives in all directions, it may fail to be continuous, let alone be differentiable. The following example illustrates such a situation.
Example 4
Let
Find for every unit vector .
Solution
Let be any unit vector. Because we don’t know whether or not is differentiable, to find we have to use the definition of the directional derivative:
In fact, if we approach the origin along the line , we have:
and if tends to along , we have:
Therefore does not exist and the function is not even continuous at the origin, let alone be differentiable.
Gradients
Now let’s go back to Theorem 1. We learned if is a differentiable function at , and , then
The right hand side of the above expression can be written as the dot product of two vecots:
Therefore:
The first vector on the right hand side is called the “gradient of ” and is denoted by “” or “.” The notation “” is the inverted capital delta, , and is read “del” or “nabla.” We can also write: . Gradients have many applications that we will discuss in this chapter.
Definition 2. If is a function of two variables and and if and exist, the gradient of , denoted by or is defined by
If is a differentiable function at , then
Recall that dot product is commutative. That is for two vectors and , we have: .
Example 5
Let Find .
Solution
Thus:
Example 6
If is a function of and , find in polar coordinates.
Solution
We know . Not only should we write and in terms of and but also we need to write and in terms of the unit vectors for polar coordinates and (the subscripts for these two unit vectors do not mean differentiation).
From the chain rule, we know:
In this example , we had shown:
Therefore:
On the other hand, and should be written in terms of and . Using geometry we have:
Thus the gradient of in polar coordinates is:
In the above example, we showed that the gradient in polar coordinates
Directional Derivatives and Gradients in 3- and n-Space
The extension of the concept of the directional derivative and the gradient when is a function of three variables or more is easy. For example if , its directional derivative in the direction of a vector is:
Note that . The general definition of the directional derivative is as follows.
Definition 3. Consider a function . The directional derivative of at in the direction , denoted by , is defined by:
whenever the limit on the right hand side exists.
The gradient of is
and for the general case we have:
Definition 4. Consider a function such that exist. Then the gradient of , denoted by or , is the vector
And
Theorem 2. If is a differentiable function at , then
for a vector .
Example 7
Let be a function that gives the distance from to . Find .
Solution
This means is a unit vector in the direction . It is unit because we divide the vector by its length .
To find , we find the length of the vector : and therefore:
Example 8
Let . Find the rate of change of at in the direction of the vector .
Solution
We know the rate of change of at a point in the direction of a vector is evaluated at that point (for this example at ). On the other hand we know:
[Actually we have replaced in Theorem 2 by the vector ]
So we need to (1) find (2) normalize by its length and (3) do dot product the two vectors we got in step 1 and step 2.
Step 1:
Step 2: Here and .
Step3:
Therefore, the rate of change of at in the direction of the vector is .
Properties of the Gradient
Properties of the gradient of a function are similar to the properties of regular derivative of functions of single variable. If and are differentiable functions from an open set to then:
Let be a function that maps an interval into the domain of . Assume exists and is differentiable at . If we define such that , then using the chain rule we conclude exists and is equal to:
Note that () is not something new. It is just a new way of writing what we saw before. For example, when and , () is the same as the following:
Example 9
(Multi-dimensional version of the Mean-Value Theorem) Let be an open set containing two points and and the line segment joining them. Show that if and its first partial derivatives are continuous on , then there is a point on the line segment joining and such that
[Hint: Express the line segment in parametric form oand use the Mean-Value Theorem for functions of one variable.]
Solution
The line segment joining and can be parametrized by means of the equation
Let be a function from to with
Because is continuous on and differentiable on , it follows from the Mean-Value Theorem that there is a number between and such that
Because and
we have
or
where .
Differentiability and Gradient (Optional)
Read the optional part
Hide the optional part
Suppose is differentiable at . According to Definition 3.10.2 we have:
where and as regular . Because we can rewrite the above expression as:
Rearranging the terms:
Take the absolute value of both sides
and dividing both sides by (if ), we have:
Differentiability of means , therefore , and finally
Try to prove that if (**) holds, then we have (*). Consequently, we can conclude that is differentiable if and only if we have:
and this can be used as an alternative definition of differentiability.
Gradient Vector Field
Suppose is a function of and . The gradient of assigns a two dimensional vector to each point in the plane wherever the partial derivatives exist. An association that associates a vector to each point in the two- or three-dimensional space is called vector field. As such, is referred to as a gradient vector field. Other examples of vector fields in physics and engineering include velocity of (steady) wind or water currents, gravitational field, electric and magnetic fields, and displacement field of a deformable body under external forces.
To visualized a vector field in two or three dimensions, at each point (actually at some points) we draw a vector that the vector field gives us at that point. The length of vectors are often scaled to be able to show more vectors in the plane. This is an effective way of representing a gradient field. For example, if , its gradient is a function from to , and therefore its graph would be a set of , which is a subset of and impossible to plot.