Skip to content
Calcrivo

Gradient Calculator

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

Inputs

Enter function using x and y as variables.

∂f/∂x

3.00000000

∂f/∂y

3.00000000

|∇f|

4.24264069

Step by step

  1. Values used

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

  2. Gradient vector

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

  3. Magnitude

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

  4. ∂f/∂x

    = 3.00000000

  5. ∂f/∂y

    = 3.00000000

  6. |∇f|

    = 4.24264069

How it works

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

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.

You might also need