thumb|300px|The gradient, represented by the blue arrows, denotes the direction of greatest change of a scalar function. The values of the function are represented in greyscale and increase in value from white (low) to dark (high).
A gradient is a mathematical tool that shows which direction a quantity is changing most steeply at any given point, like how a slope indicates the steepest way up a hill. It matters because it helps scientists and engineers understand how things like temperature, pressure, or other quantities vary across space, which is essential for solving real-world problems.
AI-generated from the Wikipedia summary — may contain errors.
thumb|300px|The gradient, represented by the blue arrows, denotes the direction of greatest change of a scalar function. The values of the function are represented in greyscale and increase in value from white (low) to dark (high).
In vector calculus, the gradient of a scalar-valued differentiable function f of several variables is the vector field (or vector-valued function) \nabla f whose value at a point p gives the direction and the rate of fastest increase. The gradient transforms like a vector under change of basis of the space of variables of f. If the gradient of a function is non-zero at a point p, the direction of the gradient is the direction in which the function increases most quickly from p, and the magnitude of the gradient is the rate of increase in that direction, the greatest absolute directional derivative. Further, a point where the gradient is the zero vector is known as a stationary point. The gradient thus plays a fundamental role in optimization theory, machine learning, and artificial intelligence, where it is used to minimize a function by gradient descent. In coordinate-free terms, the gradient of a function f(\mathbf{r}) may be defined by:
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).