Gradients are a class of functions generalising derivatives to higher order vector spaces.

It works simply by differentiating it by its individual components using partial derivatives.