Skip to content

Gradient

Definition

Let E⊆RnE\subseteq \mathbb{R}^n, and let f ⁣:E→Rf \colon E \to \mathbb{R} be a real-valued function. If x0\boldsymbol{x}_0 is an interior point of EE and all first partial derivatives exist there, the gradient ∇f(x0)\boldsymbol{\nabla} f (\boldsymbol{x}_0) of ff at x=x0\boldsymbol{x}=\boldsymbol{x}_0 is given as the nn-dimensional column vector:

∇f(x0)=(∂f∂x1(x0), ∂f∂x2(x0),…, ∂f∂xn(x0))⊤.\boldsymbol{\nabla} f (\boldsymbol{x}_0) = \left(\frac{\partial f}{\partial x_1}(\boldsymbol{x}_0),\, \frac{\partial f}{\partial x_2}(\boldsymbol{x}_0), \ldots,\, \frac{\partial f}{\partial x_n}(\boldsymbol{x}_0)\right)^{\top}.

Interpretation

The gradient collects the first partial derivatives of a real-valued function into one vector. For a totally differentiable ff it points in the direction in which ff increases fastest, and its length is that fastest rate of increase.

Elliptical level curves of f with gradient arrows at four points, each perpendicular to its level curve and pointing outwards, uphill.

The figure shows level curves of f(x,y)=x2+2y2f(x,y)=x^2+2y^2 for the values 22, 44 and 66, with ∇f(x,y)=(2x,4y)⊤\boldsymbol{\nabla} f(x,y)=(2x,4y)^{\top}. The arrows start at four points of the level curve f=4f=4, such as (2,0)(2,0) and (0,2)(0,\sqrt{2}); each is perpendicular to that curve and points outwards, towards larger values of ff. The gradients there are (4,0)⊤(4,0)^{\top} and (0,42)⊤(0,4\sqrt{2})^{\top}: ff rises faster along the yy-axis, where the level curves lie closer together.

When ∇f(x0)=0\boldsymbol{\nabla} f (\boldsymbol{x}_0)= \boldsymbol{0}, we say that x0\boldsymbol{x}_0 is a stationary point of ff (possibly a local extremum point). At an interior local extremum every partial derivative that exists is 00, but a stationary point need not be an extremum: f(x,y)=x2−y2f(x,y)=x^2-y^2 has ∇f(0,0)=0\boldsymbol{\nabla} f(0,0)=\boldsymbol{0}, yet takes both larger and smaller values than f(0,0)f(0,0) near the origin.

When ff is totally differentiable at x0\boldsymbol{x}_0 and ∇f(x0)≠0\boldsymbol{\nabla} f (\boldsymbol{x}_0)\neq \boldsymbol{0}, the gradient gives two things: the direction u=∇f(x0)/∥∇f(x0)∥\boldsymbol{u}=\boldsymbol{\nabla} f(\boldsymbol{x}_0)/\|\boldsymbol{\nabla} f(\boldsymbol{x}_0)\| of steepest ascent, and the maximal rate of increase ∥∇f(x0)∥=max⁡∥u∥=1Duf(x0),\|\boldsymbol{\nabla} f(\boldsymbol{x}_0)\|=\max_{\|\boldsymbol{u}\|=1}\mathrm{D}_{\boldsymbol{u}}f(\boldsymbol{x}_0)\text{,} by the Cauchy-Schwarz inequality. Along a level curve ff does not change, so the directional derivative in a tangent direction is 00; this is why the gradient is perpendicular to the level curves.

A common slip is to draw the gradient on the graph of ff. It is a vector in the domain Rn\mathbb{R}^n, drawn in the same plane as the level curves.


Key Results

  • If ff is totally differentiable at x0,\boldsymbol{x}_0\text{,} the gradient is the vector whose dot product with any unit vector v\boldsymbol{v} equals the directional derivative of ff at x=x0\boldsymbol{x}=\boldsymbol{x}_0 along v\boldsymbol{v}, i.e.,
∇f(x0)⋅v=Dvf(x0).\boldsymbol{\nabla} f (\boldsymbol{x}_0) \cdot \boldsymbol{v} = \mathrm{D}_{\boldsymbol{v}}f(\boldsymbol{x}_0).
  • The existence of the gradient (all partial derivatives at x0\boldsymbol{x}_0) alone does not guarantee this formula.

Examples

  • Let f(x,y)=ex+yf(x,y) = \mathrm{e}^{x+y}. Then ∇f(x,y)=(ex+yex+y)\displaystyle \boldsymbol{\nabla} f(x,y) = \begin{pmatrix} \mathrm{e}^{x+y} \\ \mathrm{e}^{x+y} \end{pmatrix}.
  • Let f(x,y)=x2y+y3f(x,y) = x^2 y + y^3. Then ∇f(x,y)=(2xyx2+3y2)\boldsymbol{\nabla} f(x,y) = \begin{pmatrix} 2xy \\ x^2 + 3y^2 \end{pmatrix}.

Prerequisites

Sources

Aliases: gradient vector Symbols: nabla gradient, partial, real numbers, square root, subset

Last updated: 27 October 2026 11:52