gradient
Summary.
The gradient^{} is a firstorder differential operator^{} that maps scalar functions to vector fields. It is a generalization^{} of the ordinary derivative^{}, and as such conveys information about the rate of change of a function relative to small variations in the independent variables. The gradient of a function $f$ is customarily denoted by $\nabla f$ or by $\mathrm{grad}f$.
1 Definition: Euclidean space
Let $f:{\mathbb{R}}^{n}\to \mathbb{R}$ be continuously differentiable. The gradient of $f$, denoted by $\nabla f$, is defined by the property:
$${\mathrm{D}}_{\mathbf{v}}f=\nabla f\cdot \mathbf{v}\mathit{\hspace{1em}}\text{for all vectors}\mathbf{v}\in {\mathbb{R}}^{n}\text{.}$$  (1) 
The middle dot is the dot product^{}, and ${\mathrm{D}}_{\mathbf{v}}$ is the directional derivative^{} with respect to $\mathbf{v}$.
If ${x}^{1},\mathrm{\dots},{x}^{n}$ are Euclidean^{} coordinates^{}, corresponding to the orthonormal basis ${\mathbf{e}}_{1},\mathrm{\dots},{\mathbf{e}}_{n}$, then
$$\nabla f=\sum _{i=1}^{n}\frac{\partial f}{\partial {x}^{i}}{\mathbf{e}}_{i}.$$  (2) 
The formula^{} (2) is sometimes given as the definition of $\nabla f$. We prefer to define $\nabla f$ by the coordinatefree formula (1) instead, because then the geometric interpretations^{} (see below) become obvious, and (1) also indicates how we would go about calculating the gradient in other curvilinear coordinate systems. Formula (1) also makes it clear that the gradient is a physical vector, depending only on the inner product structure of ${\mathbb{R}}^{n}$, and not on the specific coordinate system^{} used to calculate it.
There is the issue of whether the $\nabla f$ as defined by (1) exists; but this is proved easily enough, by substituting the concrete expression (2) and seeing that it satisfies (1).
The gradient can be considered to be a vectorvalued differential operator, written as
$$\nabla =\sum _{i=1}^{n}{\mathbf{e}}_{i}\frac{\partial}{\partial {x}^{i}},$$ 
or, in the context of Euclidean 3space, as
$$\nabla =\mathbf{i}\frac{\partial}{\partial x}+\mathbf{j}\frac{\partial}{\partial y}+\mathbf{k}\frac{\partial}{\partial z},$$ 
where $\mathbf{i},\mathbf{j},\mathbf{k}$ are the unit vectors^{} lying along the positive direction of the $x,y,z$ axes, respectively.
2 Geometric and physical interpretations

(a)
The direction of the vector $\nabla f$ is the direction of the greatest positive change, or increase, in $f$. The magnitude of $\nabla f$ is the magnitude of this increase. This follows immediately from (1):
$${\mathrm{D}}_{\mathbf{v}}f=\nabla f\cdot \mathbf{v}=\parallel \nabla f\parallel \parallel \mathbf{v}\parallel \mathrm{cos}\theta ,$$ where $\theta $ is the angle between $\nabla f$ and $\mathbf{v}$. So among all unit directions $\mathbf{v}$ of change, if $\mathbf{v}$ is perpendicular^{} to $\nabla f$ then the change ${\mathrm{D}}_{\mathbf{v}}f$ is zero; if $\mathbf{v}$ is parallel^{} to $\nabla f$ then the change is maximized.
Similarly, $\nabla f$ is the direction of the greatest negative change, or decrease, in $f$.

(b)
If $M$ is the hypersurface in ${\mathbb{R}}^{n}$ defined by
$$M=\{p\in {\mathbb{R}}^{n}:f(p)=0,\mathrm{D}f(p)\ne 0\},$$ then $\nabla f(p)$ is the normal to the hypersurface $M$ at the point $p$. For $\mathrm{ker}\mathrm{D}f(p)$ is the tangent space^{} ${\mathrm{T}}_{p}M$ to $M$ at $p$, that is, ${\mathrm{D}}_{\mathbf{v}}f(p)=0$ for all $\mathbf{v}\in {\mathrm{T}}_{p}M$, and by definition (1), $\nabla f(p)$ must be perpendicular to all $\mathbf{v}\in {\mathrm{T}}_{p}M$.
Note that $\mathrm{D}f\ne 0$ is equivalent^{} to $\nabla f\ne 0$. Consequently, $\nabla f$ also gives an orientation to the hypersurface $M$.
For example, if $f(\mathbf{x})=\parallel \mathbf{x}\parallel 1$ for $\mathbf{x}\in {\mathbb{R}}^{n}$, $M$ is the $(n1)$dimensional sphere of unit radius, embedded in ${\mathbb{R}}^{n}$. Its normal, $\nabla f(\mathbf{x})=\mathbf{x}/\parallel \mathbf{x}\parallel $, as one would expect, points outward radially.

(c)
As a simple case of (b), consider the surface $z=f(x,y)$ in ${\mathbb{R}}^{3}$, with Cartesian coordinates^{} $(x,y,z)$. Think of this surface as describing a hill, with height $z$. Then the direction of the gradient vector $\nabla f$ is the direction of steepest ascent of the hill, while its magnitude
$$\parallel \nabla f\parallel =\sqrt{{\left(\frac{\partial f}{\partial x}\right)}^{2}+{\left(\frac{\partial f}{\partial y}\right)}^{2}}$$ is the slope or steepness in that direction.
If a ball is placed on the hill at a point $(x,y,z)$, theoretically it should roll down the hill in the direction of the gradient vector $\nabla f(x,y)$. This may be easily derived by considering the mechanical forces on the ball. The direction of $\nabla f(x,y)$ is, in fact, the projection to the xyplane of an outward normal vector to the hill at $(x,y,z)$; the normal vector is involved because the movement of the ball arises from the normal force from the hill.

(d)
Suppose the surface $z=f(x,y)$ in (c) describes a bowl instead of a hill, and we place a marble at any point $(x,y,z)$ on this bowl. We would expect the marble to roll down to a local minimum^{} point of $f(x,y)$. Since the marble should roll down in the direction of $\nabla f$, we might hope that we can find local minima of a given function $f$ by following the path mapped out by the gradients $\nabla f$. Formally, this method of finding local extrema (with some modifications) is called gradient descent.

(e)
If $U$ is the potential function corresponding to a conservative physical force, then $\mathbf{F}=\nabla U$ is the corresponding force field.
Consequently, the gradient theorem^{},
$${\int}_{\gamma}\mathbf{F}\cdot d\mathbf{s}={\int}_{\gamma}\nabla U\cdot d\mathbf{s}=U(\gamma (b))+U(\gamma (a)),\gamma :[a,b]\to {\mathbb{R}}^{3}$$ simply gives the formula for the change in the potential energy $U$ when an object “does work” along a path $\gamma $ in a conservative force field $\mathbf{F}$.
3 Definition: Riemannian geometry
It is obvious how (1) can be generalized to the setting of Riemannian manifolds^{}: the dot product of ${\mathbb{R}}^{n}$ must be replaced by the Riemannian metric, and the analogue of ${\mathrm{D}}_{\mathbf{v}}f$ is the directional derivative $\mathbf{v}[f]$, for tangent vectors $\mathbf{v}$ on the Riemannian manifold. Thus for a smooth scalarvalued function $f$ on a Riemannian manifold,
$$\mathbf{X}=\mathrm{grad}f\iff d{f}_{p}(\mathbf{v})=\mathbf{v}[f]={\u27e8\mathbf{X},\mathbf{v}\u27e9}_{p}.$$  (3) 
We can calculate $\mathbf{X}$ explicitly as follows. If ${x}^{i}$ are local coordinates on the manifold (not necessarily orthonormal), set $\mathbf{X}={X}^{i}\frac{\partial}{\partial {x}^{i}}$ (the Einstein summation convention is being used). Let ${g}_{ij}$ and ${g}^{ij}$ be the covariant and contravariant metric tensors, respectively. Then from (3),
$$\frac{\partial f}{\partial {x}^{j}}=\u27e8{X}^{i}\frac{\partial}{\partial {x}^{i}},\frac{\partial}{\partial {x}^{j}}\u27e9={X}^{i}\u27e8\frac{\partial}{\partial {x}^{i}},\frac{\partial}{\partial {x}^{j}}\u27e9={g}_{ij}{X}^{i},$$ 
and taking inverses^{},
$${X}^{i}={g}^{ij}\frac{\partial f}{\partial {x}^{j}}.$$  (4) 
4 Duality with differential oneforms
Definitions (1) and (3) exhibit $\nabla f$ as the vector field dual to the differential form^{} $df$. The isomorphism^{} is given by applying the inner product or Riemannian metric. This isomorphism is, of course, linear; in particular it leads to the identity
$$\nabla f=\frac{\partial f}{\partial {x}^{i}}\nabla {x}^{i},$$  (5) 
which is the dual to the standard formula of differential^{} oneforms:
$$df=\frac{\partial f}{\partial {x}^{i}}d{x}^{i}.$$ 
$$\nabla {x}^{i}={g}^{ij}\frac{\partial}{\partial {x}^{j}},\frac{\partial}{\partial {x}^{i}}={g}_{ij}\nabla {x}^{j}.$$  (6) 
So the isomorphism between vector fields and oneforms is expressed by changing the $\nabla $’s in (6) to $d$’s, and vice versa. That is,
$$d{x}^{i}\leftrightarrow {g}^{ij}\frac{\partial}{\partial {x}^{j}},\frac{\partial}{\partial {x}^{i}}\leftrightarrow {g}_{ij}d{x}^{j}.$$  (7) 
It is commonly said that this isomorphism is expressed by “raising and lowering the indices of a tensor field, using contractions^{} with ${g}_{ij}$ and ${g}^{ij}$”.
Notice that when ${x}^{i}$ are orthonormal coordinates on ${\mathbb{R}}^{n}$, equation (5) reduces to equation (2), because ${g}_{ij}={\mathbf{e}}_{i}\cdot {\mathbf{e}}_{j}={\delta}_{ij}$ (Kronecker delta^{}).
The formulae presented in this section^{} are useful in the Euclidean setting as well, for deriving the formulae for the gradient in various curvilinear coordinate systems (http://planetmath.org/GradientInCurvilinearCoordinates).
5 Differential identities
Several properties of the onedimensional derivative generalize to a multidimensional setting
$\nabla (af+bg)$  $=a\nabla f+b\nabla g$  Linearity  
$\nabla (fg)$  $=f\nabla g+g\nabla f$  Product rule^{}  
$\nabla (f\circ \varphi )(p)$  $=\mathrm{D}\varphi {(p)}^{*}\nabla f(\varphi (p))$  Chain rule^{}  
$\nabla (h\circ f)(p)$  $={h}^{\prime}(f(p))\nabla f(p)$  Another Chain rule 
The function $h$ is $h:\mathbb{R}\to \mathbb{R}$. The notation ${(\mathrm{D}\varphi )}^{*}$ denotes the transpose^{} of the Jacobian matrix, in Euclidean coordinates, of $\varphi :{\mathbb{R}}^{m}\to {\mathbb{R}}^{n}$. In the abstract setting, ${(\mathrm{D}\varphi )}^{*}$ is the adjoint^{} to the tangent map $\mathrm{D}\varphi $ between the tangent bundles of two Riemannian manifolds.
These identities can be proved directly from the definition, but the first three are really just the duals of the following wellknown identities for differential forms:
$d(af+bg)$  $=adf+bdg$  
$d(fg)$  $=fdg+gdf$  
$d({\varphi}^{*}f)$  $={\varphi}^{*}df$ 
and so may be derived by changing the $d$’s here to $\nabla $’s! (Though the third identity may take a bit of thought.)
The following identity
$$\mathrm{curl}\mathrm{grad}f=\nabla \times \nabla f=0,$$ 
is a special case of the differential forms identity ${d}^{2}=0$. Conversely, if $\mathrm{curl}g=0$ on a simply connected domain, then there is $f$ such that $g=\mathrm{grad}f$. See laminar field for details.
6 The $\nabla $ symbolism
(This discussion does not really belong here, but should be moved to the nabla entry.)
Using the $\nabla $ formalism, the divergence^{} operator can be expressed as $\nabla \cdot $, the curl operator as $\nabla \times $, and the Laplacian operator as ${\nabla}^{2}$. To wit, for a given vector field
$$\mathbf{A}={A}_{x}\mathbf{i}+{A}_{y}\mathbf{j}+{A}_{z}\mathbf{k},$$ 
and a given function $f$ we have
$\nabla \cdot \mathbf{A}$  $={\displaystyle \frac{\partial {A}_{x}}{\partial x}}+{\displaystyle \frac{\partial {A}_{y}}{\partial y}}+{\displaystyle \frac{\partial {A}_{z}}{\partial z}}$  
$\nabla \times \mathbf{A}$  $=\left({\displaystyle \frac{\partial {A}_{z}}{\partial y}}{\displaystyle \frac{\partial {A}_{y}}{\partial z}}\right)\mathbf{i}+\left({\displaystyle \frac{\partial {A}_{x}}{\partial z}}{\displaystyle \frac{\partial {A}_{z}}{\partial x}}\right)\mathbf{j}+\left({\displaystyle \frac{\partial {A}_{y}}{\partial x}}{\displaystyle \frac{\partial {A}_{x}}{\partial y}}\right)\mathbf{k}$  
${\nabla}^{2}f$  $={\displaystyle \frac{{\partial}^{2}f}{\partial {x}^{2}}}+{\displaystyle \frac{{\partial}^{2}f}{\partial {y}^{2}}}+{\displaystyle \frac{{\partial}^{2}f}{\partial {z}^{2}}}.$ 
References
 1 Michael Spivak. A Comprehensive Introduction to Differential Geometry^{}, Volume I. Publish or Perish, 1979.
Title  gradient 
Canonical name  Gradient 
Date of creation  20130322 11:59:20 
Last modified on  20130322 11:59:20 
Owner  CWoo (3771) 
Last modified by  CWoo (3771) 
Numerical id  20 
Author  CWoo (3771) 
Entry type  Definition 
Classification  msc 58A10 
Classification  msc 26B12 
Classification  msc 26B10 
Related topic  Derivative2 
Related topic  RiemannianMetric 
Related topic  GradientInCurvilinearCoordinates 
Related topic  NablaNabla 
Related topic  DifferentialForms 
Related topic  FirstOrderOperatorsInRiemannianGeometry 
Related topic  VectorField 
Related topic  HessianMatrix 
Related topic  DerivativeNotation 
Related topic  JacobianMatrix 
Related topic  PartialDerivative 
Related topic  TiltCurve 
Defines  gradient 