Overview. In multivariable calculus the gradient of a scalar function is a vector field that encodes both the direction in which the function increases most rapidly and the rate of that increase. The gradient is a central object in vector calculus and appears whenever one compares changes of a quantity with respect to several variables. The symbol ∇f (often read "nabla f") or the name grad f are commonly used to denote the gradient.

Definition and notation

For a real-valued function f(x1,…,xn) that is differentiable, the gradient ∇f is the n-dimensional vector of partial derivatives: ∇f = (∂f/∂x1, …, ∂f/∂xn). Each component measures how the function changes when one coordinate varies and the others are held fixed; these are the partial derivatives. The directional derivative of f in a unit direction u equals the dot product ∇f · u, so the gradient summarizes directional rates of change.

Geometric interpretation and properties

Geometrically, the gradient at a point points toward the steepest ascent of the function and its magnitude equals the maximal directional derivative at that point. It is perpendicular to level sets (contours) of f: in two dimensions the gradient is orthogonal to a curve of constant f, and in higher dimensions it is normal to level surfaces. These orthogonality and extremal properties make the gradient useful for locating maxima, minima, and saddle points.

Simple examples

  • If f(x,y)=x^2+y^2, then ∇f=(2x,2y), which points away from the origin and whose length grows with distance.
  • If f(x,y)=xy, then ∇f=(y,x); at the point (1,2) the gradient is (2,1), indicating a stronger increase in the x-direction there.

Applications and uses

The gradient appears in many fields. In numerical optimization methods such as gradient descent, the negative gradient gives a local direction to decrease a function and find minima. In physics, conservative force fields are gradients of potential energy, and many partial differential equations (heat, diffusion, Laplace) involve gradients. In image processing discrete approximations to gradients detect edges and transitions in intensity. More broadly, the gradient connects a scalar quantity to an associated vector field that describes spatial change.

Relations and notable facts

The gradient is closely linked with other differential operators: the divergence of a gradient gives the Laplacian, and in simply connected domains a vector field with zero curl can often be expressed as the gradient of some potential (a gradient field). The fundamental theorem for gradients states that the line integral of a gradient between two points equals the change in the underlying scalar function, a key fact in analysis and physics. For visual intuition see graphs and diagrams of surfaces and contour plots; a function's slope along a curve on such a graph equals the component of the gradient in the curve's direction. For basic illustrations consult introductory material on graphs of functions.