In vector calculus, **gradient** is a vector-valued operator that acts on a scalar field. The **gradient** of a scalar field is a vector field which shows its rate and direction of change.

For example, consider a room. This is a 3-dimensional space, and the temperature of the air at any point is a scalar field : a number associated to each point vector (we are considering the temperature as unchanging, so there is no time variable). At any given point, the gradient is a vector that points in the direction of the greatest rate of change and has a magnitude equal to that rate.

A good two-dimensional example is a hill. The contour map of the terrain is, in effect, a scalar function -- the height z defined by the co-ordinates of the given point. The gradient of z at a point is a two-dimensional vector which points in the direction of the greatest slope. The magnitude indicates how steep the slope is.

## Spatial representation of gradient

## Formal definition

where is the vector differential operator del, and is a scalar function. It is sometimes also written grad(φ).In 3 dimensions, the expression expands to

Note: The gradient does not necessarily exist at all points - for example it may not exist at discontinuities or where the function or its partial derivative is undefined.

**See also:**