Wouldn’t it be great to be able to find the slope of a surface in any direction?
Thanks to Directional Derivatives and the Gradient Vector, we can!
Imagine you are out on a hike. As you plan your upward and downward descent along the undulating terrain, you constantly have to navigate varying slopes along your path.
In other words, you must constantly ask yourself, “what is the rate of change in the direction I’m traveling?”
Think of it this way.
As you look about over the rolling hills, your line of sight creates a curve for which you would travel, and you plan your next step. As you scan the landscape, you change your visual direction; thus, changing the curve you will travel.
What Is Directional Derivative?
Now, as we know, the partial derivatives \({f_x}\) and \({f_y}\) give us the slope, or the measure of the rate of change of the function at a point in the x-direction and y-direction, respectively.
But they can only tell us the rate of change parallel to the \(x\) or \(y\) axes.
What about the slope in any direction?
We begin by letting \(z = f\left( {x,y} \right)\) be our surface and \(\left( {{x_0},{y_0}} \right)\) be our starting point in the domain of \(F\).
Next, we need to pick a direction of where we hope to travel or walk. So, we let our fixed direction be the unit vector \(\vec{u}\) in the xy-plane.
Then, the directional derivative of \(f\) in the direction of \(\vec{u}=\left\langle u_{x}, u_{y}\right\rangle\) is:
\begin{equation}
D_{u} f\left(x_{0}, y_{0}\right)=\lim _{h \rightarrow 0} \frac{f\left(x_{0}+h u_{x}, y_{0}+h u_{y}\right)-f\left(x_{0}, y_{0}\right)}{h}
\end{equation}
Directional Derivative Formula
More generally speaking, the rate of change of \(f\left( {x,y} \right)\)at \(\left( {{x_0},{y_0}} \right)\) in the direction of the unit vector \(\vec{u}\) is given by the directional derivative:
\begin{equation}
D_{\vec{u}} f\left(x_{0}, y_{0}\right)=\nabla f\left(x_{0}, y_{0}\right) \cdot \vec{u}, \text { where } \nabla f\left(x_{0}, y_{0}\right)=\left\langle f_{x}, f_{y}\right\rangle \text { is the gradient of } f
\end{equation}
Okay, so there’s a lot to unpack in this definition, so let’s work through an example to help make sense of things.
And don’t worry, we’ll talk about the gradient vector, \(\nabla f\), as we go!
Example
Find the directional derivative of \(f\left( {x,y} \right) = – 4xy – \frac{1}{4}{x^4} – \frac{1}{4}{y^4}\) at the point \(\left( {1, – 1} \right)\) in the direction \(\vec{v}=\left\langle\frac{1}{2},-\frac{1}{2}\right\rangle\).
Okay, so first, we will find our unit vector by dividing each component of vector \(\vec{v}\) by its magnitude.
\begin{equation}
\begin{aligned}
&\|\vec{v}\|=\sqrt{\left(\frac{1}{2}\right)^{2}+\left(-\frac{1}{2}\right)^{2}}=\frac{1}{\sqrt{2}} \\
&\vec{u}=\frac{\vec{v}}{\|\vec{v}\|}=\frac{\left\langle\frac{1}{2},-\frac{1}{2}\right\rangle}{\frac{1}{\sqrt{2}}}=\left\langle\frac{\sqrt{2}}{2},-\frac{\sqrt{2}}{2}\right\rangle
\end{aligned}
\end{equation}So, now that we have our unit vector \(\vec{u}=\left\langle\frac{\sqrt{2}}{2},-\frac{\sqrt{2}}{2}\right\rangle\), let’s compute our gradient vector \(\nabla f\).
The gradient vector, denoted \({\mathop{\rm grad}\nolimits} f\left( {x,y} \right)\) or \(\nabla f\left( {x,y} \right)\), read “del f”, is a vector valued function such that…
\begin{equation}
\operatorname{grad} f(x, y)=\nabla f(x, y)=\left\langle f_{x}, f_{y}\right\rangle
\end{equation}Therefore, for our function \(f\left( {x,y} \right) = – 4xy – \frac{1}{4}{x^4} – \frac{1}{4}{y^4}\), the gradient is:
\begin{equation}
\nabla f(x, y)=\left\langle-4 y-x^{3},-4 x-y^{3}\right\rangle
\end{equation}Now, let’s substitute our given point \(\left( {1, – 1} \right)\) into \(\nabla f\) and evaluate.
\begin{equation}
\begin{aligned}
&\nabla f(1,-1)=\left\langle-4(-1)-(1)^{3},-4(1)-(-1)^{3}\right\rangle \\
&\nabla f(1,-1)=\langle 3,-3\rangle
\end{aligned}
\end{equation}Lastly, we plug our values into our directional derivative formula and simplify.
\begin{equation}
\begin{aligned}
&D_{\vec{u}} f\left(x_{0}, y_{0}\right)=\nabla f\left(x_{0}, y_{0}\right) \cdot \vec{u} \\
&D_{\vec{u}} f(1,-1)=\langle 3,-3\rangle \cdot\left\langle\frac{\sqrt{2}}{2},-\frac{\sqrt{2}}{2}\right\rangle \\
&D_{\vec{u}} f(1,-1)=(3)\left(\frac{\sqrt{2}}{2}\right)+(-3)\left(-\frac{\sqrt{2}}{2}\right)=\frac{6 \sqrt{2}}{2} \\
&D_{\vec{u}} f(1,-1)=3 \sqrt{2}
\end{aligned}
\end{equation}
Awesome!
But what did we find?
The value represents the rate of change!
So, as you can see, the directional derivative allows us to find the slope in the same direction we desire.
Cool!
But there’s more!
Calculate The Directional Derivative
Suppose the direction of a directional derivative is described by the angle \(\theta \) of inclination of the unit vector, \(\vec{u}\). In that case, we can use the following handy expression to help us calculate the directional derivative:
\begin{equation}
\vec{u}=\langle\cos \theta, \sin \theta\rangle
\end{equation}
Example
For example, suppose we were asked to find the directional derivative of \(f\left( {x,y} \right) = {e^{xy}}\) at the point \(\left( {2,3} \right)\) in the direction at an angle of \(\frac{\pi }{3}\) from the positive x-direction.
Since we are not given a unit vector but an angle of inclination of \(\frac{\pi }{3}\), we will use our new handy expression to find our unit vector.
\begin{equation}
\vec{u}=\left\langle\cos \frac{\pi}{3}, \sin \frac{\pi}{3}\right\rangle=\left\langle\frac{1}{2}, \frac{\sqrt{3}}{2}\right\rangle
\end{equation}Now, we proceed by finding our partial derivatives at our given point and substituting them into our directional derivative formula.
\begin{equation}
\begin{aligned}
&\nabla f(x, y)=\left\langle y e^{x y}, x e^{x y}\right\rangle \\
&\nabla f(2,3)=\left\langle 3 e^{(2)(3)}, 2 e^{(2)(3)}\right\rangle=\left\langle 3 e^{6}, 2 e^{6}\right\rangle \\
&D_{i u} f\left(x_{0}, y_{0}\right)=\nabla f\left(x_{0}, y_{0}\right) \cdot \vec{u} \\
&D_{\vec{u}} f(2,3)=\left\langle 3 e^{6}, 2 e^{6}\right\rangle \cdot\left\langle\frac{1}{2}, \frac{\sqrt{3}}{2}\right\rangle \\
&D_{\vec{u}} f(2,3)=\left(3 e^{6}\right)\left(\frac{1}{2}\right)+\left(2 e^{6}\right)\left(\frac{\sqrt{3}}{2}\right)=\frac{3 e^{6}}{2}+\frac{2 e^{6} \sqrt{3}}{2}
\end{aligned}
\end{equation}
Perfect!
Gradient Vector
Now, let’s look a bit more closely at the gradient vector.
- First, the gradient vector is normal to all level curves. So, when we let \(c = f\left( {x,y} \right)\), where \(c\) is a constant, the gradient vector is always perpendicular to that level curve.
- Secondly, the gradient tells us in what direction this maximum change is occurring, and its magnitude tells us how to find the maximum rate of change of a function at a given point.
This means the function \(z = f\left( {x,y} \right)\) increases most rapidly at \(\left( {{x_0},{y_0}} \right)\) in the direction of the gradient with a rate of \(\left\| {\nabla f\left( {{x_0},{y_0}} \right)} \right\|\) and decreases most rapidly in the oppositive direction with a rate of \( – \left\| {\nabla f\left( {{x_0},{y_0}} \right)} \right\|\).
Example
For example, let’s find a vector indicating the direction of most rapid increase of \(f\left( {x,y} \right) = {e^x}\sin y\) at the point \(\left( {0,\frac{{5\pi }}{6}} \right)\), and determine the rate of change in that direction.
Okay, so the vector that points in the direction of most rapid increase is the gradient vector:
\begin{equation}
\nabla f(x, y)=\left\langle f_{x}, f_{y}\right\rangle
\end{equation}So, let’s take our first order partial and evaluate the gradient vector at our given point.
\begin{equation}
\begin{aligned}
&\nabla f(x, y)=\left\langle e^{x} \sin y, e^{x} \cos y\right\rangle \\
&\nabla f\left(0, \frac{5 \pi}{6}\right)=\left\langle e^{(0)} \sin \left(\frac{5 \pi}{6}\right), e^{(0)} \cos \left(\frac{5 \pi}{6}\right)\right\rangle=\left\langle(1)\left(\frac{1}{2}\right),(1)\left(-\frac{\sqrt{3}}{2}\right)\right\rangle \\
&\nabla f\left(0, \frac{5 \pi}{6}\right)=\left\langle\frac{1}{2},-\frac{\sqrt{3}}{2}\right\rangle
\end{aligned}
\end{equation}Now that we have found the vector indicating the direction of steepest increase, we need to find the rate of change in that direction by calculating its magnitude \(\left\| {\nabla f} \right\|\).
\begin{equation}
\left\|\nabla f\left(0, \frac{5 \pi}{6}\right)\right\|=\sqrt{\left(\frac{1}{2}\right)^{2}+\left(-\frac{\sqrt{3}}{2}\right)^{2}}=\sqrt{\frac{1}{4}+\frac{3}{4}}=\sqrt{1}=1
\end{equation}
And that’s it!
Easy, right?
Together we will learn how a directional derivative is a value that represents a rate of change and how to find the directional derivatives both geometrically and algebraically. We will then take a closer look at the Gradient Vector, as it signifies a vector that points to the direction of the steepest ascent of a curve.
We will work through examples of how to calculate and draw gradient vectors, as they are orthogonal to level curves, use the gradient to determine maximum and minimum steepness of a surface, and how the gradient vector helps us understand the tangent plane to a level surface.
There’s so much to discover so let’s jump right in!
Video Tutorial w/ Full Lesson & Detailed Examples (Video)
Get access to all the courses and over 450 HD videos with your subscription
Monthly and Yearly Plans Available
Still wondering if CalcWorkshop is right for you?
Take a Tour and find out how a membership can take the struggle out of learning math.