Gradient Vector Calculator

Enter a function f(x,y) and a point (a, b) to instantly compute the gradient vector and visualize the direction of steepest ascent.

Use the Gradient Vector Calculator

Function & Point

Use ^, *, sin(), cos(), exp(), log(), sqrt(), PI

Quick Examples

Enter a function and point, then click Compute Gradient.

Summary

The Gradient Vector Calculator computes the gradient ∇f(a, b) of any two-variable function at a specified point using high-precision numeric differentiation. It shows both partial derivatives, the gradient magnitude, and the unit direction vector — making it useful for calculus coursework, optimization analysis, and building intuition around machine learning algorithms like gradient descent.

How it works

  1. Enter your function f(x, y) using standard math notation (e.g. x^2 + y^2).
  2. Specify the point (x, y) where you want to evaluate the gradient.
  3. The calculator computes partial derivatives ∂f/∂x and ∂f/∂y numerically via central finite differences.
  4. The gradient vector ∇f(a, b) = (∂f/∂x, ∂f/∂y) is displayed at the given point.
  5. A canvas diagram shows the gradient arrow overlaid on a contour-like background.
  6. The magnitude ‖∇f‖ and the unit direction vector are also shown.

Use cases

  • Check partial derivative calculations for multivariable calculus homework.
  • Find the steepest ascent direction for optimization problems.
  • Visualize gradient fields for machine learning intuition (gradient descent).
  • Verify analytical gradients against numeric approximations.
  • Understand saddle points and local extrema in two-variable functions.
  • Explore how changing x or y affects the gradient direction.

Frequently Asked Questions

Last updated: 2026-06-15 · Reviewed by Nham Vu