What Is a Directional Derivative?
Partial derivatives measure change along the axes, due east (∂f/∂x) and due north (∂f/∂y). But a hiker can walk in any direction, and the directional derivative answers the general question: standing at a point, moving in the direction of a unit vector u, how fast does f change? The formula is a single dot product:
Duf = ∇f · u = fx·u₁ + fy·u₂
The gradient ∇f, computed once, contains everything: dot it against any unit direction and out comes that direction's rate of change. Partial derivatives are the special cases u = ⟨1, 0⟩ and u = ⟨0, 1⟩, the axes are just two directions among infinitely many, no longer privileged once the gradient is in hand.
How to Use This Calculator
Enter the function, the point, and a direction vector, any length; the calculator normalizes it to a unit vector first, since directional derivatives are defined per unit of distance traveled. You'll see the gradient evaluated at the point, the normalization arithmetic, the dot product carried out term by term, and a context line comparing your direction's rate against the maximum possible |∇f|, how much of the steepest slope your chosen bearing captures. The plot draws the level curve through your point; directions along it give Duf = 0, perpendicular to it give ±|∇f|.
Worked Example
f(x, y) = x²y at (1, 2), toward v = ⟨3, 4⟩. The gradient: fx = 2xy = 4 and fy = x² = 1, so ∇f = ⟨4, 1⟩. Normalize the direction: |v| = 5, u = ⟨3/5, 4/5⟩. Dot product:
Duf = 4·(3/5) + 1·(4/5) = 16/5 = 3.2
Interpretation: walking from (1, 2) in the ⟨3, 4⟩ direction, f climbs 3.2 units per unit of ground covered. The maximum possible here is |∇f| = √17 ≈ 4.123, this bearing achieves about 78% of the steepest climb. Note what normalization prevented: using ⟨3, 4⟩ raw would have quintupled the answer, measuring change per five units of distance instead of one.
Reading Duf: the Compass of Rates
| Direction u | Duf | Meaning |
|---|---|---|
| Along ∇f | +|∇f| | Steepest ascent, the maximum |
| Against ∇f | −|∇f| | Steepest descent |
| Perpendicular to ∇f | 0 | Walking a contour, level ground |
| Angle θ from ∇f | |∇f| cos θ | Everything in between |
The bowl chips demonstrate the extremes live: at (1,1) on x² + y², the diagonal ⟨1,1⟩ is exactly the gradient direction (maximum rate 2√2), while ⟨−1,1⟩ runs along the circular contour (rate exactly 0).
Common Mistakes to Avoid
- Skipping normalization. The definition demands a unit vector; an unnormalized direction scales the answer by its length, breaking the per-unit-distance meaning. This calculator normalizes automatically and shows the division.
- Evaluating the gradient at the wrong point. ∇f is a function of position, compute the partials symbolically, then substitute the point, in that order.
- Confusing Duf with the slope of the surface's silhouette. It's the rate of change of f per horizontal distance in direction u, the rise-over-run of the path a hiker's altitude takes, not a 3D angle.
- Expecting a vector answer. Duf is a scalar, one number per direction. The vector in the story is the gradient; the directional derivative is its shadow on your chosen bearing.
Real-World Applications
Directional derivatives answer "what happens if we move this way?", the essential question of constrained movement over a landscape. In machine learning, line searches probe the loss surface along a proposed update direction before committing, evaluating exactly Duf; coordinate descent optimizes along chosen axes; and the entire logic of gradient descent rests on the fact that no direction beats −∇f. Terrain analysis in civil engineering rates a proposed road's grade as the directional derivative of elevation along the route's bearing, cut a road diagonally across a steep hillside and its climb rate is |∇f| cos θ, the road-builder's oldest trick for taming slopes.
In heat transfer and diffusion, the flux through a surface depends on the temperature or concentration's directional derivative along the surface normal, Fourier's and Fick's laws evaluated in a specific direction; in meteorology, temperature advection (how fast a thermometer reading changes for an aircraft flying a given heading) is a directional derivative of the temperature field along the flight vector. Whenever a field is sampled along a path, this dot product is the rate the instruments record.
Frequently Asked Questions
Why does the formula ∇f · u work?
Chain rule: moving along x(t) = x₀ + t·u₁, y(t) = y₀ + t·u₂ and differentiating f(x(t), y(t)) at t = 0 gives f_x·u₁ + f_y·u₂, the multivariable chain rule collapsing motion in a straight line into a dot product with the gradient.
Can the directional derivative be negative?
Whenever the direction has a downhill component, cos θ < 0 for θ beyond 90° from the gradient. The sign tells you ascent versus descent; the magnitude tells you how briskly.
What if the gradient is zero at my point?
Then every directional derivative is zero, flat in all directions, the signature of a critical point (peak, pit, or saddle). Classifying which requires second-order information via the Hessian Matrix Calculator.
How do I specify a direction by angle instead of a vector?
Convert: a bearing at angle θ from the positive x-axis is the vector ⟨cos θ, sin θ⟩, already unit length. For example, 30° is ⟨0.866, 0.5⟩. Enter those components and the calculator proceeds identically.
Does this extend to three variables?
Directly: Duf = ∇f · u with three-component gradients and unit vectors. The geometry story survives, steepest ascent along ∇f, zero rate on the level surface perpendicular to it, with contour curves upgraded to level surfaces.
Is there a direction where the rate equals any target value I choose?
Any target between −|∇f| and +|∇f|, yes, cos θ sweeps continuously from 1 to −1 as the bearing rotates, so every intermediate rate is achieved at exactly two symmetric bearings. Targets beyond ±|∇f| are impossible: the gradient's magnitude is a hard speed limit on rates of change at that point.
In which direction is the directional derivative largest?
In the direction of the gradient vector, where it equals the gradient magnitude. The directional derivative is smallest, most negative, in the opposite direction, and zero along any direction perpendicular to the gradient, meaning along the level curve through the point.