# Directional Derivatives

We will now look at a new type of derivative known as a **directional derivative**.

## Directional Derivatives of Two Variable Functions

Let $z = f(x, y)$ be a two variable real-valued function. Recall from the Partial Derivatives page that the partial derivative $\frac{\partial z}{\partial x} = \lim_{h \to 0} \frac{f(a + h, b) - f(a, b)}{h}$ represented the rate of change of $z$ in the $x$-direction at any point $P(a, b, f(a,b))$ for $(a, b) \in D(f)$ by giving us the slope of the tangent line obtained by the curve of intersection of $S$ with the plane $y = b$ at point $P$. Similarly, the partial derivative $\frac{\partial z}{\partial y} = \lim_{h \to 0} \frac{f(a, b + h) - f(a,b)}{h}$ represented the rate of change of $z$ in the $y$-direction at any point $P(a, b, f(a,b))$ for $(a, b) \in D(f)$ by giving us the slope of the tangent line obtained by the curve of intersection of $S$ with the plane $x = a$ at point $P$.

Correspondingly, $\frac{\partial z}{\partial x}$ tells us the rate of change of [[ in the direction of the unit vector $\vec{i}$ while $\frac{\partial z}{\partial y}$ tells us the rate of change of $y$ in the direction of the unit vector $\vec{j}$.

We will now extend this idea further. Let $z = f(x, y)$ be a two variable real-valued function that generates the surface $S$, and let $z_0 = f(x_0, y_0)$ be the point $P(x_0, y_0, z_0)$ that lies on $S$. Let $\vec{u} = (a, b)$ be an arbitrary unit vector ($\| \vec{u} \| = 1$). Consider a vertical plane $\Pi$ that passes through $P$ that is in the direction of $\vec{u}$. This plane $\Pi$ intersects the surface $S$ to form a curve $C$ that contains $P$. The slope of the tangent line $T$ on $C$ at $P$ represents the rate of change of $z$ in the direction of the arbitrary vector $\vec{u}$.

Let $Q(x,y,z)$ be another point on the curve $C$, and let $P'(x_0, y_0, 0)$ and $Q'(x,y,0)$ be the projections of $P$ and $Q$ onto the $xy$-plane. As we can see, the vector $\vec{P'Q'}$ with reduced coordinates $\vec{P'Q'} = (x - x_0, y - y_0)$ goes in the same direction as $\vec{u} = (a, b)$ and so $\vec{P'Q'} = (x - x_0, y - y_0) = h\vec{u} = h(a, b) = (ha, hb)$ for some scalar $h$ as illustrated in the following diagram.

Therefore $x = x_0 + ha$ and $y = y_0 + hb$. So if $\Delta z = z - z_0$ (that is the change in $z$ coordinate from $Q(x, y, z)$ to $P(x_0, y_0, z_0)$) then:

(1)Definition: Let $z = f(x, y)$ be a two variable real-valued function. Then the Directional Derivative of $f$ at $(x_0, y_0) \in D(f)$ in the direction of the unit vector $\vec{u} = (a, b)$ is defined as $D_{\vec{u}} \: f(x_0, y_0) = \lim_{h \to 0} \frac{f(x_0 + ha, y_0 + hb) - f(x_0, y_0)}{h}$ provided this limit exists. |

*If the unit vector $\vec{u} = (a, b)$ is denoted in bold as $\mathbf{u}$ then the notation for the directional derivative of $f$ at $(x_0, y_0) \in D(f)$ in the direction of $\mathbf{u}$ is denoted $D_{\mathbf{u}} \: f(x_0, y_0)$.*

One important note that we should mention is that the partial derivatives $\frac{\partial z}{\partial x}$ and $\frac{\partial z}{\partial y}$ are both directional derivatives in the directions of $\vec{i}$ and $\vec{j}$ as we've noted above, that is:

(2)Let's look at an example of computing a directional derivative using the definition. Consider the function $z = f(x, y) = x + y^2$ and the point $(1, 1) \in D(f)$, and suppose that wanted to compute the directional derivative of $f$ at $(1, 1)$ in the direction of the unit vector $\vec{u} = \left (\frac{3}{5}, \frac{4}{5} \right)$. Therefore:

(3)Of course, computing directional derivatives using limits can be tedious. Fortunately, there is an easier way to compute directional derivatives.

Theorem 1: If $z = f(x, y)$ is a differentiable function of the variables $x$ and $y$, then for any unit vector $\vec{u} = (a, b)$, the directional derivative of $f$ at $(x, y) \in D(f)$ in the direction of $\vec{u}$ is given by $D_{\vec{u}} \: f(x, y) = \frac{\partial z}{\partial x} a + \frac{\partial z}{\partial y} b = \left ( \frac{\partial z}{\partial x}, \frac{\partial z}{\partial y} \right ) \cdot (a, b)$. |

**Proof:**Let $g(h) = f(x_0 + ha, y_0 + hb)$ be a single variable function in terms of $h$. The derivative $g'(0)$ can be computed as:

- Let $x = x_0 + ha$ and $y = y_0 + hb$ both be parametric equations of the parameter $h$. Then $g(h) = f(x, y)$. If we use the chain rule type 1 on $g(h) = f(x,y)$ and note that $\frac{d}{dh} x = \frac{d}{dh} (x_0 + ha) = a$ and $\frac{d}{dh} y = \frac{d}{dh} (y_0 + hb) = b$ we get that:

- Now we let $h = 0$ so that $x = x_0$ and $y = y_0$ and so:

- So we have that both $g'(0) = D_{\vec{u}} \: f (x_0, y_0)$ and $g'(0) = f_x(x_0, y_0)a + f_y(x_0, y_0)b$ so we conclude that:

## Directional Derivatives of Three Variable Functions

Definition: Let $w = f(x, y, z)$ be a three variable real-valued function. Then the Directional Derivative of $f$ at $(x_0, y_0, z_0) \in D(f)$ in the direction of the unit vector $\vec{u} = (a, b, c)$ is defined as $D_{\vec{u}} \: f(x_0, y_0, z_0) = \lim_{h \to 0} \frac{f(x_0 + ha, y_0 + hb, z_0 + hc) - f(x_0, y_0, z_0)}{h}$ provided this limit exists. |

Theorem 1 can also be extended for directional derivatives of three variables.

Theorem 2: If $w = f(x, y, z)$ is a differentiable function of the variables $x$, $y$, and $z$ then for any unit vector $\vec{u} = (a, b, c)$, the directional derivative of $f$ at $(x, y, z) \in D(f)$ in the direction of $\vec{u}$ is given by $D_{\vec{u}} \: f(x, y, z) = \frac{\partial w}{\partial x} a + \frac{\partial w}{\partial y} b + \frac{\partial w}{\partial z} c = \left ( \frac{\partial w}{\partial x}, \frac{\partial w}{\partial y}, \frac{\partial w}{\partial z} \right ) \cdot (a, b, c)$. |