Learning path

Full curriculum

Full curriculum

Unit content

Gradient

For a scalar-valued function, the partial derivatives can be collected into a vector called the gradient:

$$\nabla f= \left( \frac{\partial f}{\partial x_1}, \ldots, \frac{\partial f}{\partial x_n} \right).$$

For $f(x,y)$,

$$\nabla f=(f_x,f_y).$$

Example

If

$$f(x,y)=x^2+2y^2,$$

then

$$\nabla f(x,y)=(2x,4y).$$

At $(1,1)$,

$$\nabla f(1,1)=(2,4).$$

The gradient therefore changes from point to point just as the slopes of the function do.

Direction of steepest increase

At a differentiable point where $\nabla f\ne\mathbf0$, the gradient points in the direction in which $f$ increases most rapidly. The greatest rate of increase per unit distance is

$$|\nabla f|.$$

The opposite direction gives the fastest decrease.

Relation to level sets

Moving along a level curve keeps $f$ constant, so the instantaneous motion along the curve produces no change in $f$. The gradient is therefore perpendicular to the tangent direction of a regular level curve or level surface.

For a hill-shaped scalar field, level curves act like contour lines on a map, while the gradient points directly uphill.

The gradient converts the local rates of change in each coordinate direction into one geometric vector.