Skip to content
    Calculus

    Directional Derivative: Formula and Examples

    Walking north-east up a hill, how steep is your path? A partial derivative only tells you the slope going exactly east or exactly north. The directional derivative gives the slope in any direction you choose. This guide shows how, using the gradient and one dot product.

    Math Solver Academic Editorial Board5 min read

    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
    1. 01What is a directional derivative?
    2. 02Why does the directional derivative matter?
    3. 03The formula
    4. 04How to find a directional derivative step by step
    5. 05Common mistakes to avoid
    6. 06Tips and tricks
    7. 07Where you'll use it in real life
    8. 08Quick summary
    9. 09Worked example
    10. 10Frequently asked questions

    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

    Dᵤf = ∇f · û = (∂f/∂x)·û₁ + (∂f/∂y)·û₂
    SymbolWhat it meansExample
    DᵤfRate of change of f in direction u8
    ∇fThe 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

    1. 1Find the gradient at the point. For x²y² at (1, 2): ∇f = (2·1·4, 2·1·2) = (8, 4).
    2. 2Find the length of the direction. √(u₁² + u₂²), for example √(3² + 4²) = 5.
    3. 3Make it a unit vector. Divide each part by the length: (3/5, 4/5) = (0.6, 0.8).
    4. 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.

    🧮
    Calculus
    University

    Directional Derivative

    Compute the directional derivative of f(x,y) = ax²y² in direction (u₁, u₂) at (x₀, y₀).

    Dᵤf = ∇f · û

    f'(x) slope
    Tangent Line dy/dx
    0.120
    120
    0.120
    0.120

    💡 Example

    Reference
    Inputs:x0=1, y0=2, u1=1, u2=1
    Result:8.4853
    Open the full Directional Derivative calculator

    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.

    1. 01f(x,y) = x²y²
    2. 02∂f/∂x = 2xy², ∂f/∂y = 2x²y
    3. 03At (1, 2): ∇f = (8, 4)
    4. 04Direction vector: (3, 4), magnitude = 5
    5. 05Unit vector û = (0.6, 0.8)
    6. 06Dᵤf = ∇f · û = 8×0.6 + 4×0.8
    7. 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.

    #Calculus#University#Directional Derivative
    Updated

    Keep reading

    Sponsored ToolsAd

    More tools on Ytools →
    Calcu.click — 25+ Free Smart Calculators preview

    Calcu.click — 25+ Free Smart Calculators

    Brand new calculation platform with 0ms reactive math, 100% client-side privacy, and dedicated subdomains. Fast calculators for EMI, SIP, Mortgage, Income Tax, BMI, Age, Percentage, and more.

    25+ CalculatorsFinanceHealth0ms Real-TimeFree
    Keyboard Arena preview

    Keyboard Arena

    Master touch typing with real-time WPM speed tests, mechanical switch audio, A-Z finger biomechanics drills, 40+ structured lessons, and competitive arcade games.

    Typing TestWPMTouch Typing
    Flutter Log Explorer preview

    Flutter Log Explorer

    Real-time structured log viewer and search explorer for Flutter & Dart. Zero-config capture from Debug Adapter (DAP) & Dart VM Service with smart classification and filters.

    FlutterDartVS Code ExtensionOpen VSX