CALCULUS 3 • MULTIVARIABLE FUNCTIONS & PARTIAL DERIVATIVES

Directional Derivatives via Gradient — Directional Derivatives via the Gradient

How the gradient vector unlocks the rate of change of a multivariable function in any direction.

Historical Context & Motivation

The study of how functions change has driven mathematics since the invention of calculus in the seventeenth century. For single-variable functions, the derivative captures the rate of change along the one available direction—the real line. However, once mathematicians and physicists began investigating surfaces, temperature fields, and potential functions defined over two or three variables, a richer question emerged: how does a function change when we move in an arbitrary direction through its domain? Answering that question required new tools—partial derivatives, the gradient vector, and ultimately the directional derivative.

1744
Euler's Partial Derivatives
Leonhard Euler formalized partial differentiation, enabling the study of functions of several variables and laying the algebraic groundwork for measuring change along coordinate axes independently.
1813
Cauchy Introduces the Gradient Concept
Augustin-Louis Cauchy explored rates of change in multiple directions while studying potential theory, contributing early ideas about combining partial derivatives into a single vector quantity.
1846
Hamilton's Nabla Operator
William Rowan Hamilton introduced the ∇ (nabla) operator and systematized the gradient as a vector field, unifying the partial derivatives of a scalar function into one compact symbol.
1871
Maxwell & Physical Gradients
James Clerk Maxwell's electromagnetic theory made heavy use of the gradient, showing that the electric field is the negative gradient of the electric potential—a directional derivative in every direction simultaneously.
1900s
Modern Multivariable Calculus
Directional derivatives became a standard topic in analysis and applied mathematics, essential in optimization, fluid dynamics, machine learning, and any field requiring sensitivity analysis along non-axis directions.

The central question this lesson addresses is elegant in its simplicity: if you stand on a surface described by z = f(x, y) and begin walking in some direction u, how steep is the terrain beneath your feet? Partial derivatives answer this only along the coordinate axes. The gradient, combined with a unit direction vector, answers it for every possible direction.

Core Principles & Definitions

Before we can compute directional derivatives via the gradient, we need to establish the foundational concepts that connect them. The directional derivative generalizes the notion of a partial derivative to arbitrary directions, while the gradient packages all partial derivative information into a single vector. The bridge between them is the dot product, which projects the gradient onto the chosen direction.

1

Partial Derivatives

The partial derivative fx measures the rate of change of f in the x-direction while holding y constant. Similarly, fy captures change in the y-direction. These are directional derivatives along the standard basis vectors.
2

The Gradient Vector

The gradient of a scalar function f is the vector ∇f = ⟨fx, fy⟩. It points in the direction of steepest ascent and its magnitude equals the maximum rate of change at that point.
3

Unit Direction Vector

A direction in ℝ² is specified by a unit vector u = ⟨cos θ, sin θ⟩ where θ is the angle measured from the positive x-axis. The vector must satisfy ‖u‖ = 1 so the derivative measures pure rate of change, not also speed.
4

Dot Product as Projection

The dot product ∇f · u computes the scalar projection of the gradient onto the direction u. Geometrically, this extracts how much of the gradient 'acts' along u, yielding the directional derivative Duf.
5

Differentiability Requirement

The gradient formula for directional derivatives requires that f be differentiable at the point of interest—not merely that partial derivatives exist. Differentiability guarantees that the tangent plane exists and approximates f well locally.
✦ KEY TAKEAWAY
Think of the gradient as a compass needle that always points uphill on a terrain map. The directional derivative in any direction u is simply how much of that uphill pull aligns with u. If you walk directly uphill (along ∇f), you experience the steepest climb. If you walk perpendicular to ∇f (along a level curve), the terrain is flat—a zero directional derivative. Walking at an angle gives you something in between, proportional to cos θ, where θ is the angle between ∇f and u.

Visual Explanation — The Gradient and Directional Derivatives

The diagram shows level curves of a function f with the point P at the center of interest. The gradient vector ∇f (violet) points perpendicular to the level curves toward steepest ascent. The unit direction vector u (cyan) indicates the desired direction. The directional derivative D_u f (green dashed) is the scalar projection of ∇f onto u.

In the diagram above, observe that the gradient ∇f is always perpendicular to the level curves, pointing toward increasing values of f. The directional derivative in the direction of u is determined entirely by the angle θ between ∇f and u. When θ = 0, the directional derivative reaches its maximum value of ‖∇f‖ because you are walking directly uphill. When θ = π/2, the directional derivative is zero—you are walking along a level curve where f does not change. When θ = π, the directional derivative equals −‖∇f‖, the steepest descent. This cosine dependence, Duf = ‖∇f‖ cos θ, is a direct consequence of the dot product formula ∇f · u.

Mathematical Framework

We now formalize the relationship between the gradient and the directional derivative. Let f : ℝ² → ℝ be differentiable at a point (a, b), and let u = ⟨u₁, u₂⟩ be a unit vector. The directional derivative of f at (a, b) in the direction of u is defined by a limit, but when f is differentiable the computation reduces to a simple dot product.

LIMIT DEFINITION
D_u f(a, b) = lim_{h→0} [f(a + h u₁, b + h u₂) − f(a, b)] / h
Here h is a scalar step size along the direction u = ⟨u₁, u₂⟩. This limit measures the instantaneous rate of change of f as we move from (a, b) along u.
GRADIENT FORMULA (THE KEY RESULT)
D_u f(a, b) = ∇f(a, b) · u = f_x(a, b) u₁ + f_y(a, b) u₂
∇f(a, b) = ⟨fx(a, b), fy(a, b)⟩ is the gradient vector; u = ⟨u₁, u₂⟩ is a unit vector with ‖u‖ = 1. This formula holds whenever f is differentiable at (a, b).
GEOMETRIC FORM
D_u f = ‖∇f‖ cos θ
θ is the angle between ∇f and u. Maximum rate of change = ‖∇f‖ (when θ = 0). Zero change when θ = π/2 (along level curves). Maximum decrease = −‖∇f‖ (when θ = π).
THREE-VARIABLE EXTENSION
D_u f(a, b, c) = ∇f · u = f_x u₁ + f_y u₂ + f_z u₃
For f : ℝ³ → ℝ, the gradient becomes ∇f = ⟨fx, fy, fz⟩ and u = ⟨u₁, u₂, u₃⟩ must satisfy u₁² + u₂² + u₃² = 1.
⚠ Common Pitfall
The direction vector must be a unit vector for the gradient formula to yield the correct directional derivative. If you are given a non-unit vector v, first normalize it by computing u = v / ‖v‖ before taking the dot product with ∇f. Forgetting this normalization step is one of the most frequent errors in multivariable calculus.

Geometric Interpretation — The Gradient and Level Curves

The geometric relationship between the gradient and level curves is one of the most illuminating results in multivariable calculus. At every point where ∇f ≠ 0, the gradient is orthogonal to the level curve passing through that point. This orthogonality is not a coincidence—it follows directly from the chain rule applied to a parameterization of the level curve. Along a level curve, f is constant, so its total differential is zero, which forces ∇f to be perpendicular to the tangent vector of the curve.

The cosine curve shows how the directional derivative varies with the angle θ between the gradient and the unit direction vector. The maximum occurs at θ = 0 (along ∇f), the zero crossings at θ = π/2 and 3π/2 (along level curves), and the minimum at θ = π (steepest descent).
Directional derivative values at key angles
Angle θDirection relative to ∇fD_u fInterpretation
0Same as ∇f‖∇f‖Maximum rate of increase (steepest ascent)
π/445° from ∇f‖∇f‖ × (√2/2)About 70.7% of maximum rate
π/2Perpendicular to ∇f0Along level curve; no change in f
πOpposite to ∇f−‖∇f‖Maximum rate of decrease (steepest descent)

Worked Example

Finding the Directional Derivative of f(x, y) = x²y − 3xy + y² at (2, 1) in the Direction of v = ⟨3, 4⟩
1
Step 1 — Compute the Partial DerivativesWe need fx and fy. Differentiating f(x, y) = x²y − 3xy + y² with respect to x: fx = 2xy − 3y. Differentiating with respect to y: fy = x² − 3x + 2y.
fx = 2xy − 3y, fy = x² − 3x + 2y
2
Step 2 — Evaluate the Gradient at (2, 1)Substitute x = 2 and y = 1 into the partial derivatives. fx(2, 1) = 2(2)(1) − 3(1) = 4 − 3 = 1. fy(2, 1) = (2)² − 3(2) + 2(1) = 4 − 6 + 2 = 0.
∇f(2, 1) = ⟨1, 0⟩
3
Step 3 — Normalize the Direction VectorThe given direction is v = ⟨3, 4⟩, which is not a unit vector. Compute its magnitude: ‖v‖ = √(3² + 4²) = √(9 + 16) = √25 = 5. The unit vector is u = v / ‖v‖ = ⟨3/5, 4/5⟩.
u = ⟨3/5, 4/5⟩ = ⟨0.6, 0.8⟩
4
Step 4 — Compute the Directional Derivative via the Dot ProductApply the gradient formula: Duf(2, 1) = ∇f(2, 1) · u = ⟨1, 0⟩ · ⟨3/5, 4/5⟩ = (1)(3/5) + (0)(4/5) = 3/5.
D_u f(2, 1) = 3/5 = 0.6
5
Step 5 — Interpret the ResultThe directional derivative is 3/5, meaning that at the point (2, 1), the function f increases at a rate of 0.6 units per unit step in the direction of ⟨3, 4⟩. Since the gradient at this point is ⟨1, 0⟩ (pointing purely in the x-direction), and our direction has a positive x-component, the positive result makes geometric sense. The maximum possible rate of change at (2, 1) is ‖∇f‖ = 1, achieved by moving in the direction ⟨1, 0⟩.

Comparisons — Partial vs. Directional Derivatives

It is instructive to compare the directional derivative with its simpler cousins—partial derivatives—and to note both the strengths and limitations of the gradient-based formula. Understanding when the formula applies (and when it does not) is essential for correct usage in applications.

Partial derivatives vs. directional derivatives
FeaturePartial DerivativeDirectional Derivative via Gradient
DirectionOnly along coordinate axes (x or y)Any unit vector u in the domain
Formulaf_x or f_y (single derivative)∇f · u (dot product)
OutputScalar (rate of change along axis)Scalar (rate of change along u)
RequirementPartial derivative exists at the pointf must be differentiable at the point
Special casef_x = D_{⟨1,0⟩} f, f_y = D_{⟨0,1⟩} fReduces to partial derivatives when u is a standard basis vector
LimitationCannot capture off-axis behaviorRequires differentiability, not just existence of partials
✦ KEY TAKEAWAY
Think of partial derivatives as measuring the slope of a terrain when you walk due north or due east. The directional derivative via the gradient lets you measure the slope in any compass direction—and the gradient is your master slope gauge, encoding the steepness and heading of the steepest path in a single vector. In engineering optimization, this is precisely why gradient descent works: at each step you move opposite to the gradient to decrease a cost function as rapidly as possible.

Connection to Advanced Theory

The directional derivative and the gradient are not endpoints of multivariable calculus—they are gateways to deeper structures. In higher dimensions, the gradient generalizes to the total derivative (or Jacobian), and directional derivatives become essential in functional analysis and differential geometry. Here we briefly survey the most important connections that a student of Calculus 3 will encounter next.

From directional derivatives to advanced mathematics
Concept in This LessonAdvanced ExtensionWhere You'll See It
∇f (gradient of scalar)Jacobian matrix J for vector-valued functions F : ℝⁿ → ℝᵐLinear algebra, differential equations, robotics
D_u f = ∇f · uFréchet derivative Df(a)(h) for functions on Banach spacesFunctional analysis, PDE theory
‖∇f‖ = max rate of changeGradient descent / ascent algorithmsMachine learning, optimization, neural networks
∇f ⊥ level curvesNormal vectors to surfaces, tangent planes, implicit function theoremDifferential geometry, constrained optimization (Lagrange multipliers)
Directional derivative along curvesLie derivatives, covariant derivatives on manifoldsGeneral relativity, advanced differential geometry

Perhaps the most immediate application students encounter after this lesson is Lagrange multipliers. When optimizing f subject to a constraint g(x, y) = c, the key insight is that at an optimum, the gradient ∇f must be parallel to ∇g—any directional derivative of f along the constraint curve must vanish, which happens precisely when ∇f is perpendicular to the constraint curve. This perpendicularity condition is nothing more than requiring Duf = 0 for every tangent direction u of the constraint.

Practice Problems

PROBLEM 1 — CONCEPTUAL
Explain why the directional derivative of a differentiable function f at a point P in the direction perpendicular to ∇f(P) is always zero. What does this tell us about the geometry of level curves?
PROBLEM 2 — BASIC CALCULATION
Let f(x, y) = 3x² + y². Find the directional derivative of f at the point (1, 2) in the direction of the vector v = ⟨1, 1⟩.
PROBLEM 3 — INTERMEDIATE
Let f(x, y) = eˣ sin y. At the point (0, π/3), find the direction in which f increases most rapidly and the maximum rate of increase.
PROBLEM 4 — APPLIED
The temperature in a room is modeled by T(x, y, z) = 100 − x² − 2y² − z² (in °C), where distances are in meters. A sensor is located at the point (1, 1, 2). In which direction should you move the sensor to experience the most rapid temperature increase, and what is that rate?
PROBLEM 5 — CRITICAL THINKING
Suppose f : ℝ² → ℝ has the property that Duf(a, b) = 3 in the direction u = ⟨1, 0⟩ and Dvf(a, b) = −1 in the direction v = ⟨0, 1⟩. Assuming f is differentiable at (a, b), determine ∇f(a, b) and then find the directional derivative of f at (a, b) in the direction making a 60° angle with the positive x-axis.

Lesson Summary

The directional derivative Duf measures the instantaneous rate of change of a scalar function f in the direction of a unit vector u. When f is differentiable, this derivative can be computed elegantly via the gradient formula: Duf = ∇f · u = fx u₁ + fy u₂. The gradient vector ∇f encodes all directional information: it points in the direction of steepest ascent, its magnitude ‖∇f‖ gives the maximum rate of change, and it is always perpendicular to the level curves of f.

The geometric form Duf = ‖∇f‖ cos θ reveals that the directional derivative is maximized when u aligns with ∇f (θ = 0), vanishes when u is tangent to a level curve (θ = π/2), and is most negative when u opposes ∇f (θ = π). Always remember to normalize your direction vector before computing the dot product. These ideas extend naturally to three and higher dimensions and form the foundation for gradient-based optimization, Lagrange multipliers, and the analysis of vector fields throughout applied mathematics and the sciences.

Varsity Tutors • Calculus 3 • Directional Derivatives via Gradient