
For other uses see Gradient (disambiguation).
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.
A generalization of the gradient, for functions on a Banach space which have vectorial values, is the Jacobian.
Consider a room in which the temperature is given by a scalar field
\phi
(x,y,z)
\phi(x,y,z)
Consider a hill whose height above sea level at a point
(x,y)
H(x,y)
H
The gradient can also be used to measure how a scalar field changes in other directions, rather than just the direction of greatest change, by taking a dot product. Consider again the example with the hill and suppose that the steepest slope on the hill is 40%. If a road goes directly up the hill, then the steepest slope on the road will also be 40%. If instead, the road goes around the hill at an angle with the uphill direction (the gradient vector), then it will have a shallower slope. For example, if the angle between the road and the uphill direction, projected onto the horizontal plane, is 60°, then the steepest slope along the road will be 20% which is 40% times the cosine of 60°.
This observation can be mathematically stated as follows. If the hill height function
H
H
H
The gradient (or gradient vector field) of a scalar function
f(x)
x=(x1,...,xn)
\nablaf
\vec{\nabla}f
\nabla
\operatorname{grad}(f)
By definition, the gradient is a vector field whose components are the partial derivatives of
f
\nablaf=\left(
| \partialf | |
| \partialx1 |
,...,
| \partialf | |
| \partialxn |
\right).
The dot product
(\nablaf)x ⋅ v
Because the gradient is orthogonal to level sets, it can be used to construct a vector normal to a surface. Consider any manifold that is one dimension less than the space it is in (i.e., a surface in 3D, a curve in 2D, etc.). Let this manifold be defined by an equation e.g. F(x, y, z) = 0 (i.e., move everything to one side of the equation). We have now turned the manifold into a level set. To find a normal vector, we simply need to find the gradient of the function F at the desired point.
The gradient is an irrotational vector field and line integrals through a gradient field are path independent and can be evaluated with the gradient theorem. Conversely, an irrotational vector field in a simply connected region is always the gradient of a function.
The form of the gradient depends on the coordinate system used.
In Cartesian coordinates, the above expression expands to
\nablaf(x,y,z)=\left(
| \partialf | , | |
| \partialx |
| \partialf | , | |
| \partialy |
| \partialf | |
| \partialz |
\right).
\nablaf(\rho,\theta,z)=\left(
| \partialf | , | |
| \partial\rho |
| 1 | |
| \rho |
| \partialf | , | |
| \partial\theta |
| \partialf | |
| \partialz |
\right)
(where
\theta
z
\nablaf(r,\theta,\phi)=\left(
| \partialf | , | |
| \partialr |
| 1 | |
| r |
| \partialf | , | |
| \partial\theta |
| 1 | |
| r\sin\theta |
| \partialf | |
| \partial\phi |
\right)
(where
\theta
\phi
For example, the gradient of the function in Cartesian coordinates
f(x,y,z)= 2x+3y2-\sin(z)
\nablaf=\left(
| \partialf | , | |
| \partialx |
| \partialf | , | |
| \partialy |
| \partialf | |
| \partialz |
\right) =\left(2,6y,-\cos(z)\right).
The gradient of a function
f
\mathbb{R}n
\mathbb{R}
\mathbb{R}n
f(x) ≈ f(x0)+(\nabla
| f) | |
| x0 |
⋅ (x-x0)
x
x0
(\nabla
| f) | |
| x0 |
x0
\mathbb{R}n
The best linear approximation to a function
f:\mathbb{R}n\to\mathbb{R}
x
\mathbb{R}n
\mathbb{R}n
\mathbb{R}
dfx
Df(x)
f
x
(\nablaf)x ⋅ v=dfx(v)
v\in\mathbb{R}n
df
x
dfx
f
If
\mathbb{R}n
n
df
df=\left(
| \partialf | |
| \partialx1 |
,...,
| \partialf | |
| \partialxn |
\right)
dfx(v)
\nablaf=dfT
The differential is more natural than the gradient because it is invariant under all coordinate transformations (or diffeomorphisms), whereas the gradient is only invariant under orthogonal transformations (because of the implicit use of the dot product in its definition). Because of this, it is common to blur the distinction between the two concepts using the notion of covariant and contravariant vectors. From this point of view, the components of the gradient transform covariantly under changes of coordinates, so it is called a covariant vector field, whereas the components of a vector field in the usual sense transform contravariantly. In this language the gradient is the differential, as a covariant vector field is the same thing as a differential 1-form.
Unfortunately this confusing language is confused further by differing conventions. Although the components of a differential 1-form transform covariantly under coordinate transformations, differential 1-forms themselves transform contravariantly (by pullback) under diffeomorphism. For this reason differential 1-forms are sometimes said to be contravariant rather than covariant,
in which case vector fields are covariant rather than contravariant.
For any smooth function f on a Riemannian manifold (M,g), the gradient of f is the vector field
\nablaf
X
g(\nablaf,X)=\partialXf, i.e., gx((\nablaf)x,Xx)=(\partialXf)(x)
gx( ⋅ , ⋅ )
\partialXf
\varphi
(\partialXf)(x)
| n | |
| \sum | |
| j=1 |
Xj(\varphi(x))
| \partial | |
| \partialxj |
(f\circ\varphi-1)|\varphi(x),
where Xj denotes the jth component of X in this coordinate chart.
Generalizing the case M=Rn, the gradient of a function is related to its exterior derivative, since
(\partialXf)(x)=dfx(Xx)
\nablaf
\sharp=\sharpg\colonT*M\toTM