Partial Derivatives and the Gradient
One-line statement: A partial derivative measures the rate of change of a multivariable function with respect to one variable while holding all others fixed; the gradient assembles these partials into a vector pointing in the direction of steepest increase. Key result in words: is perpendicular to level sets and its magnitude gives the maximum directional rate of change. Where it applies: Optimization, physics (fields, forces), machine learning (gradient descent), thermodynamics, differential geometry. Who/when: Concept matured through Euler, Clairaut, and Jacobi in the 18th–19th centuries; vector notation ∇ popularized by Hamilton and Gibbs.A partial derivative of a function with respect to is the ordinary derivative obtained by treating all variables except as constants. The gradient collects all first-order partial derivatives into a single vector field, encoding the complete first-order local behavior of . These tools matter because they generalize the single-variable derivative to functions of many variables, which describe nearly every physical, economic, and computational system of interest. A surprising fact: although each partial derivative looks at only one coordinate axis, the gradient — built entirely from these axis-aligned slopes — nonetheless identifies the globally optimal direction of increase among all possible directions, a fact that is not obvious and is the engine behind gradient-based optimization.
The Core Insight
Differentiation in many dimensions splits into two complementary objects. Partial derivatives are scalar slopes along coordinate axes. The gradient is the vector that organizes them so that, for any unit direction , the rate of change of in that direction is simply . The single dot product collapses an infinite family of directional questions into one linear algebra operation — and immediately reveals that the steepest ascent direction is itself.
Formal Statement
Partial Derivative
Let and let . The partial derivative of with respect to at is
The Gradient
For a differentiable , the gradient is the vector of all first partials:
Directional Derivative
The rate of change of at in the direction of a unit vector is
Steepest Ascent and Orthogonality to Level Sets
Let be differentiable at with . Then:
- The maximum value of over all unit equals , attained when .
- is orthogonal to the level set at .
Why It Holds / Derivation
Gradient gives directional derivative and steepest ascent
Step 1 — Reduce to one variable. Fix and a unit direction . Define , a function of the single real variable . Step 2 — Apply the multivariable chain rule. If is differentiable at , thenwhere is the angle between and . Since , the maximum occurs at (steepest ascent) and the minimum at (steepest descent). This proves [4]. The orthogonality claim [5] follows because tangent directions to the level set correspond to where the directional derivative vanishes.
Differentiability is required, not just existence of partials
Equations [3]–[5] assume is differentiable at , meaning admits a good linear approximation. The mere existence of all partial derivatives does not guarantee differentiability, and in such pathological cases the formula can fail. A standard sufficient condition: if all partials exist and are continuous in a neighborhood of (i.e. ), then is differentiable there.
Carl Gustav Jacob Jacobi | 1804–1851
Jacobi systematized partial differentiation through his work on the theory of multiple-variable transformations, introducing the Jacobian determinant that bears his name and embedding partial derivatives into a rigorous matrix framework. His treatment of functional dependence and changes of variable made the array of partial derivatives — what we now call the Jacobian matrix, whose single-output special case is the gradient — a first-class mathematical object. Jacobi's emphasis on the structured organization of derivatives directly anticipated the modern vector gradient and the broader machinery of differential calculus on .
Building Intuition
Picture as the elevation of a mountainous terrain over a map. A partial derivative is the slope you feel if you walk due east, ignoring north–south tilt — it is one specific compass-aligned slope. But terrain doesn't care about compass directions; the steepest uphill might point northeast. The gradient is the arrow on your map that points directly uphill in the steepest possible direction, and its length tells you how steep that climb is. Crucially, the gradient is built only from the east–west and north–south slopes, yet it correctly identifies the best diagonal direction — because any direction's slope is a weighted blend of the axis slopes, and that blend is exactly a dot product. Water flowing downhill always runs anti-parallel to the gradient, and contour lines on a topographic map (level sets) always cross the gradient at right angles.
Gradient vector perpendicular to level curves, pointing toward steepest ascent
Worked Examples
Gradient of a paraboloid and steepest ascent
Given: , evaluate at . Find , the steepest-ascent direction, and the directional derivative toward . Step 1 — Partial derivatives.Temperature gradient — heat flux direction
Given: A metal plate has temperature (in °C, in cm). A bug sits at . Which way is it coolest, and how fast does temperature drop there? Step 1 — Gradient. , so This points toward increasing temperature. Step 2 — Coolest direction = negative gradient.Common Misconceptions
Frequent errors with partials and gradients
- The gradient is not a slope (scalar); it is a vector. Its magnitude is the maximal slope.
- Do not confuse (gradient, input on a scalar field) with the divergence or curl , which act on vector fields and produce different objects.
- Mixed partials need not be equal in pathological cases. Clairaut's theorem guarantees only when those mixed partials are continuous.
- Existence of partials ≠ continuity ≠ differentiability. All four properties (partials exist, continuity, differentiability, ) are genuinely distinct.
- The dot-product formula requires to be a unit vector; using a non-unit vector silently rescales the rate.
Partials exist but $f$ is not even continuous
Consider
Both partials exist at the origin: and likewise . Yet is not continuous at — approaching along gives , but along the axes . Hence the partials existing tells us nothing about continuity, let alone differentiability. The naive formula would falsely predict zero change in every direction.
Connections
The gradient is the transpose / vector form of the Jacobian Matrix for the special case of a scalar-valued function. It is the central ingredient of the Multivariable Chain Rule, which expresses . It underlies the Method of Lagrange Multipliers, where constrained optima require (gradients parallel). In vector calculus, generalizes to the Divergence and Curl operators, and the gradient is the first member of the differential-operator family unified by the Exterior Derivative. The condition defines Critical Points and the Second Derivative Test.
Real-World Applications
- Machine learning — gradient descent. Neural networks minimize a loss by repeatedly stepping , the single most-used optimization rule in modern AI.
- Thermodynamics & heat transfer. Fourier's law states heat flux is proportional to the negative temperature gradient.
- Electromagnetism. The electric field is the negative gradient of potential, , converting a scalar potential map into a force field.
- Fluid dynamics. Pressure gradients drive flow; the term appears directly in the Navier–Stokes momentum equation.
- Computer graphics & vision. Image gradients detect edges (Sobel/Canny operators) by locating regions of large .
- Economics. The gradient of a utility or production function gives marginal rates and underlies marginal analysis and constrained optimization.
- Geophysics & GIS. Terrain slope and aspect, watershed delineation, and steepest-descent flow routing all compute elevation gradients on digital elevation models.
Historical Development
- 1740s — Euler develops systematic partial differentiation in the study of functions of several variables and the calculus of variations.
- 1740 — Clairaut establishes the equality of mixed partial derivatives under continuity (now Clairaut's / Schwarz's theorem), in work on the shape of the Earth.
- 1770s — Lagrange introduces multiplier methods for constrained optimization, implicitly using gradient parallelism.
- 1797 — Lagrange popularizes prime/subscript derivative notation in Théorie des fonctions analytiques.
- 1841 — Jacobi publishes his theory of functional determinants, formalizing arrays of partial derivatives (the Jacobian).
- 1843 — Hamilton introduces the operator ("nabla") in connection with quaternions.
- 1873 — Maxwell employs and refines notation in his Treatise on Electricity and Magnetism, including the gradient.
- 1880s — Gibbs and Heaviside develop modern vector calculus, cementing , divergence, and curl as standard notation taught today.
- 1847 — Cauchy describes the method of steepest descent, the conceptual ancestor of gradient-based optimization.
Subtleties & Limits
Several conceptual subtleties extend beyond the introductory picture. (1) Coordinate dependence: the naive component definition of is correct only in orthonormal Cartesian coordinates; in curvilinear or non-Euclidean settings the gradient requires the metric tensor, , distinguishing the gradient vector from the differential (a covector). This distinction — vectors versus covectors — is invisible in with the standard metric but essential in differential geometry and general relativity. (2) Non-smoothness: for non-differentiable convex functions (e.g. in machine learning) the gradient is replaced by the subgradient, and optimization theory must handle set-valued generalizations. (3) Infinite dimensions: generalizing the gradient to function spaces leads to the Fréchet and Gâteaux derivatives, with delicate existence questions central to the calculus of variations and PDE theory.