MULTIVARIABLE CALCULUS

Gradient Calculator

Find the gradient vector, its magnitude, and the direction of steepest increase for a function of x, y, and z.

MULTIVARIABLE CALCULUS

Enter your function

Evaluate at the pointEnter coordinates (x, y, z)

Use x, y, z, powers, and supported functions such as sin(x) or exp(y). The keyboard inserts symbols into the function.

Press Enter from an input to calculate
Examples
GRADIENT VECTOR

Solution

Your input:

f(x,y,z)=x2+y2+z2f(x,y,z)={x}^{2} + {y}^{2} + {z}^{2}
at
(1,2,2)(1,2,2)

ANSWER
∇f(1,2,2)=(2,  4,  4)\nabla f(1,2,2)=\left(2,\; 4,\; 4\right)
Gradient magnitude
∥∇f∥=6\|\nabla f\|=6
Unit direction of steepest increase
u^=(0.33333333,  0.66666667,  0.66666667)\hat{u}=(0.33333333,\; 0.66666667,\; 0.66666667)
Partial derivatives at the point
fx=2f_x=2
fy=4f_y=4
fz=4f_z=4

Step-by-step solution

  1. 1
    Differentiate with respect to x

    Hold the other coordinates constant, then evaluate this partial derivative at (1, 2, 2).

    ∂f∂x=2⋅x,fx(1,2,2)=2\frac{\partial f}{\partial x}=2 \cdot x,\qquad f_x(1,2,2)=2
  2. 2
    Differentiate with respect to y

    Hold the other coordinates constant, then evaluate this partial derivative at (1, 2, 2).

    ∂f∂y=2⋅y,fy(1,2,2)=4\frac{\partial f}{\partial y}=2 \cdot y,\qquad f_y(1,2,2)=4
  3. 3
    Differentiate with respect to z

    Hold the other coordinates constant, then evaluate this partial derivative at (1, 2, 2).

    ∂f∂z=2⋅z,fz(1,2,2)=4\frac{\partial f}{\partial z}=2 \cdot z,\qquad f_z(1,2,2)=4
  4. 4
    Assemble the gradient and its magnitude

    The gradient collects the partial derivatives. Its magnitude is the maximum directional rate of increase at this point.

    ∥∇f∥=(2)2+(4)2+(4)2=6\|\nabla f\|=\sqrt{(2)^2+(4)^2+(4)^2}=6

The gradient points in the direction of greatest local increase. Its magnitude is the maximum directional derivative; the unit vector shown above is defined only when the gradient is nonzero.

GRADIENTS IN MULTIVARIABLE CALCULUS

What is the gradient?

The gradient of a scalar-valued function is the vector made from its first partial derivatives. For a differentiable function, the gradient describes the function's local direction and rate of greatest increase. This calculator differentiates with respect to x, y, and z, evaluates each component at your point, and reports the vector and its magnitude.

∇f(x,y,z)=(∂f∂x,∂f∂y,∂f∂z),∥∇f∥=fx2+fy2+fz2\nabla f(x,y,z)=\left(\frac{\partial f}{\partial x},\frac{\partial f}{\partial y},\frac{\partial f}{\partial z}\right),\qquad \|\nabla f\|=\sqrt{f_x^2+f_y^2+f_z^2}

Differentiate f separately with respect to each variable, holding the others constant. Evaluate those partial derivatives at the same point to form the gradient vector. Its length is the maximum rate of increase over all unit directions; normalizing the vector gives that direction.

The calculator supports the symbolic engine's real-valued arithmetic, powers, and elementary functions. The function must be differentiable at the selected point for the gradient interpretation to apply. Values are evaluated numerically, so displayed component values and magnitude are rounded decimal approximations.

How to use the gradient calculator

  1. Enter a scalar function using x, y, and z, for example x^2 + y^2 + z^2. Use parentheses to group expressions and explicit function notation such as sin(x).
  2. Enter the coordinates of the point where you want to evaluate the gradient. Coordinates must be finite real numbers.
  3. The calculator finds fₓ, fᵧ, and f_z symbolically, treating the other variables as constants during each differentiation.
  4. Each partial derivative is evaluated at the selected point. The three results form ∇f at that point.
  5. Review the vector, its magnitude, the unit direction of steepest increase, and the individual derivative steps.

Worked example

Find the gradient of f(x,y,z) = x² + y² + z² at (1, 2, 2).

The partial derivatives are fₓ = 2x, fᵧ = 2y, and f_z = 2z. Evaluating at (1, 2, 2) gives the vector (2, 4, 4). Its magnitude is √(2² + 4² + 4²) = 6.

∇f(1,2,2) = (2, 4, 4), ‖∇f(1,2,2)‖ = 6, and the unit direction is (1/3, 2/3, 2/3). The function increases fastest from this point in the direction of (1/3, 2/3, 2/3), and the maximum rate of increase per unit distance is 6.

Find the gradient of f(x,y,z) = xy + z² at (2, 3, 1).

fₓ = y, fᵧ = x, and f_z = 2z. Substituting the point gives (3, 2, 2).

∇f(2,3,1) = (3, 2, 2), with magnitude √17. The gradient vector combines the local rates of change along all three coordinate axes.

Find the gradient of f(x,y,z) = sin(x) + cos(y) + z at (0, 0, 1).

fₓ = cos(x), fᵧ = −sin(y), and f_z = 1. At the point these values are (1, 0, 1).

∇f(0,0,1) = (1, 0, 1), with magnitude √2. There is no first-order change in the y direction at y = 0, while the x and z components are both 1.

Interpret the result

  • Differentiate one variable at a time: When finding fₓ, hold y and z constant. When finding fᵧ, hold x and z constant; when finding f_z, hold x and y constant.
  • The gradient gives the steepest direction: For a differentiable function, the directional derivative in a unit direction u is ∇f · u. This dot product is largest when u points in the gradient direction.
  • Magnitude is a rate: The length ‖∇f‖ is the maximum directional derivative at the point, measured as change in function value per unit distance.
  • A zero gradient needs further analysis: If all first partial derivatives are zero, the gradient vanishes. The point may be a local maximum, local minimum, saddle point, or another stationary point; second-order or other analysis is needed to classify it.

The gradient is perpendicular to a level surface f(x,y,z) = c wherever the surface and gradient are regular. A zero gradient has zero magnitude, so there is no unique unit direction of steepest increase at that point; it may indicate a stationary point, though it does not classify that point by itself.

Gradient calculator FAQ

What does the gradient calculator return?

It returns the gradient vector at your selected point, the gradient magnitude, the unit direction of steepest increase when defined, and a step-by-step evaluation of the partial derivatives.

How do I calculate the gradient of a function?

Find the partial derivatives with respect to each variable, then evaluate all of them at the same point. For f(x,y,z), the gradient is (fₓ, fᵧ, f_z).

What is the difference between a gradient and a directional derivative?

The gradient is a vector containing all first partial derivatives. A directional derivative gives the rate of change in one chosen unit direction and is calculated as the dot product of the gradient with that direction.

What does the gradient magnitude mean?

At a differentiable point, it is the largest directional derivative over all unit directions: the maximum local rate at which the function can increase.

What if the gradient is zero?

The function has no first-order direction of increase at that point, so a unique unit gradient direction is not defined. A zero gradient alone does not determine whether the point is a maximum, minimum, or saddle.

Can I use a function of only x and y?

Yes. Leave z out of the function; its partial derivative will be zero. The point inputs still include a z coordinate so the result is represented consistently as a three-component vector.

Further reading

Related calculus tools