# Gradient

In vector calculus, the gradient of a scalar field is a
vector field which points in the direction of the greatest rate
of increase of the scalar field, and whose magnitude is the greatest rate of change. More rigorously, the gradient of a function from the Euclidean space **R**^{n} to **R** is the best linear approximation to that function at any particular point in **R**^{n}. To that extent, the gradient is a particular case of the Jacobian.

In the case of a real-valued function of a single variable, the **gradient** is simply the derivative, or, for a linear function, the slope of the line.

The word *gradient* is sometimes used synonymously with *grade*, meaning the *inclination* of a surface along a given direction. One can obtain the grade by taking the dot product of the vector gradient with the unit vector in the direction of interest. The magnitude of the gradient is also sometimes referred to as just the gradient.

## Contents

## Interpretations of the gradient

Consider a room in which the temperature is given by a scalar field **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \phi}**
, so at each point **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle (x,y,z)}**
the temperature is **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \phi(x,y,z)}**
. We will assume that the temperature does not change in time. Then, at each point in the room, the gradient at that point will show the direction in which it gets hot most quickly. The magnitude of the gradient will tell how fast it gets hot in that direction.

Consider a hill whose height at a point **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle (x, y)}**
is **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle H(x, y)}**
. The gradient of **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle H}**
at a point is in the direction of the steepest slope/grade at that point. The magnitude of the gradient tells how steep the slope actually is.

The gradient can also be used to tell how things change in other directions rather than the direction of largest change. Consider again the example with the hill. One can have a road which goes right uphill where the slope is largest and then its slope is the magnitude of the gradient. Or one can have a road which goes under an angle with the uphill direction, say for example an angle of 60° when projected onto the horizontal plane. Then, if the steepest slope on the hill is 40%, the road will make a shallower slope of 20% which is 40% times the cosine of 60°.

This observation can be mathematically stated as follows. The gradient of the hill height function **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle H}**
dotted with a unit vector gives the slope of the surface in the direction of the vector. This is called the directional derivative.

## Formal definition

The gradient of a scalar function *Template:Phisymbol* is denoted by:

**Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \nabla \phi}**

where **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \nabla}**
(nabla) denotes the vector differential operator del. The gradient of *Template:Phisymbol* is sometimes also written as grad(*Template:Phisymbol*).

In 3 dimensions, the expression expands to

**Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \nabla \phi = \begin{pmatrix} {\frac{\partial \phi}{\partial x}}, {\frac{\partial \phi}{\partial y}}, {\frac{\partial \phi}{\partial z}} \end{pmatrix}}**

in Cartesian coordinates. (*See partial derivative and vector.*)

Although expressed in terms of coordinates, the result is invariant under orthogonal transformations, as it should, in view of the geometric definition.

### Example

The gradient of the function *Template:Phisymbol***Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle =2x+3y^2-\sin(z)}**
is:

**Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \nabla \phi = \begin{pmatrix} {\frac{\partial \phi}{\partial x}}, {\frac{\partial \phi}{\partial y}}, {\frac{\partial \phi}{\partial z}} \end{pmatrix} = \begin{pmatrix} {2}, {6y}, {-\cos(z)} \end{pmatrix}.}**

## The gradient on manifolds

For any differentiable function f on a Riemannian manifold *M*, the gradient of *f* is the vector field such that for any vector **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \xi}**
,

**Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \langle \nabla f(x), \xi \rangle := \xi f}**

where **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \langle \cdot, \cdot \rangle}**
denotes the inner product on *M* (the metric) and
**Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \xi f}**
is the function that takes any point *p* to the directional derivative of **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle f}**
in the direction **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \xi}**
evaluated at *p*. In other words, under some coordinate chart**Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \varphi}**
, **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \xi f (p)}**
will be:

**Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \sum \xi_{x_{j}} (\partial_{j}f \mid_{p}) := \sum \xi_{x_{j}} (\frac{\partial}{\partial x_{j} }(f \circ \varphi^{-1}) \mid_{\varphi(p)}).}**

The gradient of a function is related to the exterior derivative, since **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \xi f (p) = df(\xi)}**
. Indeed, the metric allows one to associate canonically the 1-form *df* to the vector field **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \nabla f}**
. In **R**^{n} the flat metric is implicit and the gradient can be identified with the exterior derivative.

## See also

- Jacobian
- Divergence
- Curl
- Partial derivation
- Sobel
- Vector calculus
- Nabla in cylindrical and spherical coordinates
- Ion gradient
- Gradient descent
- Level set
- Exterior derivative

bg:Градиент cs:Gradient de:Gradient (Mathematik) es:Gradiente fr:Gradient it:Gradiente he:גרדיאנט nl:Gradiënt ja:勾配 pl:Gradient (matematyka) pt:Gradiente ru:Градиент sl:Gradient sv:Gradient