The **gradient** of a scalar function (or field) **is a vector-valued function** directed toward the direction of fastest increase of the function and with a magnitude equal to the fastest increase in that direction. It is denoted with the ∇ symbol (called *nabla*, for a Phoenician harp in greek). The gradient is therefore a **directional derivative**.

A scalar function associates a number (a scalar value) to every point of the space.

A vector-valued function (or vector function) associates a vector to every point of the space.

Two scalar fields are represented in the upper figure (the left one has a circular symmetry). As you can see, the field value increases (inward for the left field, and from the right to the left for the right field). The vectors (vector-valued function) represent the gradient and are directed toward the direction of fastest increase of the scalar function.

An example of gradient is for instance the temperature change inside a room. The temperature is a scalar quantity, so we can mathematically represent it as a function *f*(x,y,z). For any point (x,y,z) of the room, the *f* function returns a number (the temperature in this point).

To make it simple, we will consider the temperature to be invariant in time. If we calculate the gradient of *f* at a point (x,y,z), the resulting vector-valued function will return the direction of the fastest increase of temperature **at this point**. The gradient magnitude will correspond to the rate of the temperature rise in this direction.

The way the gradient is calculated depends on the coordinates system used.

### Ad blocker detected

**Gradient in Cartesian coordinates**:

Where the ∂ symbol denotes the **partial derivative** of function *f* with respect to the corresponding variable. When a scalar function depends on multiple variables, its partial derivative with respect to one variable is calculated with the others variables held constant.

* i*,

*and*

**j***are the unit vectors for directions x, y and z respectively.*

**k****Example of partial derivatives of a scalar function**:

And its gradient:

### Ad blocker detected

**Gradient in spherical coordinates**:

The spherical coordinates are represented in the following figure:

And the gradient of function *f* expressed in spherical coordinates is given by:

Where **u**_{r}, **u**_{θ} and **u**_{φ} are the unit vectors for directions r, θ y φ.

When a function *f* depends only on the radial coordinate (for instance the electrostatic potential energy), its gradient is given by:

Where the total derivative symbol *d* is used instead of the partial derivative ∂ because here *f* depends only on a single variable (r).