Partial Derivatives and the Gradient

⚡ Key Takeaways

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: ∇f\nabla f 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.

💡 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 u\mathbf{u}, the rate of change of ff in that direction is simply ∇f⋅u\nabla f \cdot \mathbf{u}. 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 ∇f\nabla f itself.

Formal Statement

DefinitionPartial Derivative

Let f:Rn→Rf:\mathbb{R}^n \to \mathbb{R} and let a=(a1,…,an)\mathbf{a}=(a_1,\dots,a_n). The partial derivative of ff with respect to xix_i at a\mathbf{a} is

1
∂f∂xi(a)=lim⁡h→0f(a1,…,ai+h,…,an)−f(a1,…,ai,…,an)h\quad \frac{\partial f}{\partial x_i}(\mathbf{a}) = \lim_{h\to 0}\frac{f(a_1,\dots,a_i+h,\dots,a_n)-f(a_1,\dots,a_i,\dots,a_n)}{h}

Derivation hint: This is the ordinary single-variable difference quotient applied to the restricted function g(t)=f(a1,…,t,…,an)g(t)=f(a_1,\dots,t,\dots,a_n) at t=ait=a_i; all other slots are frozen.

Symbols: ff is the scalar field; xix_i is the ii-th input coordinate; a\mathbf{a} is the evaluation point; hh is the perturbation along axis ii. Equivalent notations: ∂xif\partial_{x_i} f, fxif_{x_i}, DifD_i f.

DefinitionThe Gradient

For a differentiable f:Rn→Rf:\mathbb{R}^n\to\mathbb{R}, the gradient is the vector of all first partials:

2
∇f(a)=(∂f∂x1(a), ∂f∂x2(a), …, ∂f∂xn(a))\quad \nabla f(\mathbf{a}) = \left(\frac{\partial f}{\partial x_1}(\mathbf{a}),\,\frac{\partial f}{\partial x_2}(\mathbf{a}),\,\dots,\,\frac{\partial f}{\partial x_n}(\mathbf{a})\right)

Derivation hint: Stack the nn scalars from [1] (one per coordinate axis) into an ordered tuple; the result is a vector in the same space as the inputs.

Symbols: ∇\nabla ("del" or "nabla") is the gradient operator; ∇f\nabla f is a vector field assigning a vector to each point. In Cartesian coordinates ∇=(∂x1,…,∂xn)\nabla = \big(\partial_{x_1},\dots,\partial_{x_n}\big).

DefinitionDirectional Derivative

The rate of change of ff at a\mathbf{a} in the direction of a unit vector u\mathbf{u} is

3
Duf(a)=lim⁡h→0f(a+hu)−f(a)h=∇f(a)⋅u\quad D_{\mathbf{u}}f(\mathbf{a}) = \lim_{h\to 0}\frac{f(\mathbf{a}+h\mathbf{u})-f(\mathbf{a})}{h} = \nabla f(\mathbf{a})\cdot \mathbf{u}

Derivation hint: Apply the chain rule to ϕ(h)=f(a+hu)\phi(h)=f(\mathbf{a}+h\mathbf{u}) and evaluate ϕ′(0)\phi'(0); the chain rule produces ∑i∂xif⋅ui=∇f⋅u\sum_i \partial_{x_i}f \cdot u_i = \nabla f \cdot \mathbf{u}.

Symbols: u\mathbf{u} is a unit vector (∥u∥=1\|\mathbf{u}\|=1); DufD_{\mathbf{u}}f is the directional derivative. The dot-product form holds only when ff is differentiable (existence of partials alone is insufficient).

TheoremSteepest Ascent and Orthogonality to Level Sets

Let ff be differentiable at a\mathbf{a} with ∇f(a)≠0\nabla f(\mathbf{a})\neq \mathbf{0}. Then: 1. The maximum value of Duf(a)D_{\mathbf{u}}f(\mathbf{a}) over all unit u\mathbf{u} equals ∥∇f(a)∥\|\nabla f(\mathbf{a})\|, attained when u=∇f(a)/∥∇f(a)∥\mathbf{u}=\nabla f(\mathbf{a})/\|\nabla f(\mathbf{a})\|.

4
max⁡∥u∥=1Duf(a)=∥∇f(a)∥\quad \max_{\|\mathbf{u}\|=1} D_{\mathbf{u}}f(\mathbf{a}) = \|\nabla f(\mathbf{a})\|

Derivation hint: From [3], Duf=∥∇f∥ ∥u∥cos⁡θ=∥∇f∥cos⁡θD_{\mathbf{u}}f=\|\nabla f\|\,\|\mathbf{u}\|\cos\theta=\|\nabla f\|\cos\theta; this is maximized at θ=0\theta=0. 2. ∇f(a)\nabla f(\mathbf{a}) is orthogonal to the level set {f=f(a)}\{f=f(\mathbf{a})\} at a\mathbf{a}.

5
∇f(a)⋅v=0for every tangent vector v to the level set at a\quad \nabla f(\mathbf{a})\cdot \mathbf{v} = 0 \quad \text{for every tangent vector } \mathbf{v} \text{ to the level set at } \mathbf{a}

Derivation hint: Parametrize a curve r(t)\mathbf{r}(t) lying in the level set, so f(r(t))=cf(\mathbf{r}(t))=c; differentiate using the chain rule to get ∇f⋅r′(t)=0\nabla f\cdot \mathbf{r}'(t)=0.

Why It Holds / Derivation

ProofGradient gives directional derivative and steepest ascent

Step 1 — Reduce to one variable. Fix a\mathbf{a} and a unit direction u=(u1,…,un)\mathbf{u}=(u_1,\dots,u_n). Define ϕ(h)=f(a+hu)\phi(h)=f(\mathbf{a}+h\mathbf{u}), a function of the single real variable hh.

Step 2 — Apply the multivariable chain rule. If ff is differentiable at a\mathbf{a}, then

6
ϕ′(0)=∑i=1n∂f∂xi(a) d(ai+hui)dh∣h=0=∑i=1n∂f∂xi(a) ui.\quad \phi'(0)=\sum_{i=1}^n \frac{\partial f}{\partial x_i}(\mathbf{a})\,\frac{d(a_i+hu_i)}{dh}\Big|_{h=0}=\sum_{i=1}^n \frac{\partial f}{\partial x_i}(\mathbf{a})\,u_i.

Derivation hint: The components of a+hu\mathbf{a}+h\mathbf{u} are ai+huia_i+hu_i with derivative uiu_i; sum the chain-rule contributions.

Step 3 — Recognize the dot product. The sum in [6] is precisely ∇f(a)⋅u\nabla f(\mathbf{a})\cdot\mathbf{u}, establishing [3].

Step 4 — Maximize over directions. Write the dot product as

7
∇f(a)⋅u=∥∇f(a)∥cos⁡θ,\quad \nabla f(\mathbf{a})\cdot\mathbf{u}=\|\nabla f(\mathbf{a})\|\cos\theta,

Derivation hint: Use the geometric definition of dot product with ∥u∥=1\|\mathbf{u}\|=1; θ\theta is the angle between ∇f\nabla f and u\mathbf{u}. where θ\theta is the angle between ∇f(a)\nabla f(\mathbf{a}) and u\mathbf{u}. Since cos⁡θ∈[−1,1]\cos\theta\in[-1,1], the maximum ∥∇f(a)∥\|\nabla f(\mathbf{a})\| occurs at θ=0\theta=0 (steepest ascent) and the minimum −∥∇f(a)∥-\|\nabla f(\mathbf{a})\| at θ=π\theta=\pi (steepest descent). This proves [4]. The orthogonality claim [5] follows because tangent directions to the level set correspond to θ=π/2\theta=\pi/2 where the directional derivative vanishes. ■\blacksquare

∎
⚠️ Differentiability is required, not just existence of partials

Equations [3]–[5] assume ff is differentiable at a\mathbf{a}, meaning ff admits a good linear approximation. The mere existence of all partial derivatives does not guarantee differentiability, and in such pathological cases the formula Duf=∇f⋅uD_{\mathbf{u}}f=\nabla f\cdot\mathbf{u} can fail. A standard sufficient condition: if all partials exist and are continuous in a neighborhood of a\mathbf{a} (i.e. f∈C1f\in C^1), then ff is differentiable there.

CG
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 Rn\mathbb{R}^n.

Building Intuition

🧠 Intuition

Picture f(x,y)f(x,y) as the elevation of a mountainous terrain over a map. A partial derivative ∂f/∂x\partial f/\partial x 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.

Figure
Gradient vector perpendicular to level curves, pointing toward steepest ascent
a ∇f tangent Level curves f = c ∇f ⊥ level set, points to steepest increase

Worked Examples

ExampleGradient of a paraboloid and steepest ascent

Given: f(x,y)=x2+3y2f(x,y)=x^2+3y^2, evaluate at a=(2,1)\mathbf{a}=(2,1). Find ∇f\nabla f, the steepest-ascent direction, and the directional derivative toward u=15(1,2)\mathbf{u}=\tfrac{1}{\sqrt 5}(1,2).

Step 1 — Partial derivatives.

8
∂f∂x=2x,∂f∂y=6y.\quad \frac{\partial f}{\partial x}=2x,\qquad \frac{\partial f}{\partial y}=6y.

Derivation hint: Treat yy constant for ∂x\partial_x (so 3y23y^2 vanishes), and xx constant for ∂y\partial_y.

Step 2 — Gradient at the point. ∇f(2,1)=(2⋅2, 6⋅1)=(4,6).\nabla f(2,1)=(2\cdot 2,\,6\cdot 1)=(4,6).

Step 3 — Steepest ascent magnitude.

9
∥∇f(2,1)∥=42+62=52=213≈7.21.\quad \|\nabla f(2,1)\|=\sqrt{4^2+6^2}=\sqrt{52}=2\sqrt{13}\approx 7.21.

Derivation hint: Euclidean norm of (4,6)(4,6).

Step 4 — Directional derivative toward u\mathbf{u}.

10
Duf=(4,6)⋅15(1,2)=4+125=165≈7.16.\quad D_{\mathbf{u}}f=(4,6)\cdot\tfrac{1}{\sqrt5}(1,2)=\tfrac{4+12}{\sqrt5}=\tfrac{16}{\sqrt5}\approx 7.16.

Derivation hint: Dot product of gradient with the unit vector, per [3].

Answer: ∇f(2,1)=(4,6),  steepest slope=213≈7.21,  Duf≈7.16\boxed{\nabla f(2,1)=(4,6),\ \ \text{steepest slope}=2\sqrt{13}\approx 7.21,\ \ D_{\mathbf u}f\approx 7.16} (units: output-per-unit-length). The chosen u\mathbf{u} is nearly aligned with the steepest direction (4,6)/52≈(0.55,0.83)(4,6)/\sqrt{52}\approx(0.55,0.83), hence 7.16≈7.217.16\approx 7.21.

ExampleTemperature gradient — heat flux direction

Given: A metal plate has temperature T(x,y)=100−x2−2y2T(x,y)=100 - x^2 - 2y^2 (in °C, x,yx,y in cm). A bug sits at (3,2)(3,2). Which way is it coolest, and how fast does temperature drop there?

Step 1 — Gradient. ∇T=(−2x,−4y)\nabla T=(-2x,-4y), so ∇T(3,2)=(−6,−8).\nabla T(3,2)=(-6,-8). This points toward increasing temperature.

Step 2 — Coolest direction = negative gradient.

11
−∇T(3,2)=(6,8),unit form 110(6,8)=(0.6,0.8).\quad -\nabla T(3,2)=(6,8),\qquad \text{unit form }\tfrac{1}{10}(6,8)=(0.6,0.8).

Derivation hint: Steepest decrease is anti-parallel to the gradient; normalize (6,8)(6,8) whose norm is 1010.

Step 3 — Rate of decrease.

12
∥∇T(3,2)∥=(−6)2+(−8)2=100=10 °C/cm.\quad \|\nabla T(3,2)\|=\sqrt{(-6)^2+(-8)^2}=\sqrt{100}=10\ \text{°C/cm}.

Derivation hint: Norm of (−6,−8)(-6,-8).

Answer: Coolest direction (0.6,0.8), temperature falls at 10 °C/cm\boxed{\text{Coolest direction }(0.6,0.8),\ \text{temperature falls at }10\ \text{°C/cm}}. By Fourier's law, heat flux q=−k∇T\mathbf{q}=-k\nabla T flows in direction (6,8)(6,8), from hot toward cold.

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 ∇f\nabla f (gradient, input on a scalar field) with the divergence ∇⋅F\nabla\cdot\mathbf{F} or curl ∇×F\nabla\times\mathbf{F}, which act on vector fields and produce different objects.
  • Mixed partials need not be equal in pathological cases. Clairaut's theorem guarantees ∂xyf=∂yxf\partial_{xy}f=\partial_{yx}f only when those mixed partials are continuous.
  • Existence of partials ≠ continuity ≠ differentiability. All four properties (partials exist, continuity, differentiability, C1C^1) are genuinely distinct.
  • The dot-product formula Duf=∇f⋅uD_{\mathbf u}f=\nabla f\cdot\mathbf u requires u\mathbf u to be a unit vector; using a non-unit vector silently rescales the rate.
CounterexamplePartials exist but ff is not even continuous

Consider

13
f(x,y)={xyx2+y2,(x,y)≠(0,0)0,(x,y)=(0,0).\quad f(x,y)=\begin{cases}\dfrac{xy}{x^2+y^2}, & (x,y)\neq(0,0)\\[2mm] 0,& (x,y)=(0,0).\end{cases}

Derivation hint: Along y=mxy=mx, f=m1+m2f=\frac{m}{1+m^2} depends on mm, so the limit at the origin is path-dependent. Both partials exist at the origin: fx(0,0)=lim⁡h→0f(h,0)−0h=0f_x(0,0)=\lim_{h\to0}\frac{f(h,0)-0}{h}=0 and likewise fy(0,0)=0f_y(0,0)=0. Yet ff is not continuous at (0,0)(0,0) — approaching along y=xy=x gives f→12f\to\tfrac12, but along the axes f=0f=0. Hence the partials existing tells us nothing about continuity, let alone differentiability. The naive formula Duf=∇f⋅u=0D_{\mathbf u}f=\nabla f\cdot\mathbf u=0 would falsely predict zero change in every direction.

Connections

connection

The gradient is the transpose / vector form of the <span class="wiki-link-missing">Jacobian Matrix</span> for the special case of a scalar-valued function. It is the central ingredient of the Multivariable Chain Rule, which expresses ddtf(r(t))=∇f⋅r′(t)\tfrac{d}{dt}f(\mathbf r(t))=\nabla f\cdot \mathbf r'(t). It underlies the Method of Lagrange Multipliers, where constrained optima require ∇f=λ∇g\nabla f=\lambda\nabla g (gradients parallel). In vector calculus, ∇\nabla 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 ∇f=0\nabla f=\mathbf 0 defines Critical Points and the Second Derivative Test.

Real-World Applications

🔬 Where this appears

Historical Development

⏳ History
- 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 ("nabla") in connection with quaternions.
- 1873 — Maxwell employs and refines ∇\nabla notation in his Treatise on Electricity and Magnetism, including the gradient.
- 1880s — Gibbs and Heaviside develop modern vector calculus, cementing ∇f\nabla f, 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

open-problem

Several conceptual subtleties extend beyond the introductory picture. (1) Coordinate dependence: the naive component definition of ∇f\nabla f is correct only in orthonormal Cartesian coordinates; in curvilinear or non-Euclidean settings the gradient requires the metric tensor, (∇f)i=gij∂jf(\nabla f)^i = g^{ij}\partial_j f, distinguishing the gradient vector from the differential dfdf (a covector). This distinction — vectors versus covectors — is invisible in Rn\mathbb{R}^n with the standard metric but essential in differential geometry and general relativity. (2) Non-smoothness: for non-differentiable convex functions (e.g. ∥x∥1\|\mathbf x\|_1 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.

See Also

Jacobian Matrix · Directional Derivative · Total Differential · Hessian Matrix · Tangent Planes and Linear Approximation · Vector Fields