01 / 21

Directional
Derivatives

Learn how to measure the rate of change of a multivariable function in any direction using the gradient and unit vectors.

Multivariable Calculus

What Is a Directional Derivative?

The partial derivatives \(\frac{\partial f}{\partial x}\) and \(\frac{\partial f}{\partial y}\) measure rates of change along the coordinate axes. But what if we want the rate of change in a different direction?

Think of standing on a hillside: partial derivatives tell you the slope north-south or east-west, but the directional derivative tells you the slope in whichever direction you face.

The Gradient Vector

Before computing directional derivatives, we need the gradient vector. For a function \( f(x,y) \):

\( \frac{\partial f}{\partial x} \)
Rate of change in the \( x \)-direction (hold \( y \) constant)
\( \frac{\partial f}{\partial y} \)
Rate of change in the \( y \)-direction (hold \( x \) constant)

The gradient packages both partial derivatives into a single vector that points in the direction of steepest ascent.

Visualizing \( \nabla f \) and \( \mathbf{u} \)

P \(\nabla f\) \(\mathbf{u}\) \(\theta\) Level curves of f Key: Gradient Direction u Angle \(\theta\)

The Directional Derivative Formula

This is simply the dot product of the gradient with the unit direction vector. Equivalently:

Why Must \( \mathbf{u} \) Be a Unit Vector?

The directional derivative measures the rate of change per unit distance. If \( \mathbf{u} \) is not a unit vector, the result is scaled incorrectly: a vector twice as long would double the answer.

1
Given direction: \( \mathbf{v} = \langle v_1, v_2 \rangle \)
2
Compute magnitude: \( \|\mathbf{v}\| = \sqrt{v_1^2 + v_2^2} \)
3
Normalize: \( \mathbf{u} = \frac{\mathbf{v}}{\|\mathbf{v}\|} = \left\langle \frac{v_1}{\|\mathbf{v}\|},\; \frac{v_2}{\|\mathbf{v}\|} \right\rangle \)

Partial vs. Directional Derivatives

Partial Derivative Directional Derivative
Direction Along a coordinate axis Along any unit vector \( \mathbf{u} \)
Notation \( \frac{\partial f}{\partial x} \) or \( f_x \) \( D_{\mathbf{u}} f \)
Formula Differentiate holding other variables constant \( \nabla f \cdot \mathbf{u} \)
Special case \( D_{\mathbf{i}} f = f_x \), \( D_{\mathbf{j}} f = f_y \) Generalizes partials to all directions

Maximum and Minimum Rates of Change

Since \( D_{\mathbf{u}} f = \|\nabla f\| \cos\theta \), the directional derivative depends on the angle \( \theta \) between \( \nabla f \) and \( \mathbf{u} \):

Maximum
When \( \theta = 0 \): \( \mathbf{u} \) aligns with \( \nabla f \). Value: \( \|\nabla f\| \)
Minimum
When \( \theta = \pi \): \( \mathbf{u} \) opposes \( \nabla f \). Value: \( -\|\nabla f\| \)
Zero
When \( \theta = \frac{\pi}{2} \): \( \mathbf{u} \) is tangent to a level curve. Value: \( 0 \)

How to Compute \( D_{\mathbf{u}} f \)

1
Find the gradient: Compute \( \nabla f = \langle f_x,\, f_y \rangle \).
2
Evaluate at the point: Plug in the given \( (x_0, y_0) \) to get \( \nabla f(x_0, y_0) \).
3
Ensure \( \mathbf{u} \) is a unit vector: If given a direction \( \mathbf{v} \), normalize: \( \mathbf{u} = \frac{\mathbf{v}}{\|\mathbf{v}\|} \).
4
Dot product: Compute \( D_{\mathbf{u}} f = \nabla f(x_0, y_0) \cdot \mathbf{u} \).
5
Interpret: Positive means increasing, negative means decreasing, zero means tangent to the level curve.

Example 1: Basic Computation

Find the directional derivative of \( f(x,y) = x^2 + 3xy \) at \( (1, 2) \) in the direction of \( \mathbf{v} = \langle 3, 4 \rangle \).

1
Gradient: \( f_x = 2x + 3y \), \( f_y = 3x \). So \( \nabla f = \langle 2x + 3y,\; 3x \rangle \).
2
Evaluate: \( \nabla f(1,2) = \langle 2(1)+3(2),\; 3(1) \rangle = \langle 8, 3 \rangle \).
3
Normalize: \( \|\mathbf{v}\| = \sqrt{9+16} = 5 \). So \( \mathbf{u} = \langle \tfrac{3}{5}, \tfrac{4}{5} \rangle \).
4
Dot product: \( D_{\mathbf{u}} f = 8 \cdot \tfrac{3}{5} + 3 \cdot \tfrac{4}{5} = \tfrac{24}{5} + \tfrac{12}{5} = \tfrac{36}{5} \).

Example 2: Using an Angle

Find \( D_{\mathbf{u}} f \) for \( f(x,y) = e^x \sin y \) at \( (0, \frac{\pi}{3}) \) in the direction making angle \( \theta = \frac{\pi}{6} \) with the positive \( x \)-axis.

1
Unit vector from angle: \( \mathbf{u} = \langle \cos\frac{\pi}{6},\; \sin\frac{\pi}{6} \rangle = \langle \frac{\sqrt{3}}{2},\; \frac{1}{2} \rangle \).
2
Gradient: \( f_x = e^x \sin y \), \( f_y = e^x \cos y \). So \( \nabla f = \langle e^x \sin y,\; e^x \cos y \rangle \).
3
Evaluate: At \( (0, \frac{\pi}{3}) \): \( \nabla f = \langle \sin\frac{\pi}{3},\; \cos\frac{\pi}{3} \rangle = \langle \frac{\sqrt{3}}{2},\; \frac{1}{2} \rangle \).
4
Dot product: \( D_{\mathbf{u}} f = \frac{\sqrt{3}}{2} \cdot \frac{\sqrt{3}}{2} + \frac{1}{2} \cdot \frac{1}{2} = \frac{3}{4} + \frac{1}{4} = 1 \).

Example 3: Three Variables

Find \( D_{\mathbf{u}} f \) for \( f(x,y,z) = x^2 y - y z^2 \) at \( (1, -1, 2) \) in the direction of \( \mathbf{v} = \langle 1, 2, -2 \rangle \).

1
Gradient: \( \nabla f = \langle 2xy,\; x^2 - z^2,\; -2yz \rangle \).
2
Evaluate: \( \nabla f(1,-1,2) = \langle -2,\; 1-4,\; -2(-1)(2) \rangle = \langle -2, -3, 4 \rangle \).
3
Normalize: \( \|\mathbf{v}\| = \sqrt{1+4+4} = 3 \). So \( \mathbf{u} = \langle \tfrac{1}{3}, \tfrac{2}{3}, -\tfrac{2}{3} \rangle \).
4
Dot product: \( D_{\mathbf{u}} f = (-2)\!\cdot\!\tfrac{1}{3} + (-3)\!\cdot\!\tfrac{2}{3} + 4\!\cdot\!(-\tfrac{2}{3}) = -\tfrac{2}{3} - 2 - \tfrac{8}{3} = -\tfrac{16}{3} \).

Geometric Interpretation

P direction u slope = \( D_{\mathbf{u}} f \) vertical plane through u x z

Gradient as Steepest Ascent

c = 1 c = 2 c = 3 c = 4 P \( \nabla f \) tangent to contour

The gradient \( \nabla f \) is always perpendicular to the level curves. This means:

Perpendicular
\( \nabla f \perp \) level curve at every point
Steepest climb
Moving in the gradient direction increases \( f \) fastest

Common Mistakes

✕ Forgetting to Normalize
Using \( \mathbf{v} \) directly instead of computing \( \mathbf{u} = \frac{\mathbf{v}}{\|\mathbf{v}\|} \). The answer will be off by a factor of \( \|\mathbf{v}\| \).
✕ Wrong Partial Derivatives
Mixing up which variable to hold constant. For \( f_x \), treat \( y \) as a constant. For \( f_y \), treat \( x \) as a constant.
✕ Not Evaluating at the Point
Computing the gradient symbolically but forgetting to plug in \( (x_0, y_0) \) before taking the dot product.

Summary of Key Facts

Property Result
Formula \( D_{\mathbf{u}} f = \nabla f \cdot \mathbf{u} \)
Max rate of change \( \|\nabla f\| \), in the direction of \( \nabla f \)
Min rate of change \( -\|\nabla f\| \), opposite to \( \nabla f \)
Zero rate of change Along level curves (\( \mathbf{u} \perp \nabla f \))
Requirement on \( \mathbf{u} \) Must be a unit vector: \( \|\mathbf{u}\| = 1 \)
3D extension \( D_{\mathbf{u}} f = f_x a + f_y b + f_z c \)

Question 1 of 5

Let \( f(x,y) = x^2 y \). What is the gradient \( \nabla f \)?

Question 2 of 5

If \( \nabla f(2,1) = \langle 4, -3 \rangle \) and \( \mathbf{u} = \langle \frac{3}{5}, \frac{4}{5} \rangle \), what is \( D_{\mathbf{u}} f(2,1) \)?

Question 3 of 5

For \( f(x,y) = x^2 + y^2 \), what is the maximum rate of change at the point \( (3, 4) \)?

Question 4 of 5

To compute a directional derivative, the direction vector \( \mathbf{v} \) must satisfy which condition?

Question 5 of 5

If \( D_{\mathbf{u}} f = 0 \) at a point, which of the following must be true?