Gradient
12461
223400794
2008-07-03T22:34:15Z
Numbo3-bot
7118326
robot Adding: [[sh:Gradijent]]
{{For|the measure of steepness of a line|Slope}}
{{otheruses}}
[[Image:Gradient2.svg|thumb|300px|In the above two images, the scalar field is in black and white, black representing higher values, and its corresponding gradient is represented by blue arrows.]]
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 (mathematics)|magnitude]] is the greatest rate of change.
A generalization of the gradient for functions on a [[Euclidean space]] which have values in another Euclidean space is the [[Jacobian]]. A further generalization for a function from one [[Banach space]] to another is the [[Fréchet derivative]].
==Interpretations of the gradient==
Consider a room in which the temperature is given by a scalar field <math>T</math>, so at each point <math>(x,y,z)</math> the temperature is <math>T(x,y,z)</math> (we will assume that the temperature does not change in time). Then, at each point in the room, the gradient of <math>T</math> at that point will show the direction in which the temperature rises most quickly. The magnitude of the gradient will determine how fast the temperature rises in that direction.
Consider a hill whose height above sea level at a point <math>(x, y)</math> is <math>H(x, y)</math>. The gradient of <math>H</math> at a point is a vector pointing in the direction of the steepest [[Slope#Slope of a road or railroad|slope]] or [[Grade (slope)|grade]] at that point. The steepness of the slope at that point is given by the magnitude of the gradient vector.
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 <math>H</math> is differentiable, then the gradient of <math>H</math> [[dot product|dotted]] with a unit [[vector (spatial)|vector]] gives the slope of the hill in the direction of the vector. More precisely, when <math>H</math> is differentiable the dot product of the gradient of <math>H</math> with a given unit vector is equal to the [[directional derivative]] of <math>H</math> in the direction of that unit vector.
== Definition ==
The gradient (or gradient vector field) of a scalar function <math>f(x)</math> with respect to a vector variable <math>x = (x_1,\dots,x_n)</math> is denoted by <math>\nabla f</math> or <math>\vec{\nabla} f</math> where <math>\nabla</math> (the [[nabla symbol]]) denotes the vector [[differential operator]], [[del]]. The notation <math>\operatorname{grad}(f)</math> is also used for the gradient. The gradient of ''f'' is defined to be the [[vector field]] whose components are the [[partial derivative|partial derivatives ]] of <math>f</math>. That is:
: <math> \nabla f = \left(\frac{\partial f}{\partial x_1 }, \dots, \frac{\partial f}{\partial x_n } \right). </math>
Here the gradient is written as a [[row vector]], but it is often taken to be a [[column vector]]. When a function also depends on a parameter such as time, the gradient often refers simply to the vector of its spatial derivatives only.
==Expressions for the gradient in 3 dimensions==
The form of the gradient depends on the coordinate system used.
In [[Cartesian coordinates]], the above expression expands to
:<math>\nabla f(x, y, z) =
\left(\frac{\partial f}{\partial x},
\frac{\partial f}{\partial y},
\frac{\partial f}{\partial z}\right)</math>
which is often written using the standard [[versor]]s '''i''', '''j''', '''k''' and
:<math>\frac{\partial f}{\partial x}\mathbf{i}+
\frac{\partial f}{\partial y}\mathbf{j}+
\frac{\partial f}{\partial z}\mathbf{k}</math>
In [[cylindrical coordinates]], the gradient is given by {{harv|Schey|1992|pp=139-142}}:
:<math>\nabla f(\rho, \theta, z) =
\frac{\partial f}{\partial \rho}\mathbf{e}_\rho+
\frac{1}{\rho}\frac{\partial f}{\partial \theta}\mathbf{e}_\theta+
\frac{\partial f}{\partial z}\mathbf{e}_z
</math>
where <math>\theta</math> is the azimuthal angle and <math>z</math> is the axial coordinate and '''e'''<sub>ρ</sub>, '''e'''<sub>θ</sub> and '''e'''<sub>''z''</sub> are unit vectors pointing along the coordinate directions.
In [[spherical coordinates]] {{harv|Schey|1992|pp=139-142}}:
:<math>\nabla f(r, \theta, \phi) =
\frac{\partial f}{\partial r}\mathbf{e}_r+
\frac{1}{r}\frac{\partial f}{\partial \theta}\mathbf{e}_\theta+
\frac{1}{r \sin\theta}\frac{\partial f}{\partial \phi}\mathbf{e}_\phi
</math>
where <math>\phi</math> is the [[azimuth]] angle and <math>\theta</math> is the [[zenith#Relevance and use|zenith]] angle.
===Example===
For example, the gradient of the function in Cartesian coordinates
: <math>f(x,y,z)= \ 2x+3y^2-\sin(z)</math>
is:
:<math>\nabla f= \left(
\frac{\partial f}{\partial x},
\frac{\partial f}{\partial y},
\frac{\partial f}{\partial z}\right)
= \left( 2, 6y, -\cos(z)\right).
</math>
<!--we could mention 2D too by dropping the Z term -->
== The gradient and the derivative or differential ==
=== Linear approximation to a function ===
The gradient of a [[function (mathematics)|function]] <math>f </math> from the [[Euclidean space]] <math>\mathbb{R}^n</math> to <math>\mathbb{R}</math> at any particular point ''x''<sub>0</sub> in <math>\mathbb{R}^n</math> characterizes the best [[linear approximation]] to ''f'' at ''x''<sub>0</sub>. The approximation is as follows:
: <math> f(x) \approx f(x_0) + (\nabla f)_{x_0}\cdot(x-x_0) </math>
for <math>x</math> close to <math>x_0</math>, where <math>(\nabla f)_{x_0}</math> is the gradient of ''f'' computed at <math>x_0</math>, and the dot denotes the [[dot product]] on <math>\mathbb{R}^n</math>. This equation is equivalent to the first two terms in the multi-variable [[Taylor Series]] expansion of ''f'' at ''x''<sub>0</sub>.
=== The differential or (exterior) derivative ===
The best linear approximation to a function <math>f : \mathbb{R}^n \to \mathbb{R}</math> at a point <math>x</math> in <math>\mathbb{R}^n</math> is a linear map from <math>\mathbb{R}^n</math> to <math>\mathbb{R}</math> which is often denoted by <math>\mathrm{d}f_x</math> or <math>Df(x)</math> and called the [[differential (calculus)|'''differential''']] or [[total derivative|('''total''') '''derivative''']] of <math>f</math> at <math>x</math>. The gradient is therefore related to the differential by the formula
:<math> (\nabla f)_x\cdot v = \mathrm d f_x(v)</math>
for any <math>v \in \mathbb{R}^n</math>. The function <math>\mathrm{d}f</math>, which maps <math>x</math> to <math>\mathrm{d}f_x</math>, is called the differential or [[exterior derivative]] of <math>f</math> and is an example of a [[differential 1-form]].
If <math>\mathbb{R}^n</math> is viewed as the space of (length <math>n</math>) column vectors (of real numbers), then one can regard <math>\mathrm{d}f</math> as the row vector
:<math> \mathrm{d}f = \left( \frac{\partial f}{\partial x_1}, \dots, \frac{\partial f}{\partial x_n}\right) </math>
so that <math>\mathrm{d}f_x(v)</math> is given by matrix multiplication. The gradient is then the corresponding column vector, i.e., <math>\nabla f = \mathrm{d} f^T</math>.
=== Gradient as a derivative ===
Let ''U'' be an [[open set]] in '''R'''<sup>''n''</sup>. If the function ''f'':''U'' → '''R''' is [[Fréchet derivative|differentiable]], then the differential of ''f'' is the [[Fréchet derivative|(Fréchet) derivative]] of ''f''. Thus ∇''f'' is a function from ''U'' to the space '''R'''<sup>''n''</sup>, '''R''') such that
:<math>\lim_{h\to 0} \frac{\|f(x+h)-f(x) -\nabla f(x)\cdot h\|}{\|h\|} = 0</math>
where • is the dot product.
As a consequence, the usual properties of the derivative hold for the gradient:
;Linearity
The gradient is linear in the sense that if ''f'' and ''g'' are two real-valued functions differentiable at the point ''a''∈'''R'''<sup>n</sup>, and α and β are two constants, then α''f''+β''g'' is differentiable at ''a'', and moreover
:<math>\nabla\left(\alpha f+\beta g\right)(a) = \alpha \nabla f(a) + \beta\nabla g (a).</math>
;Product rule
If ''f'' and ''g'' are real-valued functions differentiable at a point ''a''∈'''R'''<sup>n</sup>, then the [[product rule]] asserts that the product (''fg'')(''x'') = ''f''(''x'')''g''(''x'') of the functions ''f'' and ''g'' is differentiable at ''a'', and
:<math>\nabla (fg)(a) = f(a)\nabla g(a) + g(a)\nabla f(a)</math>
;Chain rule
Suppose that ''f'':''A''→'''R''' is a real-valued function defined on a subset ''A'' of '''R'''<sup>n</sup>, and that ''f'' is differentiable at a point ''a''. There are two forms of the chain rule applying to the gradient. First, suppose that the function ''g'' is a [[parametric curve]]; that is, a function ''g'' : ''I'' → '''R'''<sup>n</sup> maps a subset ''I'' ⊂ '''R''' into '''R'''<sup>n</sup>. If ''g'' is differentiable at a point ''c'' ∈ ''I'' such that ''g''(''c'') = ''a'', then
:<math>(f\circ g)'(c) = \nabla f(a)\cdot g'(c).</math>
More generally, if instead ''I''⊂'''R'''<sup>k</sup>, then the following holds:
:<math>D(f\circ g)(c) = (Dg(c))^T\nabla f(a)</math>
where (''Dg'')<sup>T</sup> denotes the transpose [[Jacobian matrix]].
For the second form of the chain rule, suppose that ''h'' : ''I'' → '''R''' is a real valued function on a subset ''I'' of '''R''', and that ''h'' is differentiable at the point ''c'' = ''f''(''a'') ∈ ''I''. Then
:<math>\nabla (h\circ f)(a) = h'(c)\nabla f(a).</math>
=== Transformation properties ===
Although the gradient is defined in term of coordinates, it is [[contravariant]] under the application of an [[orthogonal matrix]] to the coordinates. This is true in the sense that if ''A'' is an orthogonal matrix, then
:<math>\nabla (f(Ax)) = A^T\nabla (f(Ax)) = A^{-1}(\nabla f)(Ax)</math>
which follows by the chain rule above. A vector transforming in this way is known as a [[covariance and contravariance of vectors|contravariant vector]], and so the gradient is a special type of [[tensor]].
The differential is more natural than the gradient because it is invariant under all coordinate transformations (or [[diffeomorphism]]s), 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 [[covariance and contravariance of vectors|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.{{ref|1}}
{{note|1}}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.
==Further properties and applications==
===Level sets===
If the partial derivatives of ''f'' are continuous, then the [[dot product]] <math>(\nabla f)_x\cdot v</math> of the gradient at a point ''x'' with a vector ''v'' gives the [[directional derivative]] of ''f'' at ''x'' in the direction ''v''. It follows that in this case the gradient of ''f'' is [[orthogonal]] to the [[level set]]s of ''f''.
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 (e.g., 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.
===Conservative vector fields===
The gradient of a function is called a gradient field. A gradient field is always an [[conservative vector field]]: line integrals through a gradient field are path-independent and can be evaluated with the [[gradient theorem]] (the fundamental theorem of calculus for line integrals). Conversely, a conservative vector field in a [[simply connected]] region is always the gradient of a function.
==The gradient on Riemannian manifolds==
For any smooth function f on a [[Riemannian manifold]] (''M'',''g''), the gradient of ''f'' is the [[vector field]] <math>\nabla f</math> such that for any vector field <math>X</math>,
:<math>g(\nabla f, X ) = \partial_X f, \qquad \text{i.e.,}\quad g_x((\nabla f)_x, X_x ) = (\partial_X f) (x)</math>
where <math>g_x( \cdot, \cdot )</math> denotes the [[inner product]] of tangent vectors at ''x'' defined by the metric ''g'' and
<math>\partial_X f</math> (sometimes denoted ''X''(''f'')) is the function that takes any point ''x''∈''M'' to the [[directional derivative]] of ''f'' in the direction ''X'', evaluated at ''x''. In other words, in a [[coordinate chart]] <math>\varphi</math> from an open subset of ''M'' to an open subset of '''R'''<sup>''n''</sup>, <math>(\partial_X f)(x)</math> is given by:
:<math>\sum_{j=1}^n X^{j} (\varphi(x)) \frac{\partial}{\partial x_{j}}(f \circ \varphi^{-1}) \Big|_{\varphi(x)},</math>
where ''X''<sup>''j''</sup> denotes the ''j''th component of ''X'' in this coordinate chart.
So, the local form of the gradient takes the form:
:<math> \nabla f= g^{ik}\frac{\partial f}{\partial x^{k}}\frac{\partial}{\partial x^{i}}.</math>
Generalizing the case ''M''='''R'''<sup>''n''</sup>, the gradient of a function is related to its [[exterior derivative]], since <math>(\partial_X f) (x) = df_x(X_x)</math>. More precisely, the gradient <math>\nabla f</math> is the vector field associated to the differential 1-form d''f'' using the [[musical isomorphism]] <math>\sharp=\sharp^g\colon T^*M\to TM</math> (called "sharp") defined by the metric ''g''. The relation between the exterior derivative and the gradient of a function on '''R'''<sup>''n''</sup> is a special case of this in which the metric is the flat metric given by the dot product.
==See also==
<div style="-moz-column-count:3; column-count:3;">
*[[Gradient descent]]
*[[Curl (mathematics)|Curl]]
*[[Divergence]]
*[[Laplace operator]]
*[[Electrochemical gradient]]
*[[Level set]]
*[[Musical isomorphism]]
*[[Del|Nabla]]
*[[Sobel operator]]
*[[Grade (slope)]]
*[[Slope#Slope of a road or railroad|Slope]]
*[[Surface gradient]]
</div>
==References==
* {{citation |first1=Theresa M.|last1=Korn|last2=Korn|first2=Granino Arthur |title=Mathematical Handbook for Scientists and Engineers: Definitions, Theorems, and Formulas for Reference and Review |publisher=Dover Publications |location=New York |year= |pages=157-160 |isbn=0-486-41147-8 |oclc= |doi=}}.
* {{citation|first=H.M.|last=Schey|title=Div, Grad, Curl, and All That|publisher=W.W. Norton|edition=2nd|year=1992|isbn=0-393-96251-2}}.
{{wiktionary}}
[[Category:Differential calculus]]
[[Category:Generalizations of the derivative]]
[[Category:Vector calculus]]
[[bs:Gradijent]]
[[bg:Градиент]]
[[ca:Gradient]]
[[cs:Gradient]]
[[de:Gradient (Mathematik)]]
[[et:Gradient]]
[[es:Gradiente]]
[[eo:Gradiento (matematiko)]]
[[fa:گرادیان]]
[[fr:Gradient]]
[[ko:기울기 (벡터)]]
[[id:Gradien]]
[[is:Stigull]]
[[it:Gradiente]]
[[he:גרדיאנט]]
[[lv:Gradients]]
[[lt:Gradientas]]
[[nl:Gradiënt (wiskunde)]]
[[ja:勾配]]
[[pl:Gradient (matematyka)]]
[[pt:Gradiente]]
[[ro:Gradient]]
[[ru:Градиент]]
[[simple:Gradient]]
[[sk:Gradient]]
[[sl:Gradient]]
[[sh:Gradijent]]
[[fi:Gradientti]]
[[sv:Gradient]]
[[vi:Gradient]]
[[tr:Gradyan]]
[[uk:Градієнт]]
[[zh:梯度]]