Calculus 3Partial Derivatives

Directional Derivatives

The rate of change in the direction of a unit vector u.

Not started Jump to practice

The partial derivatives measure change heading east ($f_x$) or north ($f_y$). A hiker can head any way. The directional derivative $D_{\mathbf{u}}f$ measures the rate of change of $f$ per unit of distance in the direction of a unit vector $\mathbf{u}$, using the dot product.

Key idea

For a unit vector $\mathbf{u} = \langle u_1, u_2 \rangle$: $$D_{\mathbf{u}}f(a, b) = f_x(a, b)\,u_1 + f_y(a, b)\,u_2 = \nabla f(a, b) \cdot \mathbf{u},$$ where $\nabla f = \langle f_x, f_y \rangle$. If a direction is given by a vector $\mathbf{v}$ that is not unit length, use $\mathbf{u} = \frac{\mathbf{v}}{|\mathbf{v}|}$. For an angle $\theta$, $\mathbf{u} = \langle \cos\theta, \sin\theta \rangle$.

Why it works

Walk from $(a, b)$ in direction $\mathbf{u}$: after distance $s$ you are at $x = a + su_1$, $y = b + su_2$. The chain rule gives $$\frac{d}{ds}f(a + su_1, b + su_2) = f_x\frac{dx}{ds} + f_y\frac{dy}{ds} = f_x u_1 + f_y u_2.$$ This is a rate per unit of distance because $s$ is distance, and $s$ is distance only when $|\mathbf{u}| = 1$. With a longer vector, the "distance" would really be a multiple of $s$ and the rate would be scaled by that multiple.
Turn the blue unit vector $u$ with the slider. The readout shows $D_{\mathbf{u}}f = \nabla f \cdot \mathbf{u}$: largest when $u$ lines up with the red gradient, zero when $u$ runs along the level curve.

Worked examples

Worked example: Direction given by a vector

Find $D_{\mathbf{u}}f$ for $f(x, y) = x^2y + y^3$ at $(1, 2)$ in the direction of $\mathbf{v} = \langle 3, 4 \rangle$.
  1. $\nabla f = \langle 2xy, x^2 + 3y^2 \rangle = \langle 4, 13 \rangle$ at $(1, 2)$.
  2. $|\mathbf{v}| = 5$, so $\mathbf{u} = \left\langle \frac{3}{5}, \frac{4}{5} \right\rangle$.
  3. $D_{\mathbf{u}}f = \frac{12}{5} + \frac{52}{5} = \frac{64}{5}$.

Answer: $\frac{64}{5}$

Worked example: Direction given by an angle

Find the rate of change of $f(x, y) = xe^{y}$ at $(2, 0)$ in the direction $\theta = \frac{\pi}{6}$.
  1. $\nabla f = \langle e^y, xe^y \rangle = \langle 1, 2 \rangle$ at $(2, 0)$.
  2. $\mathbf{u} = \left\langle \frac{\sqrt{3}}{2}, \frac{1}{2} \right\rangle$, already a unit vector.
  3. $D_{\mathbf{u}}f = \frac{\sqrt{3}}{2} + 1$.

Answer: $\frac{\sqrt{3}}{2} + 1 \approx 1.87$

Worked example: Three variables

Find the rate of change of $f(x, y, z) = xyz$ at $(1, 2, 3)$ toward $\mathbf{v} = \langle 2, -1, 2 \rangle$.
  1. $\nabla f = \langle yz, xz, xy \rangle = \langle 6, 3, 2 \rangle$.
  2. $|\mathbf{v}| = 3$, so $D_{\mathbf{u}}f = \frac{1}{3}(12 - 3 + 4) = \frac{13}{3}$.

Answer: $\frac{13}{3}$

Common mistake

Using a direction vector that is not unit length. Dotting with $\mathbf{v} = \langle 3, 4 \rangle$ itself in the first example gives ${}64$, five times too big, because $|\mathbf{v}| = 5$. The direction is the same, but the rate per unit distance is not. Check: in the directions $\langle 1, 0 \rangle$ and $\langle 0, 1 \rangle$ your formula must give $f_x$ and $f_y$.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 2 XP.

Loading practice…

Builds on

Leads to

Sources and further reading

  • OpenStax Calculus Volume 3, 4.6 Directional Derivatives and the Gradient
@teddyrookbook GitHub