Skip to content
ENExplore Calculators

Gradient Calculator

Compute the gradient vector of a polynomial function in x and y at a given point.

About Gradient Calculator

The gradient ∇f = (∂f/∂x, ∂f/∂y) points in the direction of steepest ascent. Its magnitude gives the rate of maximum increase. Computed numerically using central differences for each partial derivative.

Formulas

Gradient vector

∇f = (∂f/∂x, ∂f/∂y)

∇f
Gradient vector
∂f/∂x
Partial derivative w.r.t. x
∂f/∂y
Partial derivative w.r.t. y

Magnitude

|∇f| = sqrt((∂f/∂x)² + (∂f/∂y)²)

|∇f|
Gradient magnitude

Worked example

With the default values below, Gradient Calculator returns ∂f/∂x of 3.00000000. Change any input above and every figure here is recalculated in your browser.

Inputs used

f(x, y)
x^2 + y^2 + x*y
x value
1
y value
1

Results

∂f/∂x
3.00000000
∂f/∂y
3.00000000
|∇f|
4.24264069

Step by step

  1. 1Values used
  2. 2Gradient vector
  3. 3Magnitude
  4. 4∂f/∂x= 3.00000000
  5. 5∂f/∂y= 3.00000000
  6. 6|∇f|= 4.24264069

Assumptions and limits

  • The result is derived only from the 3 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 8 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

What does the gradient represent?

The gradient points in the direction of greatest increase of the function and its magnitude gives the rate of that increase.

How is the gradient used in optimization?

Gradient descent moves in the negative gradient direction to find function minima, which is the basis of machine learning optimization.

Gradient Calculator – Calculate ∂f/∂x & ∂f/∂y | Calcrivo