Gradient Calculator

Compute the gradient of a 2D or 3D scalar field at any point.
Choose a function type, enter coefficients and evaluation point, and get the partial derivatives.

Gradient

The gradient of a scalar field f is a vector pointing in the direction of the steepest increase. At any point, it tells you which direction to step to increase f most rapidly. The magnitude of the gradient equals the slope in that steepest direction.

For f(x,y), the gradient is the vector: del f = (df/dx, df/dy)

Each component is a partial derivative — the rate of change along one axis with the other held fixed.

This calculator handles three function forms:

Separable sum: f(x,y) = ax^p + by^q. Partial derivatives are df/dx = pax^(p-1) and df/dy = qby^(q-1). These are independent of each other because x and y appear in separate terms.

Product: f(x,y) = ax^p * y^q. Now both variables mix: df/dx = pax^(p-1)y^q and df/dy = qax^py^(q-1). The y term survives in the x-derivative and vice versa.

3D separable: f(x,y,z) = ax^p + by^q + cz^r. The gradient becomes a 3D vector with a third component df/dz = rcz^(r-1).

Worked example: f(x,y) = 3x^2 + 2y^3 at (1, 2). df/dx = 6x = 6(1) = 6. df/dy = 6y^2 = 6(4) = 24. Gradient = (6, 24), magnitude = sqrt(36 + 576) = sqrt(612) = 24.74. From point (1,2), the function increases fastest in the direction (6, 24) — mostly along the y-axis.

The gradient is always perpendicular to the level curves of the function. This is why gradient descent in machine learning follows the negative gradient: it is guaranteed to move downhill 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.

Embed This Calculator

Copy the code below and paste it into your website or blog.
The calculator will work directly on your page.