MULTIVARIABLE CALCULUS • PARTIAL DERIVATIVES

Directional Derivatives — Compute directional derivatives

Measure how a multivariable function changes as you move in any direction across its surface.

Historical Context & Motivation

Calculus began as a tool for understanding change, but for centuries it focused on functions of a single variable — asking how fast something changes as one input shifts. As mathematics grew more sophisticated in the 18th and 19th centuries, scientists and engineers needed to describe systems where multiple variables interact simultaneously. Temperature across a metal plate, air pressure across a weather map, or elevation across a mountain range all depend on at least two inputs. The question became: how do you measure the rate of change when you can walk in any direction?

1684
Leibniz Publishes Calculus
Gottfried Wilhelm Leibniz published his foundational work on differential calculus, giving mathematicians the notation and framework for derivatives of single-variable functions.
1797
Lagrange & Multivariable Functions
Joseph-Louis Lagrange formalized techniques for working with functions of several variables, laying groundwork for partial derivatives in his Théorie des fonctions analytiques.
1829
Cauchy Formalizes Limits & Continuity
Augustin-Louis Cauchy rigorously defined limits and continuity for multivariable functions, providing the logical foundation needed for directional derivatives.
1860s
Directional Derivative Concept Emerges
Mathematicians formalized the directional derivative as a way to compute the rate of change of a function along any specified direction, unifying partial derivatives into a more general framework.
1900s
Modern Applications Flourish
Directional derivatives became essential in physics, engineering, machine learning, and economics — anywhere optimization along arbitrary paths is needed.

Partial derivatives answer the question of change along the x-axis or y-axis alone, but real-world motion rarely follows those axes perfectly. A hiker doesn't walk due east or due north — she walks northeast, or at some other angle. The directional derivative was developed precisely to fill this gap: it tells you the instantaneous rate of change of a function in any direction you choose.

Core Principles & Definitions

Before computing directional derivatives, you need to understand four key ideas. These build upon your knowledge of partial derivatives and vectors, connecting them into a powerful tool for measuring change in any direction.

1

Unit Vector of Direction

A unit vector is a vector with magnitude 1 that specifies the direction of travel. It is written as û = ⟨a, b⟩ where a² + b² = 1. This ensures the derivative measures pure rate of change without being scaled by vector length.
2

Partial Derivatives

The partial derivative fx measures change along the x-direction, and fy measures change along the y-direction. These are the building blocks for any directional derivative.
3

The Gradient Vector

The gradient of f, written ∇f, packs both partial derivatives into a single vector: ∇f = ⟨fx, fy⟩. The gradient always points in the direction of steepest increase.
4

Dot Product Connection

The directional derivative is computed as the dot product of the gradient and the unit direction vector. This elegant formula — Dûf = ∇f · û — projects the gradient onto your chosen direction.
KEY TAKEAWAY
Think of standing on a hillside. The gradient is like a compass arrow pointing straight uphill — the steepest way to climb. A directional derivative asks: if I choose to walk in some other direction (maybe diagonally across the slope), how steep is that particular path? The dot product with the gradient gives the answer: it tells you what fraction of the maximum steepness you experience in your chosen direction.

Visual Explanation

The diagram below shows a surface z = f(x, y) viewed from above as a contour map. At a chosen point P, the gradient vector ∇f points toward the steepest ascent. A unit vector û defines the direction we care about, and the directional derivative Dûf measures how fast f changes along that direction.

The pink arrow shows the gradient ∇f pointing toward the steepest increase, perpendicular to the contour lines. The cyan arrow is the unit direction vector û. The dashed amber arrow represents the directional derivative — the component of the gradient that aligns with your chosen direction.

Notice that when the unit vector û aligns perfectly with the gradient, the directional derivative equals the full magnitude of ∇f — you are climbing the steepest route. When û is perpendicular to ∇f, the directional derivative is zero because you are walking along a level curve where the function's value doesn't change. When û points opposite to the gradient, the directional derivative is negative — you are descending the steepest path.

Mathematical Framework

Let's build the formula step by step. Suppose you have a differentiable function f(x, y) and you want to find its rate of change at a point (x₀, y₀) in the direction of a unit vector û = ⟨a, b⟩.

GRADIENT VECTOR
∇f(x, y) = ⟨ ∂f/∂x , ∂f/∂y ⟩ = ⟨ fₓ , f_y ⟩
∇f (read "del f" or "nabla f") is the gradient. fₓ is the partial derivative of f with respect to x; f_y is the partial derivative with respect to y.
UNIT DIRECTION VECTOR
û = ⟨a, b⟩ where a² + b² = 1
If you're given a non-unit vector v = ⟨v₁, v₂⟩, normalize it: û = v / |v| = ⟨v₁ / √(v₁² + v₂²), v₂ / √(v₁² + v₂²)⟩.
DIRECTIONAL DERIVATIVE FORMULA
D_û f(x₀, y₀) = ∇f(x₀, y₀) · û = fₓ(x₀, y₀) × a + f_y(x₀, y₀) × b
This is the dot product of the gradient evaluated at the point and the unit direction vector. It gives a scalar (a single number), not a vector.
ANGLE FORM
D_û f = |∇f| × cos θ
θ is the angle between the gradient and the direction vector. This form shows that the directional derivative is maximized when θ = 0° (same direction as gradient) and zero when θ = 90° (perpendicular to gradient).
⚠️ Don't Forget to Normalize!
The most common mistake students make is forgetting to convert the direction vector into a unit vector before computing the dot product. If you use a vector that isn't length 1, your answer will be scaled incorrectly. Always check that a² + b² = 1 before plugging in.

Step-by-Step Process & Visualization

Computing a directional derivative follows a consistent sequence of steps. The diagram below walks through the full process visually, and the numbered list summarizes the algorithm you should follow every time.

The flowchart above traces the five-step algorithm from computing partial derivatives to the final scalar result. The mini-example at the bottom demonstrates each step with concrete numbers.
  1. Step 1: Find the partial derivatives fₓ and f_y by differentiating f with respect to each variable while treating the other as a constant.
  2. Step 2: Evaluate the partial derivatives at the given point (x₀, y₀) to get numerical values.
  3. Step 3: Assemble the gradient vector: ∇f(x₀, y₀) = ⟨fₓ(x₀, y₀), f_y(x₀, y₀)⟩.
  4. Step 4: Make sure the direction vector is a unit vector. If not, divide it by its magnitude.
  5. Step 5: Compute the dot product ∇f · û to get the directional derivative — a single number.

Worked Example

Let's work through a full problem from start to finish. Suppose you are given f(x, y) = 3x² − xy + 4y² and asked to find the directional derivative at the point (2, −1) in the direction of the vector v = ⟨1, 3⟩.

Directional Derivative of f(x, y) = 3x² − xy + 4y²
1
Step 1 — Find the partial derivativesDifferentiate f with respect to x (treat y as a constant): fₓ = ∂/∂x (3x² − xy + 4y²) = 6x − y. Differentiate f with respect to y (treat x as a constant): f_y = ∂/∂y (3x² − xy + 4y²) = −x + 8y.
fₓ = 6x − y, f_y = −x + 8y
2
Step 2 — Evaluate at the point (2, −1)Substitute x = 2 and y = −1 into each partial derivative. fₓ(2, −1) = 6(2) − (−1) = 12 + 1 = 13. f_y(2, −1) = −(2) + 8(−1) = −2 − 8 = −10.
fₓ = 13, f_y = −10
3
Step 3 — Form the gradient vectorCombine the evaluated partial derivatives into the gradient: ∇f(2, −1) = ⟨13, −10⟩.
∇f(2, −1) = ⟨13, −10⟩
4
Step 4 — Normalize the direction vectorThe given direction is v = ⟨1, 3⟩. Compute its magnitude: |v| = √(1² + 3²) = √(1 + 9) = √10. The unit vector is û = ⟨1/√10, 3/√10⟩.
û = ⟨1/√10, 3/√10⟩
5
Step 5 — Compute the dot productD_û f = ∇f · û = 13 × (1/√10) + (−10) × (3/√10) = 13/√10 − 30/√10 = (13 − 30)/√10 = −17/√10. Rationalizing the denominator: −17/√10 = −17√10/10 ≈ −5.38.
D_û f(2, −1) = −17/√10 ≈ −5.38
💡 Interpreting the Result
The negative value −5.38 tells us that as you move from the point (2, −1) in the direction ⟨1, 3⟩, the function f is decreasing at a rate of about 5.38 units of output per unit of distance traveled. If this were an elevation function, you would be heading downhill.

Directional Derivatives vs. Partial Derivatives

It's important to understand how directional derivatives relate to the partial derivatives you already know. Partial derivatives are actually special cases of directional derivatives — they measure change along the coordinate axes specifically. The table below clarifies the differences and connections.

Partial derivatives are special cases of directional derivatives.
FeaturePartial DerivativeDirectional Derivative
DirectionOnly along the x-axis or y-axisAlong any direction specified by a unit vector û
Notationfₓ or ∂f/∂x, f_y or ∂f/∂yD_û f or ∇f · û
Special case?Yes — D with û = ⟨1, 0⟩ gives fₓ; û = ⟨0, 1⟩ gives f_yGeneral case that includes partial derivatives
OutputA scalar (single number)A scalar (single number)
Maximum valueDepends on function and axis alignmentEquals |∇f| when û aligns with the gradient
KEY TAKEAWAY
Imagine a flashlight (the gradient) shining across a room. A partial derivative is like measuring how much light hits the north wall or the east wall specifically. A directional derivative is like measuring how much light you'd receive if you stood at any angle in the room. It generalizes partial derivatives to work in every direction, not just along the axes.

Connection to Advanced Topics

The directional derivative is a gateway to several powerful ideas in higher mathematics. Understanding it well positions you to tackle these more advanced concepts with confidence.

How directional derivatives connect to advanced multivariable calculus concepts.
This LessonAdvanced Extension
Directional derivative D_û f in 2DExtends naturally to 3D and higher dimensions: D_û f = ∇f · û works with three or more partial derivatives
Gradient ∇f points toward steepest ascentGradient descent algorithms in machine learning use −∇f to minimize loss functions iteratively
Dot product ∇f · û gives rate of changeThe total derivative (Jacobian matrix) generalizes this to vector-valued functions
D_û f = 0 perpendicular to ∇fLevel curves and implicit function theorem: solutions lie along surfaces where the gradient is normal

One of the most exciting modern applications is gradient descent, the optimization algorithm behind virtually all neural network training. The idea is simple: if you want to minimize a function (such as the error of a prediction model), repeatedly step in the direction of −∇f — the negative gradient — because that's the direction of steepest decrease. Everything you've learned about directional derivatives and gradients in this lesson is the mathematical foundation for that process.

Practice Problems

PROBLEM 1CONCEPTUAL
If the gradient of f at a point is ∇f = ⟨5, 0⟩, what is the directional derivative in the direction û = ⟨0, 1⟩ (the positive y-direction)? Explain your reasoning without doing arithmetic.
PROBLEM 2BASIC CALCULATION
Given f(x, y) = x² + 3y², find the directional derivative at the point (1, 1) in the direction of the unit vector û = ⟨√2/2, √2/2⟩.
PROBLEM 3INTERMEDIATE
Let f(x, y) = sin(x) × y². Find the directional derivative at the point (π/2, 3) in the direction of v = ⟨−4, 3⟩. (Remember to normalize v first.)
PROBLEM 4APPLIED
A topographic map models the elevation of a hillside as h(x, y) = 500 − 2x² − y², where x and y are measured in meters. A hiker stands at position (5, 10) and wants to walk in the direction toward the point (8, 14). At what rate is the elevation changing (in meters of height per meter of horizontal distance) as the hiker starts walking?
PROBLEM 5CRITICAL THINKING
For the function f(x, y) = eˣ × cos(y), find the direction (expressed as a unit vector) in which the directional derivative at the point (0, π/4) is maximized. Then find that maximum value. Finally, explain why no direction can produce a directional derivative larger than this maximum.

Lesson Summary

The directional derivative D_û f measures the instantaneous rate of change of a multivariable function f(x, y) at a specific point in the direction of a unit vector û. To compute it, first find the partial derivatives fₓ and f_y, evaluate them at the given point, and assemble them into the gradient vector ∇f = ⟨fₓ, f_y⟩. Then normalize the direction vector (if needed) and take the dot product: D_û f = ∇f · û.

Key insights to remember: the directional derivative is maximized when û aligns with ∇f (steepest ascent), equals zero when û is perpendicular to ∇f (moving along a level curve), and is most negative when û opposes ∇f (steepest descent). Partial derivatives are simply directional derivatives along the coordinate axes. This concept forms the foundation for gradient descent and optimization throughout mathematics, science, and machine learning.

Varsity Tutors • Multivariable Calculus • Directional Derivatives — Compute directional derivatives