Key takeaways
- Directional derivative: Dᵤf = ∇f · û = (∂f/∂x)·u₁ + (∂f/∂y)·u₂.
- The direction must be a unit vector (length 1). Divide by its length first.
- Positive means uphill, negative means downhill, zero means along a contour.
- The largest possible value is |∇f|, reached by walking along the gradient.
In this guide
What is a directional derivative?
Think of f(x, y) as the height of a hill. A partial derivative tells you the slope if you walk exactly east (the x direction) or exactly north (the y direction). But what if you walk north-east, or in any other direction? The directional derivative gives the slope in that chosen direction.
- A positive answer means you are going uphill.
- A negative answer means you are going downhill.
- Zero means you are walking along a contour line, staying at the same height.
Why does the directional derivative matter?
In real life we rarely move exactly along the x or y axis. A drone flies on a heading, wind blows at an angle, and a hiking trail winds across a slope. The directional derivative answers the practical question: how fast does the quantity change along my path?
It also explains why the gradient is special. Of all directions, the gradient direction gives the biggest directional derivative, and its value is exactly |∇f|.
Once you know the gradient, the slope in every possible direction is just one dot product away.
The formula
| Symbol | What it means | Example |
|---|---|---|
| Dᵤf | Rate of change of f in direction u | 8 |
| ∇f | The gradient vector at the point | (8, 4) |
| (u₁, u₂) | The direction you type in (any length) | (3, 4) |
| û | The unit vector: (u₁, u₂) ÷ √(u ₁² + u₂²) | (0.6, 0.8) |
| (x₀, y₀) | The point where you stand | (1, 2) |
This calculator uses the fixed function f(x, y) = x²y², so ∇f = (2xy², 2x²y). You enter the point (x₀, y₀) and any direction (u₁, u₂). It turns the direction into a unit vector for you. The direction can't be (0, 0), since that has no direction.
How to find a directional derivative step by step
- 1Find the gradient at the point. For x²y² at (1, 2):
∇f = (2·1·4, 2·1·2) = (8, 4). - 2Find the length of the direction.
√(u₁² + u₂²), for example√(3² + 4²) = 5. - 3Make it a unit vector. Divide each part by the length:
(3/5, 4/5) = (0.6, 0.8). - 4Take the dot product. Multiply matching parts and add:
8 × 0.6 + 4 × 0.8 = 8.
Now choose your own point and direction below. The calculator normalises the direction and shows the dot product.
Try it yourself
Pre-filled with the example — change any value.
Common mistakes to avoid
- Evaluating the gradient at the wrong point. Use the point where you stand, not the direction numbers.
- Forgetting that direction matters. Walking the opposite way flips the sign of the answer.
- Expecting it to beat |∇f|. The largest possible value equals the length of the gradient. Here
|∇f| = √(8² + 4²) ≈ 8.94. - Mixing up the dot product. It is a single number, not a vector.
Tips and tricks
- Steepest direction: walk along ∇f. Its unit vector here is about (0.894, 0.447).
- Level direction: any direction at right angles to ∇f gives Dᵤf = 0.
- Dot product help: see the dot product calculator for more practice.
Where you'll use it in real life
- Drones and aircraft: how fast temperature or pressure changes along a flight heading.
- Weather: how quickly pressure drops in the direction the wind blows.
- Hiking and roads: the steepness of a trail or road in the direction it runs.
- Machine learning: comparing how an error changes along different search directions.
Quick summary
The directional derivative is the slope of f in a chosen direction: find the gradient, turn your direction into a unit vector, and take the dot product. Its biggest value is |∇f|. Use the calculator above to try any point and direction on f = x²y².
Worked example
On a surface with height f(x, y) = x²y², you stand at the point (1, 2) and walk in the direction of the vector (3, 4). How fast does the height change per unit step? Enter x₀ = 1, y₀ = 2, u₁ = 3 and u₂ = 4.
- 01f(x,y) = x²y²
- 02∂f/∂x = 2xy², ∂f/∂y = 2x²y
- 03At (1, 2): ∇f = (8, 4)
- 04Direction vector: (3, 4), magnitude = 5
- 05Unit vector û = (0.6, 0.8)
- 06Dᵤf = ∇f · û = 8×0.6 + 4×0.8
- 07= 8
These numbers are pre-filled in the calculator above.
Frequently asked questions
Why do I need a unit vector for the directional derivative?
The answer should measure change per one unit of distance. A longer vector would scale the result up, so you divide by its length to make it exactly 1.
What is the maximum directional derivative?
It equals |∇f|, the length of the gradient, and it happens when you move in the same direction as the gradient.
How is a directional derivative different from a partial derivative?
A partial derivative is a directional derivative in one special direction: along the x-axis (1, 0) or the y-axis (0, 1). The directional derivative works for any direction.
Which function does this calculator use?
It always uses f(x, y) = x²y². You choose the point and the direction, and it does the rest.


