Gradient Calculator

Published on: July 21, 2026
Final Answer: Free Full Steps: Pro

This Gradient Calculator finds the gradient vector \(\nabla f\) of a function of several variables. It takes the partial derivative with respect to each variable - holding the others constant and applying the ordinary derivative rules step by step - then collects the partials into the gradient vector.

Step-by-step method

  1. Set up the function of several variables.
  2. Take the partial derivative with respect to each variable (holding the others constant).
  3. Collect the partials into the gradient vector.

Formula:

\(\nabla f = \left\langle \frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}, \frac{\partial f}{\partial z} \right\rangle\)

Example 1: gradient of \(x^2*y + y^3\).

\(f = x^{2} y + y^{3}\)

Step 1 - Partial derivative with respect to x.

In this problem: Differentiate with respect to x. Treat y as constant.

\(\frac{\partial f}{\partial x}\)

Step 2 - Set up the terms in the sum.

In this problem: We are given a sum. The separate terms are \(x^{2} y\), \(y^{3}\).

\(f\left(x\right) = x^{2} y + y^{3}\)

Step 3 - Write the sum rule formula.

In this problem: The sum rule says the derivative of a sum is the sum of the derivatives.

\(\frac{d}{dx}\left(f\left(x\right) + g\left(x\right)\right) = \frac{d}{dx}f\left(x\right) + \frac{d}{dx}g\left(x\right)\)

Step 4 - Split the derivative across the addition signs.

In this problem: Apply the derivative to each separated term.

\(\frac{d}{dx}\left(x^{2} y + y^{3}\right) = \frac{d}{dx}\left(x^{2} y\right) + \frac{d}{dx}\left(y^{3}\right)\)

Step 5 - Differentiate the separated term \(x^{2} y\).

In this problem: The separated term is \(x^{2} y\). Use the power rule to get its derivative.

\(\frac{d}{dx}\left(x^{2} y\right) = 2 x y\)

Step 6 - Differentiate the separated term \(y^{3}\).

In this problem: The separated term is \(y^{3}\). Use the constant rule to get its derivative.

\(\frac{d}{dx}\left(y^{3}\right) = 0\)

Step 7 - Combine and simplify.

In this problem: Combine the derivative from each separated term, then simplify the result.

\(f'\left(x\right) = 2 x y + 0 = 2 x y\)

Step 8 - Partial derivative with respect to y.

In this problem: Differentiate with respect to y. Treat x as constant.

\(\frac{\partial f}{\partial y}\)

Step 9 - Set up the terms in the sum.

In this problem: We are given a sum. The separate terms are \(x^{2} y\), \(y^{3}\).

\(f\left(y\right) = x^{2} y + y^{3}\)

Step 10 - Write the sum rule formula.

In this problem: The sum rule says the derivative of a sum is the sum of the derivatives.

\(\frac{d}{dy}\left(f\left(y\right) + g\left(y\right)\right) = \frac{d}{dy}f\left(y\right) + \frac{d}{dy}g\left(y\right)\)

Step 11 - Split the derivative across the addition signs.

In this problem: Apply the derivative to each separated term.

\(\frac{d}{dy}\left(x^{2} y + y^{3}\right) = \frac{d}{dy}\left(x^{2} y\right) + \frac{d}{dy}\left(y^{3}\right)\)

Step 12 - Differentiate the separated term \(x^{2} y\).

In this problem: The separated term is \(x^{2} y\). Use the power rule to get its derivative.

\(\frac{d}{dy}\left(x^{2} y\right) = x^{2}\)

Step 13 - Differentiate the separated term \(y^{3}\).

In this problem: The separated term is \(y^{3}\). Use the power rule to get its derivative.

\(\frac{d}{dy}\left(y^{3}\right) = 3 y^{2}\)

Step 14 - Combine and simplify.

In this problem: Combine the derivative from each separated term, then simplify the result.

\(f'\left(y\right) = x^{2} + 3 y^{2}\)

Step 15 - Collect the partials into the gradient vector.

In this problem: Place each partial derivative into the gradient vector.

\(\nabla f = \left\langle 2 x y,\; x^{2} + 3 y^{2} \right\rangle\)

Final answer:

\(\nabla f = \left\langle 2 x y,\; x^{2} + 3 y^{2} \right\rangle\)

Example 2: gradient of \(x*y*z^2\).

\(f = x y z^{2}\)

Step 1 - Partial derivative with respect to x.

In this problem: Differentiate with respect to x. Treat y, z as constants.

\(\frac{\partial f}{\partial x}\)

Step 2 - Set up the coefficient and the variable part.

In this problem: We are given \(x y z^{2}\). The constant coefficient is \(y z^{2}\), and the variable part is \(x\).

\(x y z^{2} = y z^{2}\cdot \left(x\right)\)

Step 3 - Write the constant multiple rule formula.

In this problem: The constant multiple rule says a constant coefficient stays outside the derivative.

\(\frac{d}{dx}\left(c\cdot f\left(x\right)\right) = c\cdot \frac{d}{dx}f\left(x\right)\)

Step 4 - Apply the constant multiple rule.

In this problem: Move the constant coefficient \(y z^{2}\) outside the derivative and leave \(x\) inside the derivative.

\(\frac{d}{dx}\left(x y z^{2}\right) = y z^{2}\cdot \frac{d}{dx}\left(x\right)\)

Step 5 - Partial derivative with respect to y.

In this problem: Differentiate with respect to y. Treat x, z as constants.

\(\frac{\partial f}{\partial y}\)

Step 6 - Set up the coefficient and the variable part.

In this problem: We are given \(x y z^{2}\). The constant coefficient is \(x z^{2}\), and the variable part is \(y\).

\(x y z^{2} = x z^{2}\cdot \left(y\right)\)

Step 7 - Write the constant multiple rule formula.

In this problem: The constant multiple rule says a constant coefficient stays outside the derivative.

\(\frac{d}{dy}\left(c\cdot f\left(y\right)\right) = c\cdot \frac{d}{dy}f\left(y\right)\)

Step 8 - Apply the constant multiple rule.

In this problem: Move the constant coefficient \(x z^{2}\) outside the derivative and leave \(y\) inside the derivative.

\(\frac{d}{dy}\left(x y z^{2}\right) = x z^{2}\cdot \frac{d}{dy}\left(y\right)\)

Step 9 - Partial derivative with respect to z.

In this problem: Differentiate with respect to z. Treat x, y as constants.

\(\frac{\partial f}{\partial z}\)

Step 10 - Set up the coefficient and the variable part.

In this problem: We are given \(x y z^{2}\). The constant coefficient is \(x y\), and the variable part is \(z^{2}\).

\(x y z^{2} = x y\cdot \left(z^{2}\right)\)

Step 11 - Write the constant multiple rule formula.

In this problem: The constant multiple rule says a constant coefficient stays outside the derivative.

\(\frac{d}{dz}\left(c\cdot f\left(z\right)\right) = c\cdot \frac{d}{dz}f\left(z\right)\)

Step 12 - Apply the constant multiple rule.

In this problem: Move the constant coefficient \(x y\) outside the derivative and leave \(z^{2}\) inside the derivative.

\(\frac{d}{dz}\left(x y z^{2}\right) = x y\cdot \frac{d}{dz}\left(z^{2}\right)\)

Step 13 - Collect the partials into the gradient vector.

In this problem: Place each partial derivative into the gradient vector.

\(\nabla f = \left\langle y z^{2},\; x z^{2},\; 2 x y z \right\rangle\)

Final answer:

\(\nabla f = \left\langle y z^{2},\; x z^{2},\; 2 x y z \right\rangle\)