Gradient Vector Calculator
Compute the gradient ∇f = (∂f/∂x, ∂f/∂y) of a two-variable function at a chosen point, along with its magnitude.
Function f(x, y)
Length of the gradient vector at the point
- 1
∂f/∂x at (x, y)
2Estimated by central difference: [f(x+h, y) − f(x−h, y)] ÷ 2h with h = 10⁻⁵. - 2
∂f/∂y at (x, y)
4 - 3
Magnitude |∇f|
√(2² + 4²) = 4.4721
How does this calculator work?
The gradient ∇f = (∂f/∂x, ∂f/∂y) collects a function's partial derivatives and points toward its steepest increase. This tool evaluates both partials numerically by central differences at your chosen point and reports the components plus the magnitude |∇f| = √(fx² + fy²), the rate of fastest change there.
Formula
How this is calculated
The gradient of a scalar function f(x, y) is the vector of its first partial derivatives, ∇f = (∂f/∂x, ∂f/∂y). It points in the direction of steepest increase of f, and its magnitude |∇f| gives the rate of that increase. Select a function from the list and enter the point (x, y) at which you want the gradient evaluated.
Each partial derivative is estimated numerically using the symmetric (central) difference formula, ∂f/∂x ≈ [f(x+h, y) − f(x−h, y)] / (2h) with a small step h = 1e-5, and similarly for ∂f/∂y. Central differences have second-order accuracy, so for smooth functions the result matches the exact analytic derivative to several decimal places. The magnitude is then the Euclidean norm of the two components.
Inputs x and y are plain real numbers in whatever units the function uses; the gradient components carry units of f per unit of x (or y). Avoid points where the function is undefined or singular — for example f = ln(x² + y²) blows up at the origin, and a very small denominator there makes the numeric derivative unreliable. At a local extremum or saddle point the gradient is the zero vector, so the magnitude is zero.
Frequently asked questions
It is the steepest rate of change of the function at that point. The gradient vector points in the direction of fastest increase, and |∇f| is how fast f rises in that direction per unit distance.
Central differences let the tool evaluate the gradient for any selected function without symbolic differentiation. With step h = 1e-5 they are accurate to roughly 1e-10 relative error for smooth functions.
At critical points — local maxima, minima, and saddle points — both partial derivatives vanish, so ∇f = (0, 0) and the magnitude is 0.
Also known as
TG we-Calculate Editorial Team. (2026). Gradient Vector Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/gradient-calculator
TG we-Calculate Editorial Team. "Gradient Vector Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/gradient-calculator.
TG we-Calculate Editorial Team, "Gradient Vector Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/gradient-calculator
@misc{wecalculate_gradient_calculator, title = {Gradient Vector Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/gradient-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
