Gradients
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.
Contents
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 (or gradient vector field) of a scalar function f(x1, x2, x3, …, xn) is denoted ∇f or Template:Vecf 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.