Differentiation
Calculating directional derivatives requires you to be competent at differentiation. Use this resource to refresh your understanding.
Imagine navigating a hilly landscape, searching for the steepest ascent or smoothest descent—this is the essence of directional derivatives. These mathematical tools are vital in meteorology for predicting temperature changes along wind paths, in finance for analysing portfolio shifts, and in machine learning for optimising algorithms. Use this resource to learn how to calculate directional derivatives.
This concept combines your understanding of vectors and calculus. Before you read any further, make sure that you are confident with differentiation.
Remember that the partial derivative of a function gives us the gradient or rate of change of the function along each axis. For example, let's consider a function with two variables: \(z=f(x,y)\).
Directional derivatives build on this and allow us to find the rate at which a function changes as we move in any direction defined by a vector.
Imagine you're hiking on a mountain, and the landscape is a complex surface. The directional derivative is like asking, "If I walk in a specific direction, how steep will the path be?"
Just as the steepness of your path changes depending on the direction you choose to walk (uphill, downhill, or along the side of the mountain), the directional derivative measures how steep or fast a function changes in a particular direction at a given point.
You can find the directional derivative of a function containing two variables \(f(x,y)\) or three variables \(g(x,y,z)\) at a point and in a given direction.
The directional derivative of function \(f\) in the direction of a vector \(\vec{u}\) is denoted by \(D_{u}\) and is given by:
\[D_{u} = \nabla f\cdot\hat{u}\]
where \(\nabla f\) ("grad \(f\)") is the gradient of the function \(f\) in the direction of the vector \(\vec{u}\) and \(\hat{u}\) is a unit vector in the direction of \(\vec{u}\).
\(\nabla f\) is found by partial differentiation according to the following:
\[\nabla f = \frac{\partial f}{\partial x}\hat{i} + \frac{\partial f}{\partial y}\hat{j} + \frac{\partial f}{\partial z}\hat{k}\]
And of course, the unit vector for vector \(\vec{u}\) is just the vector divided by its magnitude.
Let's look at the mountain example again.
Imagine you are standing at the point indicated by the red dot in the figure.
Since the directional derivative relies on a dot product where \(\vec{a}\cdot\vec{b}=\left|\vec{a}\right|\left|\vec{b}\right|\cos\theta\):
Find the directional derivative of \(f(x,y)=x^{2}+y^{2}\) at the point \((2,3)\) in the direction of the vector \(\vec{u}=4\hat{i}-3\hat{j}\).
The first step is to find the vector \(\nabla f\) at the point \(x=2\), \(y=3\).
\[\begin{align*} \nabla f & = \frac{\partial f}{\partial x}\hat{i} +\frac{\partial f}{\partial y}\hat{j}\\
& = \frac{\partial}{\partial x}(x^{2}+y^{2})\hat{i} + \frac{\partial}{\partial y}(x^{2}+y^{2})\hat{j}\\
& = 2x\hat{i}+2y\hat{j}\\
& = 2(2)\hat{i}+2(3)\hat{j}\\
& = 4\hat{i}+6\hat{j}
\end{align*}\]
Next, we need to find the dot product of \(\nabla f\) and \(\hat{u}\), the unit vector in the direction of \(\vec{u}\). Let's find the \(\hat{u}\) first.
Now, we can substitute \(\nabla f\) and \(\hat{u}\) into the formula to find the directional derivative.
\[\begin{align*} D_{u} & = (4\hat{i}+6\hat{j})\cdot(\frac{4}{5}\hat{i}-\frac{3}{5}\hat{j})\\
& = (4\times\frac{4}{5})+(6\times-\frac{3}{5})\\
& = \frac{16}{5}-\frac{18}{5}\\
& =-\frac{2}{5}
\end{align*}\]
We have been given the equation for the function and the directional derivative. The question is asking for the unit vector \(\hat{u}\).
The formula that connects them is \(D_{u}=\nabla f\cdot \hat{u}\), so we should find \(\nabla f\) first for \(x=2\), \(y=3\) and \(z=-1\).
For the directional derivative to be maximum, \(\vec{u}=\nabla f\).
\[\vec{u} = \hat{i} + 4\hat{j} + 6\hat{k}\]
Now, we can find \(\hat{u}\).
\[\begin{align*} \hat{u} & = \frac{\vec{u}}{\left| \vec{u} \right|}\\
& = \frac{\hat{i} + 4\hat{j} + 6\hat{k}}{\sqrt{1^{2}+4^{2}+6^{2}}}\\
& = \frac{\hat{i} + 4\hat{j} + 6\hat{k}}{\sqrt{53}}\\
& = \frac{1}{\sqrt{53}}(\hat{i} + 4\hat{j} + 6\hat{k})
\end{align*}\]
Images on this page by RMIT, licensed under CC BY-NC 4.0