Skip to content
Home

Gradient (multivariable calculus)

The gradient is a vector of partial derivatives that indicates direction and rate of fastest increase of a multivariable function. It links geometry, optimization, and physical fields.

Overview. In multivariable calculus the gradient of a scalar function is a vector field that encodes both the direction in which the function increases most rapidly and the rate of that increase. The gradient is a central object in vector calculus and appears whenever one compares changes of a quantity with respect to several variables. The symbol ∇f (often read "nabla f") or the name grad f are commonly used to denote the gradient.

Definition and notation

For a real-valued function f(x1,…,xn) that is differentiable, the gradient ∇f is the n-dimensional vector of partial derivatives: ∇f = (∂f/∂x1, …, ∂f/∂xn). Each component measures how the function changes when one coordinate varies and the others are held fixed; these are the partial derivatives. The directional derivative of f in a unit direction u equals the dot product ∇f · u, so the gradient summarizes directional rates of change.

Geometric interpretation and properties

Geometrically, the gradient at a point points toward the steepest ascent of the function and its magnitude equals the maximal directional derivative at that point. It is perpendicular to level sets (contours) of f: in two dimensions the gradient is orthogonal to a curve of constant f, and in higher dimensions it is normal to level surfaces. These orthogonality and extremal properties make the gradient useful for locating maxima, minima, and saddle points.

Simple examples

  • If f(x,y)=x^2+y^2, then ∇f=(2x,2y), which points away from the origin and whose length grows with distance.
  • If f(x,y)=xy, then ∇f=(y,x); at the point (1,2) the gradient is (2,1), indicating a stronger increase in the x-direction there.

Applications and uses

The gradient appears in many fields. In numerical optimization methods such as gradient descent, the negative gradient gives a local direction to decrease a function and find minima. In physics, conservative force fields are gradients of potential energy, and many partial differential equations (heat, diffusion, Laplace) involve gradients. In image processing discrete approximations to gradients detect edges and transitions in intensity. More broadly, the gradient connects a scalar quantity to an associated vector field that describes spatial change.

Relations and notable facts

The gradient is closely linked with other differential operators: the divergence of a gradient gives the Laplacian, and in simply connected domains a vector field with zero curl can often be expressed as the gradient of some potential (a gradient field). The fundamental theorem for gradients states that the line integral of a gradient between two points equals the change in the underlying scalar function, a key fact in analysis and physics. For visual intuition see graphs and diagrams of surfaces and contour plots; a function's slope along a curve on such a graph equals the component of the gradient in the curve's direction. For basic illustrations consult introductory material on graphs of functions.

Definition

On \mathbb {R} ^{n}let be \langle {\cdot },{\cdot }\rangle given the scalar product ⟨ The gradient \operatorname {grad} of the totally differentiable function f\colon \mathbb {R} ^{n}\to \mathbb {R} at the point {\displaystyle {\vec {a}}\in \mathbb {R} ^{n}}is the point given by the requirement

{\displaystyle \mathrm {d} f({\vec {a}}){\vec {h}}=\langle \operatorname {grad} f({\vec {a}}),{\vec {h}}\rangle \quad ({\vec {h}}\in \mathbb {R} ^{n})}

uniquely determined vector {\displaystyle \operatorname {grad} f({\vec {a}}).}The operator \mathrm {d} is the total differential or Cartan derivative.

For differentiable functions gradient has fthe defining property

{\displaystyle f({\vec {y}})-f({\vec {a}})=\mathrm {grad} f({\vec {a}})[{\vec {y}}-{\vec {a}}]+{\mathcal {O}}(|{\vec {y}}-{\vec {a}}|)}for {\displaystyle {\vec {y}}\to {\vec {a}}}

The Landau symbol \mathcal{O}(x)represents terms that xgrow slower than , and {\displaystyle \ldots [{\vec {h}}]}represents a linear function of {\vec h} If the gradient exists, it is unique and can be derived from

{\displaystyle \mathrm {grad} f({\vec {a}})[{\vec {h}}]=\left.{\frac {\mathrm {d} }{\mathrm {d} s}}f({\vec {a}}+s{\vec {h}})\right|_{s=0}=\lim _{s\to 0}{\frac {f({\vec {a}}+s{\vec {h}})-f({\vec {a}})}{s}}=({\vec {h}}\cdot \nabla )f}

where \nabla is the nabla operator. This is also how gradients are defined for scalar, vector, and second level tensor fields, or nth level tensor fields in general.

For a scalar field, it follows that {\displaystyle \mathrm {grad} f=\nabla f}; therefore, one often writes \nabla f(pronounced "Nabla f") instead of \operatorname {grad} {f}.

Coordinate representation

The gradient also has different representations in different coordinate systems.

Cartesian coordinates

In \mathbb {R} ^{n}with the standard Euclidean scalar product, is \operatorname {grad} f(a)the column vector

{\displaystyle \operatorname {grad} (f)={\frac {\partial f}{\partial x_{1}}}{\hat {e}}_{1}+\cdots +{\frac {\partial f}{\partial x_{n}}}{\hat {e}}_{n}={\begin{pmatrix}{\frac {\partial f}{\partial x_{1}}}\\\vdots \\{\frac {\partial f}{\partial x_{n}}}\end{pmatrix}}.}

The entries ∂ {\tfrac {\partial f}{\partial x_{i}}}are the partial derivatives of fin x_{i}direction.

Calculation example

Given a scalar field by {\displaystyle f(x,y)=2x^{2}-y^{2}}in the xy plane. It has partial derivatives ∂ {\displaystyle {\tfrac {\partial f}{\partial x}}=4x}and ∂ {\displaystyle {\tfrac {\partial f}{\partial y}}=-2y}and it follows {\displaystyle \operatorname {grad} (f)=\nabla f={\tfrac {\partial f}{\partial x}}{\hat {e}}_{x}+{\tfrac {\partial f}{\partial y}}{\hat {e}}_{y}=4x{\hat {e}}_{x}-2y{\hat {e}}_{y}}or in vector representation {\displaystyle \textstyle \operatorname {grad} (f)=\nabla f={\begin{pmatrix}4x\\-2y\end{pmatrix}}.}

For example, for the point P(2|1)the gradient vector is {\displaystyle {\begin{pmatrix}8\\-2\end{pmatrix}}}. The magnitude is {\displaystyle \left|{\begin{pmatrix}8\\-2\\\end{pmatrix}}\right|={\sqrt {8^{2}+(-2)^{2}}}\approx 8{,}25}.

Cylinder and sphere coordinates

  • Display in three-dimensional cylindrical coordinates: V=V\left(\rho ;\varphi ;z\right)

\operatorname {grad} V={\frac {\partial V}{\partial \rho }}{\hat {e}}_{\rho }+{\frac {1}{\rho }}{\frac {\partial V}{\partial \varphi }}{\hat {e}}_{\varphi }+{\frac {\partial V}{\partial z}}{\hat {e}}_{z}

\operatorname {grad} V={\frac {\partial V}{\partial r}}{\hat {e}}_{r}+{\frac {1}{r}}{\frac {\partial V}{\partial \vartheta }}{\hat {e}}_{\vartheta }+{\frac {1}{r\sin \vartheta }}{\frac {\partial V}{\partial \varphi }}{\hat {e}}_{\varphi }

These are special cases of the gradient on Riemannian manifolds. For this generalization see: Outer derivative.

Orthogonal coordinates

In general orthogonal coordinates the gradient has the representation

\operatorname {grad} f=\sum _{a}{{\frac {1}{h_{a}}}{\frac {\partial f}{\partial {q_{a}}}}\,{\hat {e}}_{q_{a}}}\,,

where the h_{a}{\tfrac {\partial {\vec {r}}}{\partial {q_{a}}}}denote the magnitude and {\hat {e}}_{q_{a}}denote the direction of the vector ∂

General curvilinear coordinates

In general curvilinear coordinates the gradient has the representation

\operatorname {grad} f=\sum _{a}{\frac {\partial f}{\partial q_{a}}}\,{\vec {G}}^{a}\,,

where {\vec {G}}^{a}is the gradient of the coordinate q_{a}

Geometric interpretation

The gradient has a descriptive meaning in the already mentioned case of (two-dimensional) maps, in which height data are registered. The height function is then a scalar field, which assigns a height to each point on the map (characterized by an x- and a y-coordinate). The gradient of this scalar field at a point is a vector pointing in the direction of the steepest slope of the height function, and the magnitude of the gradient corresponds to the magnitude of this slope. The gradient at any point is perpendicular to the contour line (level line) of the height function through that point. In a local minimum or maximum (extremum) or at a saddle point, the gradient is just the zero vector, provided that this extreme point lies in the interior of the considered area.

With the help of the gradient, the increase in any direction can also be determined. This so-called directional derivative is - in contrast to the gradient - a scalar. If one runs in the area in (infinitesimally) small triple steps from a point a to the point b and sums up the product of step length and direction derivative in direction of the step, one receives as result the height difference to the starting point a at the destination point b. This height difference is obviously path independent. This height difference is obviously path-independent. In particular, if the start and end points coincide, one has not changed one's altitude at the end, no matter which path one has taken through the area.

Applications

Conservative forces

Main article: Conservative force

In physics, many force fields can be represented as the gradient of a potential. Examples are:

  • the gravitational force

{\displaystyle {\vec {F}}_{\mathrm {Gravitation} }(x,y,z)=-m\operatorname {grad} \Phi (x,y,z)\ ,}

which is the same as for a central mass M

{\displaystyle {\vec {F}}_{\mathrm {Gravitation} }(r)=-m\operatorname {grad} \Phi (r)=\operatorname {grad} {\frac {GMm}{r}}=-{\frac {GMm}{r^{3}}}\,{\vec {r}}}

is, or

  • static electric fields {\vec {E}}in electrodynamics

{\displaystyle {\vec {E}}(x,y,z)=-\operatorname {grad} \phi (x,y,z)\ .}

In conservative force fields, one of the factors exploited is that, for sample masses or sample sample loads the path integrals the work {\textstyle W=\int _{S}{\vec {F}}({\vec {r}})\cdot \mathrm {d} {\vec {r}}}along any path Sthrough the force field depends only on the starting and ending points of the path, but not on its course, see #integral theorems.

Transport phenomena

Numerous transport phenomena can be traced back to the fact that the associated currents can be expressed as a gradient of a scalar field, with the proportionality factor that occurs being referred to as the transport coefficient or conductivity.

An example is the heat flow {\displaystyle {\vec {j}}_{w}}in thermodynamics, for which

{\displaystyle {\vec {j}}_{w}=-\lambda \,\operatorname {grad} T}

where λ is \lambda the thermal conductivity.

In fluid mechanics, a potential flow is a flow in which the velocity is a gradient of a potential field, see velocity potential.

Image processing

Main article: Edge detection

One problem in image processing is to detect contiguous areas in an image. Since an image contains discrete values, filters like the Sobel operator are used to obtain a gradient field of the image. A filter is a matrix that is used to convolve the image (see Discrete Convolution). The edges in the image are then recognizable as extreme values of the filtered image.

More applications

  • Just as Gauss-Newton methods are used for finding zeros of functions, the gradient method is used for multidimensional optimization problems in numerics.
  • A pressure gradient microphone exploits the pressure differences between spatial points.

Generalizations

Gradients of vectors and tensors

See also: Gradient of a vector field

As already noted in the #Definition section, the gradient is also applied to vectors and tensors. Gradient of a scalar field (zero level tensor field) results in a vector field which is a first level tensor field. In general, gradient of a tensor field of nth degree leads to a tensor field of degree n+1.

The coefficients of the gradients of the covariant basis vectors of a curvilinear coordinate system are the Christoffel symbols.

Especially in continuum mechanics and fluid mechanics the gradients of scalar and vector fields are used in many ways, because the above #properties can be easily transferred to gradients of vector fields.

Riemannian manifolds

For a smooth function fon a Riemannian manifold (M,g)the gradient of is fthat vector field \nabla fwith which for each vector field Xthe equation

g(\nabla f,X)=\partial _{X}f,\qquad \mathrm {d.\,h.} \quad g_{x}((\nabla f)_{x},X_{x})=(\partial _{X}f)(x),

where {\displaystyle g_{x}(\cdot ,\cdot )}the inner product of tangent vectors at xgdefined by and ∂ {\displaystyle \partial _{X}f}(often {\displaystyle X(f)}called ) is that function, which gives to each point x\in Mthe directional derivative of fin direction X, evaluated in x, is assigned. In other words, in a map φ \varphi from an open subset of Mto an open subset of \mathbb {R} ^{n}is {\displaystyle (\partial _{X}f)(x)}given by:

\sum _{j=1}^{n}X^{j}(\varphi (x)){\frac {\partial }{\partial x_{j}}}(f\circ \varphi ^{-1}){\Big |}_{\varphi (x)},

where {\displaystyle X^{j}}is the jcomponent of Xin these coordinates.

In local coordinates the gradient has the form

\nabla f=g^{ik}{\frac {\partial f}{\partial x^{k}}}{\frac {\partial }{\partial x^{i}}}.

Analogous to the case {\displaystyle M=\mathbb {R} ^{n}}one has the relation of the gradient with the outer derivative by means of

(\partial _{X}f)(x)=df_{x}(X_{x})\ .

More precisely, \nabla fis that of 1-form \mathrm {d} funder the musical isomorphism ("sharp") definedg by means of the metric

\sharp =\sharp ^{g}\colon T^{*}M\to TM

corresponding vector field. The relation between outer derivative and gradient for functions on the \mathbb {R} ^{n}is the special case for the flat metric given by the Euclidean scalar product.

Related articles

Author

AlegsaOnline.com Gradient (multivariable calculus)

URL: https://en.alegsaonline.com/art/40060

Share