Professor Leonard – Calculus 3 – 13.6: Finding Directional Derivatives and Gradients
Thomas – 14.5 Directional Derivatives and Gradient Vectors
The Reason for Directional Derivatives
At any point on a surface there are infinitely many directions in which we can travel. Each direction has its own instantaneous rate of change. Among all possible directions, one produces the greatest rate of increase. At this point one can sense that Calculus provides the tools to measure the rate of change in all possible directions. We could quantify this change as a combination of partial derivatives, but this alone would fall short.
Let’s picture ourselves at the peak of a hill, with paths downwards extending outwards. Discerning the rate of change down purely with partial derivatives falls short, as it only gives us change parallel to x and y coordinates. We need a more fine tuned approach that allows us to measure the rate of change at any arbitrary direction, at any point, along our descent.
Directional Derivatives on a Plane
Suppose we begin at a point P and walk in a chosen direction. As we move, our position forward and laterally (both x and y) change simultaneously. We could determine our rate of change f by applying the trusty chain rule to our x and y variables.
We know that if f(x,y) is differentiable, the rate at which f changes with respect to a chosen parameter, t, along the differentiable curve x=g(t), y=h(t), is given by the multivariable Chain Rule:
\frac{df}{dt}=\frac{\partial f}{\partial x}\frac{dx}{dt}+\frac{\partial f}{\partial y}\frac{dy}{dt}
In other words, the total rate of change of f is the sum of:
the partial derivative with respect to x, multiplied by the rate at which x changes, and the partial derivative with respect to y, multiplied by the rate at which y changes.
At any point that gives us the rate of change in response to the increase or decrease in t, we can identify the rate of change in a particular by calculating f with respect to the distance along t (from a specific point P) in a specific direction. That direction is our unit vector u.
Remember that a unit vector in two dimensions can be written in terms of its horizontal and vertical components:
\mathbf{u}=u_1\mathbf{i}+u_2\mathbf{j}
Since \mathbf{u} is a unit vector, its magnitude is 1, so u_1^2+u_2^2=1
Starting from the point katex[/katex], we move a distance s in the direction of the unit vector \mathbf{u}. The coordinates of our new point become:
x=x_0+su_1
y=y_0+su_2
where
s is the distance travelled along the path.
\mathbf{u}=u_1\mathbf{i}+u_2\mathbf{j} is the chosen unit vector that specifies the direction of travel.
This leads us to…
The Directional Derivative
(\frac{df}{ds})_{u,P_0}=\lim_{s\to0}\frac{f(x_0+su_1,y_0+su_2)-f(x_0,y_0)}{s}
Or equivalently
D_uf(x_0,y_0)=\lim_{s\to0}\frac{f(x_0+su_1,y_0+su_2)-f(x_0,y_0)}{s}
We also denote the directional derivative by
(D_uf)_{P_0}
which is read as “the directional derivative of f at the point P_0 in the direction of the unit vector \mathbf{u}.”
The partial derivatives f_x(x_0,y_0) and f_y(x_0,y_0) are simply the directional derivatives of f at P_0 in the directions of the unit vectors \mathbf{i} and \mathbf{j}, respectively.
Simply put, partial derivatives are directional derivatives taken along the coordinate axes. In practice, we usually compute the directional derivative using the equivalent formula:
D_uf(x,y)=f_x(x,y)u_1+f_y(x,y)u_2
In other words, we multiply each partial derivative by the corresponding component of the unit vector and add the results together. This is simply the dot product of the gradient and the unit vector—a relationship we’ll explore in the next section.
Example:
Find the directional derivative of f(x,y)=x^3-2x^2+y^3 at the point P(1,2) in the direction of the vector that makes an angle of \theta=\frac{\pi}{6} with the positive x-axis.
Since the direction is given by an angle, our first task is to convert it into a unit vector.
u=\cos\theta\,i+\sin\theta\,j
Therefore,
u=\cos(\frac{\pi}{6})i+\sin(\frac{\pi}{6})j=\frac{\sqrt{3}}{2}i+\frac{1}{2}j
Next, compute the partial derivatives:
f_x=3x^2-4x
f_y=3y^2
Now substitute these into the directional derivative formula:
D_uf(x,y)=(3x^2-4x)\frac{\sqrt{3}}{2}+3y^2\frac{1}{2}
This gives the directional derivative of f at any point in the direction of \mathbf{u}.
Finally, evaluate it at P(1,2).
D_uf(1,2)=[3(1)^2-4(1)]\frac{\sqrt{3}}{2}+3(2)^2\frac{1}{2} D_uf(1,2)=6-\frac{\sqrt{3}}{2}
Geometric Interpretation
If S is the surface defined by z=f(x,y), we can pass a vertical plane through the point P parallel to the direction vector \mathbf{u}. This plane intersects the surface in a curve C.
The directional derivative is the slope of the tangent line to this curve at the point P.
In other words, the directional derivative allows us to measure the instantaneous rate of change of f in any chosen direction by combining the partial derivatives f_x and f_y.
The Gradient Envisioned from the Top of a Hill
Given the ability to define directional derivatives, we can the quantify the grades or inclinations of slopes from a point P in any direction u.
So you’re back at the summit of a hill. Every direction you could walk has its own uphill or downhill slope. One direction climbs faster than every other. The vector pointing in that direction is called the gradient. Its length tells us how steep that maximum climb is.
The Gradient Qualities
The gradient is a vector whose components are the partial derivatives of the function.
\nabla f=\langle f_x,f_y\rangle
The gradient has four important properties:
- Its direction is the direction of steepest ascent.
- Its magnitude is the maximum possible directional derivative.
\|\nabla f\|=\sqrt{f_x^2+f_y^2}=\max(D_uf)
- It is perpendicular to the level curves of f(x,y).
- It can be used to compute the directional derivative in any direction \mathbf{u}:
D_uf=\nabla f\cdot u
Gradient Example
Consider the function:
f(x,y)=x^2+y^2
Its gradient is:
\nabla f=\langle2x,2y\rangle
At the point
\nabla f(1,2)=\langle2,4\rangle
This tells us that:
- the function increases most rapidly in the direction of \langle2,4\rangle;
- the maximum rate of increase is
\|\nabla f(1,2)\|=\sqrt{2^2+4^2}=2\sqrt{5}