Riemannian Manifolds
For any smooth function f on a Riemannian manifold (M,g), the gradient of f is the vector field ∇f such that for any vector field X,
where gx(, ) denotes the inner product of tangent vectors at x defined by the metric g and ∂Xf (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 φ from an open subset of M to an open subset of Rn, (∂Xf)(x) is given by:
where Xj denotes the jth component of X in this coordinate chart.
So, the local form of the gradient takes the form:
Generalizing the case M = Rn, the gradient of a function is related to its exterior derivative, since
More precisely, the gradient ∇f is the vector field associated to the differential 1-form df using the musical isomorphism
(called "sharp") defined by the metric g. The relation between the exterior derivative and the gradient of a function on Rn is a special case of this in which the metric is the flat metric given by the dot product.
Read more about this topic: Gradient