Directional Derivative Calculator
Compute the directional derivative of a 2D scalar field at any point.
Enter function coefficients, a direction vector, and evaluation point to get the result.
The directional derivative measures how fast a scalar function changes as you move in a specific direction — not just along an axis, but in any direction you choose.
Given a scalar field f(x,y) and a direction vector u = (ux, uy), the directional derivative at a point (x0, y0) is:
D_u f = nabla_f dot u_hat
where nabla_f = (df/dx, df/dy) is the gradient and u_hat = u / |u| is the unit vector in the chosen direction. The dot product projects the gradient onto that direction.
This calculator supports two function forms:
Separable sum: f(x,y) = ax^p + by^q. Gradient = (pax^(p-1), qby^(q-1)). Product: f(x,y) = ax^p * y^q. Gradient = (pax^(p-1)y^q, qax^py^(q-1)).
You can enter any direction vector — the calculator normalizes it to a unit vector automatically. Entering (1,0) gives the x-partial derivative. Entering (0,1) gives the y-partial. Entering (1,1) gives the rate of change along the 45-degree diagonal.
Worked example: f(x,y) = 3x^2 + 2y at (1, 2), direction (1, 1). Gradient = (6x, 2) = (6, 2) at the point. Unit vector = (1,1)/sqrt(2) = (0.707, 0.707). D_u f = 60.707 + 20.707 = 4.243 + 1.414 = 5.657.
The maximum directional derivative equals the gradient magnitude and occurs when u points in the gradient direction. The minimum (steepest descent) is the negative gradient direction. In any perpendicular direction, the directional derivative is exactly zero.
Gradient descent in machine learning follows the negative gradient precisely because that is the direction of steepest descent at every step.
How we build and check this calculator
This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.
SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.