A contour map of f of x and y equals x squared y plus y, with equally scaled axes. The amber arrow shows the gradient direction; its drawn length is fixed. A teal probe shows a chosen unit direction. Readouts give both partial derivatives, the gradient magnitude, and the directional derivative. Buttons align the probe exactly with the gradient or perpendicular to it. A perpendicular probe is tangent to the contour at the selected point and has zero directional derivative; a finite straight step can still change the function. At x equals two and y equals three, the partial derivatives are twelve and five and the gradient magnitude is thirteen.

Gradient and directional derivative

The contour map of f(x,y) = x²y + y. The amber arrow shows the gradient direction. Choose a unit direction u with the teal probe and read its directional derivative, ∇f · u.

probe direction θ 53°
point (x, y)(2.00, 3.00)
∂f/∂x = 2xy12.00
∂f/∂y = x²+15.00
|∇f| (steepest slope)13.00
slope along probe ∇f·u11.20

The amber arrow shows direction; its drawn length is fixed. The numerical readout |∇f| gives the steepest slope per unit distance. For a small step of length h along the probe, the first-order predicted change is h(∇f·u). A perpendicular probe is tangent to the contour at the point: its directional derivative is zero, but a finite straight step may leave the contour.