Units

# Unit 3: Directional Derivative

## The Concept

Directional derivatives look to extend the concept of partial derivatives by finding the tangent line parallel to neither the $x$-axis or $y$-axis.

We start with the graph of a surface defined by the equation $z = f(x,y)$. Given a point $(x_0, y_0)$ in the domain of $f(x,y)$, we choose a direction defined by a unit vector $\vec{u}=\langle a,\,b\rangle$, where $a^2+b^2=1$, to travel from that point. This direction vector can also be written as $\vec{u}= \langle \cos\theta,\,\sin\theta \rangle$.  Angle $\theta$ is measured counterclockwise on the $xy$-plane, starting at zero from the positive $x$-axis. The derivative along that direction (that is, the directional derivative) represents the traveling speed and it is defined as the dot product between the gradient vector, $∇f = \langle f_x, f_y \rangle$, and direction vector, $\vec{u}$, i.e.,

$D_u f(x_0,y_0) = ∇f \cdot \vec{u}=f_x(x_0, y_0) \, a+ f_y(x_0, y_0) \,b$,

where $a=\cos\theta$ and $b=\sin \theta$.

Consider two special cases of directional derivatives:

1. When $\theta = 0$, we travel in the direction that is parallel to positive $x$-axis, so the direction $\vec{u} = \langle \cos0, \, \sin0\rangle = \langle 1,\,0\rangle$ and the corresponding directional derivative is $D_u f(x,y) = f_x(x_0,y_0)\,1+ f_y(x_0,y_0)\,0= f_x(x_0,y_0)$.
2. When $\theta = \frac{\pi}{2}$, we travel in the direction that is parallel to positive $y$-axis, so the direction $\vec{u} = \langle \cos \frac{\pi}{2} , \, \sin \frac{\pi}{2} \rangle = \langle 0,\, 1 \rangle$ and the directional derivative is $D_u f(x_0,y_0) = f_x(x_0,y_0)\,0+ f_y(x_0,y_0)\,1= f_y(x_0,y_0)$.

The concept of directional derivatives can be extended into high dimensions. For example, we consider the 3D gradient vector, $∇f= \langle f_x, f_y, f_z \rangle$ and 3D direction vector, $\vec{u}=\langle a,\,b\, c \rangle$, where $a^2+b^2+c^2=1$ because $\vec{u}$ is a unit vector. Thus the directional derivative of $w = f(x,y,z)$ at point $(x_0, y_0, z_0)$ is

$D_u f(x_0,y_0, z_0) = ∇f \cdot \vec{u}=f_x(x_0, y_0, z_0)\, a + f_y(x_0, y_0, z_0) \,b + f_y(x_0, y_0, z_0) \,c$.

## The Plot

Now, you should engage with the 3D plot below to understand directional derivatives. Follow the steps below to apply changes to the plot and observe the effects:

1. There are two separate plots where the direction vector (i.e., the direction of the derivative, denoted by $\vec{u}$) is defined by either an angle in radians or a vector.
2. Point (P) is adjusted with the $x$ and $y$ sliders.
3. $\vec{u}$ is selected by either the angle or vector and is indicated by the red arrow on the graph.

## Self-Checking Questions

Check your understanding by solving the following questions:

1. Find the gradient, $∇f(x,y)$, of the function: $f(x,y) = x^2 - xy + 3y^2$
2. Find the directional derivative, $D_u f$, of the function: $f(x,y,z) = e^{-2z} sin(2x)cos(2y)$ at point (0,1). 