Partial Differentiation
Consider a scalar field of the form:
This is a function that takes a point in -dimensional space and returns a single real number — like a temperature field in a room, or an elevation map over terrain.
Directional Derivative
Recall from one-dimensional calculus that the derivative of at a point is:
This is the slope of the function at : how much does change when we take a tiny step of size away from ? Geometrically, it is the same intuition behind — the slope of a line is simply the ratio of the vertical rise to the horizontal run, i.e., .
In multiple dimensions, the same question becomes richer: we can step away from a point in infinitely many directions. This is where the directional derivative comes in — it tells us the rate of change of when we stand at a point and look in a specific direction .
Here, is the base point — the location in the domain where we want to measure how fast is changing. Think of it as your current position on a terrain map: you first choose where you stand, then you choose which way to look. Crucially, the directional derivative is a local quantity — it captures the behavior of specifically at , not globally.
For each unit vector (with ), we take a tiny step of size from in the direction , measure the change in , and divide by the step size — the same slope formula as before, now generalized to any direction in -dimensional space:
As , the step size becomes infinitesimally small, and we recover the instantaneous rate of change in the chosen direction.
The directional derivative of a scalar field at a point in the direction of a unit vector (with ) is:
All three notations — , , and — refer to the same quantity: the rate of change of at the base point along the direction .
Requiring to be a unit vector ensures that the step has length exactly , making the derivative a pure measure of directional rate of change, independent of the magnitude of .
Since can point in any direction on the unit sphere in , there are infinitely many directional derivatives at any given point . In principle, this limit may not exist for every combination of , , and . However, throughout this course we will work with sufficiently smooth functions and always assume the limit exists — the “happy scenario.”
Partial Derivatives
Having infinitely many directions to check is impractical. The saving insight is that we are working in a linear vector space: any direction can be expressed as a linear combination of the vectors of the standard basis (also called the canonical basis) of . For smooth functions, this means the behavior of in every direction is fully determined by its behavior along the coordinate directions — one per argument of the function. We do not need to sweep through all directions; the coordinate directions are enough.
Substituting into the directional derivative formula means we step from by a tiny amount purely along the -th axis, holding all other coordinates fixed. The resulting limit is the rate of change of with respect to its -th argument .
The partial derivative of at a point with respect to the variable is:
As always, we assume this limit exists. Each partial derivative answers a single focused question: how fast does change when only the -th coordinate of is nudged, while all others stay fixed? Together, the partial derivatives provide a complete description of how varies locally — they tell the full story.
The Gradient
Once all partial derivatives at exist, we say is partially differentiable at . We can then collect these derivatives into a single vector — the gradient.
The gradient of at a point is the column vector of all partial derivatives:
The gradient lives in the same space as the input — not the output. So for a scalar field , the gradient at any point is a 2D vector; for , it’s a 3D vector.
This means we can evaluate at every point in the domain, producing a gradient field — a vector field on . Think of it as an arrow attached to each input point, pointing in the direction of steepest ascent at that location.
The symbol is called the nabla (or del) operator. Differential operators like will be explored in more depth later in the course.
The gradient is the payoff for working in a linear vector space. When are continuous, any directional derivative reduces to a dot product with the gradient:
This is the key trick: instead of computing a separate limit for every possible direction , we compute the gradient once — just partial derivatives — and recover any directional derivative for free via an inner product. No more tortuous limit computations for each new direction; the gradient packages all local directional information into a single vector.
Let . Using standard differentiation rules, the three partial derivatives are:
Assembling them into the gradient:
Steepest Ascent and Descent
The gradient does more than package the partial derivatives — it points in a very specific geometric direction. Suppose is a scalar field with continuous partial derivatives , and let be a point where . Then has its steepest ascent at in the direction , and its steepest descent in the opposite direction .
Intuitively: standing on a hillside, the gradient points straight uphill along the steepest route, and its negative points straight downhill. Every other direction trades some uphill progress for sideways motion.
This follows directly from the dot-product formula : among all unit vectors , this inner product is largest when is aligned with and smallest when it points the opposite way. The one strict condition is — at a point where the gradient vanishes, there is no preferred direction.
Isolines
Alongside the gradient, another geometric object captures the shape of a scalar field: the set of points where takes a constant value.
Let be a scalar field. For a value , the isoline (also called contour line or level set) of at level is:
Think of a topographic map: each contour traces the points at the same elevation. On a weather map, each isotherm connects places with the same temperature. More generally, isolines slice the domain into level sets on which is constant.
The gradient at a point is always perpendicular to the isoline passing through . The reasoning is short. By definition, takes the constant value everywhere on the isoline. Now pick any unit vector that points along the isoline at — that is, a direction you could step in to stay on the isoline, the way a hiker walks along a contour line without gaining or losing elevation. Such a is called a tangent vector to the isoline at . Since does not change as we move in this direction, the directional derivative along must be zero. Using the dot-product formula for the directional derivative:
and a zero inner product means the two vectors are orthogonal. Since this holds for every tangent direction of the isoline, is perpendicular to the isoline as a whole. Back to the hillside: walking along a contour keeps your elevation fixed, and the uphill direction is exactly perpendicular to the contour you are standing on.
In the example above, the 2D floor is the domain of : the heatmap encodes as color, the dark rings are isolines (level sets ), and the red arrows are the gradient field . This is where , its isolines, and its gradient actually live. The 3D bowl is the graph — a visualization aid, not a separate object. The same isolines and gradient arrows are lifted onto it: the rings become horizontal cross-sections of the bowl, and the arrows become tangent vectors pointing in the steepest-ascent direction along the surface.
Arrow length. The arrows are short near the center and long at the boundary — not by coincidence. For :
The gradient magnitude is just twice the radial distance. Geometrically: near the origin the bowl is nearly flat, so there’s barely any slope to point along; near the rim it’s steep, so the gradient is large. Exactly at the origin — you’re at the minimum, there’s no downhill direction, the gradient has nothing to say.
Arrow direction. Every arrow points straight outward, perpendicular to the isoline it sits on. That’s not specific to this example — it’s always true: the gradient is orthogonal to the level set. If you stood on the 3D bowl and asked “which way is straight up the slope?”, the answer is exactly where the lifted arrow points.