Gradients

From Department of Mathematics at UTSA
Jump to navigation Jump to search
The gradient, represented by the blue arrows, denotes the direction of greatest change of a scalar function. The values of the function are represented in greyscale and increase in value from white (low) to dark (high).

In vector calculus, the gradient of a scalar-valued differentiable function f of several variables is the vector field (or vector-valued function) whose value at a point is the vector whose components are the partial derivatives of at . That is, for , its gradient is defined at the point in n-dimensional space as the vector:{{efn|Strictly speaking, the gradient is a vector field , and the value of the gradient at a point is a tangent vector in the tangent space at that point, , not a vector in the original space . However, all the tangent spaces can be naturally identified with the original space , so these do not need to be distinguished.

The nabla symbol , written as an upside-down triangle and pronounced "del", denotes the vector differential operator.

The gradient vector can be interpreted as the "direction and rate of fastest increase". If the gradient of a function is non-zero at a point p, the direction of the gradient is the direction in which the function increases most quickly from p, and the magnitude of the gradient is the rate of increase in that direction, the greatest absolute directional derivative. Further, the gradient is the zero vector at a point if and only if it is a stationary point (where the derivative vanishes). The gradient thus plays a fundamental role in optimization theory, where it is used to maximize a function by gradient ascent.

The gradient is dual to the total derivative : the value of the gradient at a point is a tangent vector – a vector at each point; while the value of the derivative at a point is a cotangent vector – a linear function on vectors. They are related in that the dot product of the gradient of f at a point p with another tangent vector v equals the directional derivative of f at p of the function along v; that is, . The gradient admits multiple generalizations to more general functions on manifolds.

Notation

The gradient of a function at point is usually written as . It may also be denoted by any of the following:

  •  : to emphasize the vector nature of the result.
  • grad f
  • and  : Einstein notation.

Definition

The gradient of the function f(x,y) = −(cos2x + cos2y)2 depicted as a projected vector field on the bottom plane.

The gradient (or gradient vector field) of a scalar function f(x1, x2, x3, …, xn) is denoted or where (nabla) denotes the vector differential operator, del. The notation grad f is also commonly used to represent the gradient. The gradient of f is defined as the unique vector field whose dot product with any vector v at each point x is the directional derivative of f along v. That is,

Formally, the gradient is dual to the derivative.

When a function also depends on a parameter such as time, the gradient often refers simply to the vector of its spatial derivatives only.

The magnitude and direction of the gradient vector are independent of the particular coordinate representation.

Cartesian coordinates

In the three-dimensional Cartesian coordinate system with a Euclidean metric, the gradient, if it exists, is given by:

where i, j, k are the standard unit vectors in the directions of the x, y and z coordinates, respectively. For example, the gradient of the function

is

In some applications it is customary to represent the gradient as a row vector or column vector of its components in a rectangular coordinate system; this article follows the convention of the gradient being a column vector, while the derivative is a row vector.

Cylindrical and spherical coordinates

In cylindrical coordinates with a Euclidean metric, the gradient is given by:

where ρ is the axial distance, φ is the azimuthal or azimuth angle, z is the axial coordinate, and eρ, eφ and ez are unit vectors pointing along the coordinate directions.

In spherical coordinates, the gradient is given by:

where r is the radial distance, φ is the azimuthal angle and θ is the polar angle, and er, eθ and eφ are again local unit vectors pointing in the coordinate directions (that is, the normalized covariant basis).

General coordinates

We consider general coordinates, which we write as x1, …, xi, …, xn, where n is the number of dimensions of the domain. Here, the upper index refers to the position in the list of the coordinate or component, so x2 refers to the second component—not the quantity x squared. The index variable i refers to an arbitrary element xi. Using Einstein notation, the gradient can then be written as:

( Note that its dual is ),

where and refer to the unnormalized local covariant and contravariant bases respectively, is the inverse metric tensor, and the Einstein summation convention implies summation over i and j.

If the coordinates are orthogonal we can easily express the gradient (and the differential) in terms of the normalized bases, which we refer to as and , using the scale factors (also known as Lamé coefficients)  :

( and ),

where we cannot use Einstein notation, since it is impossible to avoid the repetition of more than two indices. Despite the use of upper and lower indices, , , and are neither contravariant nor covariant.

The latter expression evaluates to the expressions given above for cylindrical and spherical coordinates.

Generalizations

Jacobian

The Jacobian matrix is the generalization of the gradient for vector-valued functions of several variables and differentiable maps between Euclidean spaces or, more generally, manifolds. A further generalization for a function between Banach spaces is the Fréchet derivative.

Suppose f : ℝn → ℝm is a function such that each of its first-order partial derivatives exist on n. Then the Jacobian matrix of f is defined to be an m×n matrix, denoted by or simply . The (i,j)th entry is . Explicitly

Gradient of a vector field

Since the total derivative of a vector field is a linear mapping from vectors to vectors, it is a tensor quantity.

In rectangular coordinates, the gradient of a vector field f = ( f1, f2, f3) is defined by:

(where the Einstein summation notation is used and the tensor product of the vectors ei and ek is a dyadic tensor of type (2,0)). Overall, this expression equals the transpose of the Jacobian matrix:

In curvilinear coordinates, or more generally on a curved manifold, the gradient involves Christoffel symbols:

where gjk are the components of the inverse metric tensor and the ei are the coordinate basis vectors.

Expressed more invariantly, the gradient of a vector field f can be defined by the Levi-Civita connection and metric tensor:

where c is the connection.

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,

that is,

where gx( , ) denotes the inner product of tangent vectors at x defined by the metric g and Xf is the function that takes any point xM 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.

Licensing

Content obtained and/or adapted from: