Gradient Calculator

Published on: July 12, 2026

This Gradient Calculator helps you find the gradient vector of a multivariable function and evaluate it at a given point if needed. The calculator finds the required partial derivatives and combines them to form ∇f in two or three variables. If a point is provided, it then substitutes the coordinates to evaluate the gradient there. It is a simple way to check answers, understand the method clearly, and practise multivariable calculus step by step.

Step-by-step method

  1. Identify the variables and the function f.
  2. Compute each partial derivative with substeps.
  3. Combine them into the gradient vector ∇f.
  4. If a point is given, evaluate ∇f at the point.
  5. Compute the magnitude of the gradient at the point.

Formulas:

Gradient vector formula

2D: ∇f = ⟨ fx, fy
3D: ∇f = ⟨ fx, fy, fz

Magnitude formula

2D: |∇f( x0, y0 )| = fx(x0,y0)2 + fy(x0,y0)2
3D: |∇f( x0, y0, z0 )| = fx(x0,y0,z0)2 + fy(x0,y0,z0)2 + fz(x0,y0,z0)2

Example 1: f(x,y)=yx^2+sin(xy); (1,2)

Step 1 - Identify the variables and the function.

In this problem: Variables: x, y | Point provided.

f(x, y) = yx2 + sin(xy)

Step 2A - Differentiate term 1 with respect to x.

In this problem: Rule shown by the math.

∂x
(yx2) = y·
∂x
(x2)

Step 2B - Differentiate term 1 with respect to x.

In this problem: Rule shown by the math.

∂x
(x2) = 2x

Step 2C - Differentiate term 1 with respect to x.

In this problem: Rule shown by the math.

∂x
(yx2) = 2xy

Step 2D - Differentiate term 2 with respect to x.

In this problem: Rule shown by the math.

∂x
(sin(xy)) = cos(xy)·
∂x
(xy)

Step 2E - Differentiate term 2 with respect to x.

In this problem: Rule shown by the math.

∂x
(xy) = y

Step 2F - Differentiate term 2 with respect to x.

In this problem: Rule shown by the math.

cos(xy)·y = y·cos(xy) = y·cos(xy)

Step 2G - Combine the results.

In this problem: Add the derivatives from the previous substeps.

fx = 2xy + y·cos(xy) = y(2x + cos(xy))

Step 3A - Differentiate term 1 with respect to y.

In this problem: Rule shown by the math.

∂y
(yx2) = x2·
∂y
(y)

Step 3B - Differentiate term 1 with respect to y.

In this problem: Rule shown by the math.

∂y
(y) = 1

Step 3C - Differentiate term 1 with respect to y.

In this problem: Rule shown by the math.

∂y
(yx2) = x2

Step 3D - Differentiate term 2 with respect to y.

In this problem: Rule shown by the math.

∂y
(sin(xy)) = cos(xy)·
∂y
(xy)

Step 3E - Differentiate term 2 with respect to y.

In this problem: Rule shown by the math.

∂y
(xy) = x

Step 3F - Differentiate term 2 with respect to y.

In this problem: Rule shown by the math.

cos(xy)·x = x·cos(xy) = x·cos(xy)

Step 3G - Combine the results.

In this problem: Add the derivatives from the previous substeps.

fy = x2 + x·cos(xy) = x(x + cos(xy))

Step 4 - Combine into the gradient vector.

In this problem: Put the partial derivatives into ⟨ … ⟩.

∇f = ⟨ y(2x + cos(xy)), x(x + cos(xy)) ⟩

Step 5A - Substitute the point into fx.

In this problem: Substitute the point values.

fx( 1, 2 ) = 2(2 + cos( 2 ))

Step 5B - Simplify fx at the point.

In this problem: Simplify the substituted expression.

fx( 1, 2 ) = 2(2 + cos( 2 )) ≈ 3.17

Step 5C - Substitute the point into fy.

In this problem: Substitute the point values.

fy( 1, 2 ) = 1 + cos( 2 )

Step 5D - Simplify fy at the point.

In this problem: Simplify the substituted expression.

fy( 1, 2 ) = 1 + cos( 2 ) ≈ 0.58

Step 6 - Gradient at the point.

In this problem: Put the evaluated components into ⟨ … ⟩.

∇f( 1, 2 ) = ⟨ 3.17, 0.58 ⟩

Step 7A - Magnitude of the gradient.

In this problem: Use the magnitude formula.

|∇f( 1, 2 )| = 2(2 + cos( 2 ))2 + 1 + cos( 2 )2

Step 7B - Simplify the magnitude.

In this problem: Simplify the square root.

|∇f( 1, 2 )| = 17 + 5cos( 2 )2 + 18·cos( 2 ) ≈ 3.22

Final answer: Gradient computed

Example 2: f(x,y)=x^2+y^2; (2,1)

Step 1 - Identify the variables and the function.

In this problem: Variables: x, y | Point provided.

f(x, y) = x2 + y2

Step 2A - Differentiate term 1 with respect to x.

In this problem: Rule shown by the math.

∂x
(x2) = 2x

Step 2B - Differentiate term 2 with respect to x.

In this problem: Rule shown by the math.

∂x
(y2) = 0

Step 2C - Combine the results.

In this problem: Add the derivatives from the previous substeps.

fx = 2x + 0 = 2x

Step 3A - Differentiate term 1 with respect to y.

In this problem: Rule shown by the math.

∂y
(x2) = 0

Step 3B - Differentiate term 2 with respect to y.

In this problem: Rule shown by the math.

∂y
(y2) = 2y

Step 3C - Combine the results.

In this problem: Add the derivatives from the previous substeps.

fy = 0 + 2y = 2y

Step 4 - Combine into the gradient vector.

In this problem: Put the partial derivatives into ⟨ … ⟩.

∇f = ⟨ 2x, 2y ⟩

Step 5A - Substitute the point into fx.

In this problem: Substitute the point values.

fx( 2, 1 ) = 4

Step 5B - Simplify fx at the point.

In this problem: Simplify the substituted expression.

fx( 2, 1 ) = 4

Step 5C - Substitute the point into fy.

In this problem: Substitute the point values.

fy( 2, 1 ) = 2

Step 5D - Simplify fy at the point.

In this problem: Simplify the substituted expression.

fy( 2, 1 ) = 2

Step 6 - Gradient at the point.

In this problem: Put the evaluated components into ⟨ … ⟩.

∇f( 2, 1 ) = ⟨ 4, 2 ⟩

Step 7A - Magnitude of the gradient.

In this problem: Use the magnitude formula.

|∇f( 2, 1 )| = 42 + 22

Step 7B - Simplify the magnitude.

In this problem: Simplify the square root.

|∇f( 2, 1 )| = 25 ≈ 4.47

Final answer: Gradient computed