Calculus
Advanced

Gradient Vector

Vector of partial derivatives pointing in the steepest ascent.

Formula

∇f=(∂f∂x,∂f∂y)\nabla f = \left(\frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}\right)

Variables

fScalar field

Example

Points uphill on a surface

How it works

The gradient collects all first-order rates of change of a scalar field into one vector, so its components tell you how fast the function changes with respect to each coordinate. It works because the directional derivative in any direction is given by the dot product of that direction with the gradient, so the gradient must point in the direction that makes the increase largest and its length measures how steep that increase is. In two variables,  abla f = (f_x, f_y) is the vector whose components are the partial derivatives with respect to x and y.

When to use it

Use the gradient when you need the direction of steepest increase of a surface, a temperature or pressure field, or any scalar quantity that varies across space. It is also central in optimization, because stationary points occur where the gradient is zero.

Worked example, step by step

Let f(x, y) = x^2y + 3y^2 at the point (1, 2). Step 1: Differentiate with respect to x: f_x = 2xy. Step 2: Differentiate with respect to y: f_y = x^2 + 6y. Step 3: Evaluate at (1, 2): f_x(1,2) = 2(1)(2) = 4. Step 4: Evaluate at (1, 2): f_y(1,2) = (1)^2 + 6(2) = 13. Step 5: Write the gradient: abla f(1,2) = (4, 13). Final answer: the gradient at (1,2) is (4, 13), so the function increases most rapidly in that direction.

Common mistakes to avoid

  • Forgetting that each component is a partial derivative, not an ordinary derivative
  • Evaluating the gradient before differentiating correctly
  • Assuming the gradient itself is the function value instead of a vector of rates of change

Did You Know?

The gradient always points in the direction of steepest ascent, which is why "gradient descent" trains AI models.

Share this formula

Reviewed & maintained by the FormulaWon editorial teamLast reviewed September 2026