Directional Derivatives and Differentiability

⚡ Key Takeaways

Directional derivatives measure the instantaneous rate of change of a multivariable function along a chosen direction; differentiability is the stronger condition that the function is well-approximated by a linear map at a point. Key result: differentiability implies all directional derivatives exist and equals the gradient dotted with the direction — but the converse is FALSE. Applies across multivariable calculus, optimization, physics, and machine learning. Crystallized in the 19th century through Cauchy, Weierstrass, and Fréchet.

💡 The Core Insight

Existence of directional derivatives is a one-dimensional condition checked along each line separately. Differentiability is a genuinely multidimensional condition: it demands that ONE linear map approximates ff uniformly as you approach a\mathbf{a} from all directions at once. The gap between these — sequential 1D limits versus a single 2D/nD limit — is the source of nearly every subtlety on this page.

Formal Statement

DefinitionDirectional Derivative

Let f:Rn→Rf:\mathbb{R}^n \to \mathbb{R}, let a∈Rn\mathbf{a}\in\mathbb{R}^n, and let u∈Rn\mathbf{u}\in\mathbb{R}^n be a unit vector (∥u∥=1\|\mathbf{u}\|=1). The directional derivative of ff at a\mathbf{a} in the direction u\mathbf{u} is

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

Derivation hint: Restrict ff to the line g(h)=f(a+hu)g(h)=f(\mathbf{a}+h\mathbf{u}), then Duf(a)=g′(0)D_{\mathbf{u}}f(\mathbf{a})=g'(0) by the ordinary single-variable derivative definition. Here a=(a1,…,an)\mathbf{a}=(a_1,\dots,a_n) is the base point, u=(u1,…,un)\mathbf{u}=(u_1,\dots,u_n) the direction, and h∈Rh\in\mathbb{R} the scalar step. When u=ei\mathbf{u}=\mathbf{e}_i (the ii-th standard basis vector), Deif(a)D_{\mathbf{e}_i}f(\mathbf{a}) is the partial derivative ∂f/∂xi\partial f/\partial x_i.

⚠️ Common mistake

Some authors do not require u\mathbf{u} to be a unit vector. If u\mathbf{u} is unnormalized, DufD_{\mathbf{u}}f scales linearly with ∥u∥\|\mathbf{u}\|, and the geometric interpretation as "rate per unit distance" is lost. Always check your textbook's convention. This page uses unit vectors.

DefinitionDifferentiability (Fréchet)

f:Rn→Rf:\mathbb{R}^n\to\mathbb{R} is differentiable at a\mathbf{a} if there exists a linear map L:Rn→RL:\mathbb{R}^n\to\mathbb{R} (equivalently a vector ∇f(a)\nabla f(\mathbf{a})) such that

2
lim⁡h→0f(a+h)−f(a)−L(h)∥h∥=0\quad \lim_{\mathbf{h}\to\mathbf{0}}\frac{f(\mathbf{a}+\mathbf{h}) - f(\mathbf{a}) - L(\mathbf{h})}{\|\mathbf{h}\|} = 0

Derivation hint: This says the error of the linear approximation f(a)+L(h)f(\mathbf{a})+L(\mathbf{h}) vanishes faster than ∥h∥\|\mathbf{h}\|; it is the multivariable analogue of f(a+h)=f(a)+f′(a)h+o(h)f(a+h)=f(a)+f'(a)h+o(h). The linear map LL is the (total) derivative Df(a)Df(\mathbf{a}), and the vector representing it is the gradient ∇f(a)=(∂f∂x1,…,∂f∂xn)\nabla f(\mathbf{a})=\left(\frac{\partial f}{\partial x_1},\dots,\frac{\partial f}{\partial x_n}\right), so that L(h)=∇f(a)⋅hL(\mathbf{h})=\nabla f(\mathbf{a})\cdot\mathbf{h}.

TheoremGradient Formula for Directional Derivatives

If ff is differentiable at a\mathbf{a}, then every directional derivative exists and is given by

3
Duf(a)=∇f(a)⋅u=∑i=1n∂f∂xi(a) ui\quad D_{\mathbf{u}}f(\mathbf{a}) = \nabla f(\mathbf{a})\cdot\mathbf{u} = \sum_{i=1}^{n}\frac{\partial f}{\partial x_i}(\mathbf{a})\,u_i

Derivation hint: Set h=hu\mathbf{h}=h\mathbf{u} in equation [2], divide by hh, and take h→0h\to 0; the o(∥h∥)o(\|\mathbf{h}\|) term vanishes because ∥h∥=∣h∣\|\mathbf{h}\|=|h|.

TheoremContinuity from Differentiability

If ff is differentiable at a\mathbf{a}, then ff is continuous at a\mathbf{a}.

4
lim⁡h→0f(a+h)=f(a)\quad \lim_{\mathbf{h}\to\mathbf{0}} f(\mathbf{a}+\mathbf{h}) = f(\mathbf{a})

Derivation hint: From [2], f(a+h)−f(a)=L(h)+o(∥h∥)f(\mathbf{a}+\mathbf{h})-f(\mathbf{a}) = L(\mathbf{h}) + o(\|\mathbf{h}\|); both terms →0\to 0 as h→0\mathbf{h}\to\mathbf{0} since LL is linear hence continuous.

TheoremDirection of Steepest Ascent

Among all unit directions u\mathbf{u}, the directional derivative Duf(a)D_{\mathbf{u}}f(\mathbf{a}) is maximized when u\mathbf{u} points along ∇f(a)\nabla f(\mathbf{a}), with maximum value ∥∇f(a)∥\|\nabla f(\mathbf{a})\|.

5
max⁡∥u∥=1Duf(a)=∥∇f(a)∥,attained at u=∇f(a)∥∇f(a)∥\quad \max_{\|\mathbf{u}\|=1} D_{\mathbf{u}}f(\mathbf{a}) = \|\nabla f(\mathbf{a})\|, \quad \text{attained at } \mathbf{u}=\frac{\nabla f(\mathbf{a})}{\|\nabla f(\mathbf{a})\|}

Derivation hint: By [3] and Cauchy–Schwarz, ∇f⋅u=∥∇f∥ ∥u∥cos⁡θ=∥∇f∥cos⁡θ\nabla f\cdot\mathbf{u} = \|\nabla f\|\,\|\mathbf{u}\|\cos\theta = \|\nabla f\|\cos\theta, maximized at θ=0\theta=0.

Why It Holds / Derivation

ProofDifferentiability ⟹ Gradient Formula (Equation 3)

We prove that differentiability at a\mathbf{a} forces Duf(a)=∇f(a)⋅uD_{\mathbf{u}}f(\mathbf{a})=\nabla f(\mathbf{a})\cdot\mathbf{u} for every unit u\mathbf{u}.

Step 1. By definition [2], write the remainder as

r(h)=f(a+h)−f(a)−∇f(a)⋅h,r(\mathbf{h}) = f(\mathbf{a}+\mathbf{h}) - f(\mathbf{a}) - \nabla f(\mathbf{a})\cdot\mathbf{h},

with the property r(h)/∥h∥→0r(\mathbf{h})/\|\mathbf{h}\| \to 0 as h→0\mathbf{h}\to\mathbf{0}.

Step 2. Specialize to h=hu\mathbf{h}=h\mathbf{u} with h∈Rh\in\mathbb{R}, h≠0h\neq 0. Since ∥u∥=1\|\mathbf{u}\|=1, we have ∥h∥=∣h∣\|\mathbf{h}\|=|h|. Then

f(a+hu)−f(a)=∇f(a)⋅(hu)+r(hu)=h (∇f(a)⋅u)+r(hu).f(\mathbf{a}+h\mathbf{u}) - f(\mathbf{a}) = \nabla f(\mathbf{a})\cdot(h\mathbf{u}) + r(h\mathbf{u}) = h\,\big(\nabla f(\mathbf{a})\cdot\mathbf{u}\big) + r(h\mathbf{u}).

Step 3. Divide by hh:

f(a+hu)−f(a)h=∇f(a)⋅u+r(hu)h.\frac{f(\mathbf{a}+h\mathbf{u}) - f(\mathbf{a})}{h} = \nabla f(\mathbf{a})\cdot\mathbf{u} + \frac{r(h\mathbf{u})}{h}.

Step 4. Estimate the remainder term. Since ∣h∣=∥hu∥|h|=\|h\mathbf{u}\|,

∣r(hu)h∣=∣r(hu)∣∥hu∥→  h→0  0\left|\frac{r(h\mathbf{u})}{h}\right| = \frac{|r(h\mathbf{u})|}{\|h\mathbf{u}\|} \xrightarrow{\;h\to 0\;} 0

by the defining property of rr in Step 1.

Step 5. Taking h→0h\to 0 in Step 3 yields the limit Duf(a)=∇f(a)⋅uD_{\mathbf{u}}f(\mathbf{a}) = \nabla f(\mathbf{a})\cdot\mathbf{u}, which is equation [3]. ■\blacksquare

∎
TheoremSufficient Condition for Differentiability

If all partial derivatives ∂f/∂xi\partial f/\partial x_i exist in a neighborhood of a\mathbf{a} and are continuous at a\mathbf{a}, then ff is differentiable at a\mathbf{a}. (Such ff is called continuously differentiable, or C1C^1.)

ProofSketch: Continuous Partials ⟹ Differentiable (n=2)

Step 1. Write the increment as a telescoping sum, changing one coordinate at a time:

f(a1+h1,a2+h2)−f(a1,a2)=[f(a1+h1,a2+h2)−f(a1,a2+h2)]+[f(a1,a2+h2)−f(a1,a2)].f(a_1+h_1, a_2+h_2) - f(a_1,a_2) = \big[f(a_1+h_1,a_2+h_2)-f(a_1,a_2+h_2)\big] + \big[f(a_1,a_2+h_2)-f(a_1,a_2)\big].

Step 2. Apply the single-variable Mean Value Theorem to each bracket. There exist ξ1\xi_1 between a1a_1 and a1+h1a_1+h_1, and ξ2\xi_2 between a2a_2 and a2+h2a_2+h_2, with

=∂f∂x1(ξ1,a2+h2) h1+∂f∂x2(a1,ξ2) h2.= \frac{\partial f}{\partial x_1}(\xi_1, a_2+h_2)\,h_1 + \frac{\partial f}{\partial x_2}(a_1, \xi_2)\,h_2.

Step 3. Use continuity of the partials: as h→0\mathbf{h}\to\mathbf{0}, the evaluation points approach a\mathbf{a}, so

∂f∂xi(point)=∂f∂xi(a)+εi(h),εi(h)→0.\frac{\partial f}{\partial x_i}(\text{point}) = \frac{\partial f}{\partial x_i}(\mathbf{a}) + \varepsilon_i(\mathbf{h}),\quad \varepsilon_i(\mathbf{h})\to 0.

Step 4. Substitute: the increment equals ∇f(a)⋅h+ε1h1+ε2h2\nabla f(\mathbf{a})\cdot\mathbf{h} + \varepsilon_1 h_1 + \varepsilon_2 h_2. The error term satisfies

∣ε1h1+ε2h2∣∥h∥≤∣ε1∣+∣ε2∣→0,\frac{|\varepsilon_1 h_1 + \varepsilon_2 h_2|}{\|\mathbf{h}\|} \le |\varepsilon_1| + |\varepsilon_2| \to 0,

verifying [2]. ■\blacksquare

∎
mathematician · Maurice Fréchet | 1878–1973

The French mathematician Maurice Fréchet gave the modern, rigorous definition of differentiability in normed and metric spaces (1911), generalizing the classical multivariable derivative to infinite-dimensional settings. The "Fréchet derivative" of equation [2] is now the standard definition. Fréchet also pioneered abstract metric spaces and functional analysis, providing the language in which "differentiability as approximation by a bounded linear operator" became precise. His framework distinguishes the strong (Fréchet) derivative from the weaker Gâteaux derivative, which is exactly the directional-derivative notion lifted to function spaces — making this very page's central tension a foundational theme of modern analysis.

Building Intuition

🧠 Intuition

Imagine standing on a hillside whose height is f(x,y)f(x,y). A directional derivative is the slope you feel if you start walking in a fixed compass direction u\mathbf{u} — steepness measured along that one path. There are infinitely many such slopes, one per direction.

Differentiability is a much stronger claim: it says the hillside near your feet looks like a flat tilted plane (the tangent plane). If that's true, then every walking-direction's slope is just the projection of one master arrow — the gradient — onto your direction. The gradient points "straight uphill," and its length is the steepest possible slope. The crucial subtlety: a surface can have a well-defined slope along every straight-line path through a point and yet still be crinkled, creased, or torn there — so no single tangent plane fits. Directional derivatives only probe along straight lines; differentiability demands good behavior along every approach, including curved and oscillating ones. That's why all directional derivatives existing is not enough.

Figure
Gradient and directional derivatives on a level-set map. The gradient is perpendicular to level curves and gives the steepest slope; a directional derivative projects it onto a chosen direction.

```svg

Level curves f = const a ∇f(a) (steepest) u θ D_u f(a) = ∇f(a)·u = |∇f| cos θ

```

Worked Examples

ExampleExample 1 — Computing a Directional Derivative

Given: f(x,y)=x2y+3y2f(x,y) = x^2 y + 3y^2 at the point a=(1,2)\mathbf{a}=(1,2), in the direction of v=(3,4)\mathbf{v}=(3,4).

Step 1 — Normalize the direction. ∥v∥=32+42=5\|\mathbf{v}\|=\sqrt{3^2+4^2}=5, so u=(35,45)\mathbf{u}=\left(\tfrac{3}{5},\tfrac{4}{5}\right).

Step 2 — Compute the gradient.

∂f∂x=2xy,∂f∂y=x2+6y.\frac{\partial f}{\partial x}=2xy,\qquad \frac{\partial f}{\partial y}=x^2+6y.

At (1,2)(1,2): ∂f/∂x=2(1)(2)=4\partial f/\partial x = 2(1)(2)=4 and ∂f/∂y=12+6(2)=13\partial f/\partial y = 1^2+6(2)=13. So ∇f(1,2)=(4,13)\nabla f(1,2)=(4,13).

Step 3 — Apply equation [3].

Duf(1,2)=∇f⋅u=4⋅35+13⋅45=125+525=645.D_{\mathbf{u}}f(1,2)=\nabla f\cdot\mathbf{u} = 4\cdot\tfrac{3}{5} + 13\cdot\tfrac{4}{5} = \tfrac{12}{5}+\tfrac{52}{5}=\tfrac{64}{5}.

(Since ff is a polynomial, it is C1C^1 everywhere, so equation [3] is valid.)

Answer:

Duf(1,2)=645=12.8 (units of f per unit length)\boxed{D_{\mathbf{u}}f(1,2) = \frac{64}{5} = 12.8 \ \text{(units of } f \text{ per unit length)}}
ExampleExample 2 — Steepest Ascent and a Temperature Field

Given: A metal plate has temperature T(x,y)=100−x2−2y2T(x,y)=100 - x^2 - 2y^2 (°C), with x,yx,y in centimeters. Find the direction of fastest temperature increase at (2,1)(2,1) and the maximum rate.

Step 1 — Gradient.

∂T∂x=−2x,∂T∂y=−4y  ⇒  ∇T(2,1)=(−4,−4).\frac{\partial T}{\partial x}=-2x,\qquad \frac{\partial T}{\partial y}=-4y \;\Rightarrow\; \nabla T(2,1)=(-4,-4).

Step 2 — Direction of steepest ascent (equation [5]) is along ∇T\nabla T:

u=(−4,−4)∥(−4,−4)∥=(−4,−4)42=(−12,−12).\mathbf{u}=\frac{(-4,-4)}{\|(-4,-4)\|}=\frac{(-4,-4)}{4\sqrt 2}=\left(-\tfrac{1}{\sqrt 2}, -\tfrac{1}{\sqrt 2}\right).

Step 3 — Maximum rate is ∥∇T∥\|\nabla T\|:

∥∇T(2,1)∥=(−4)2+(−4)2=32=42≈5.66.\|\nabla T(2,1)\|=\sqrt{(-4)^2+(-4)^2}=\sqrt{32}=4\sqrt 2 \approx 5.66.

Answer:

Steepest ascent toward (−12,−12),rate =42≈5.66 °Ccm\boxed{\text{Steepest ascent toward } \left(-\tfrac{1}{\sqrt2},-\tfrac{1}{\sqrt2}\right),\quad \text{rate } = 4\sqrt2 \approx 5.66\ \tfrac{\text{°C}}{\text{cm}}}

Heat flows opposite to this, along (12,12)\left(\tfrac{1}{\sqrt2},\tfrac{1}{\sqrt2}\right) (down the gradient).

Common Misconceptions

⚠️ Common mistake

"If all partial derivatives exist, the function is differentiable." FALSE. Partials only probe the coordinate-axis directions. "If all directional derivatives exist (in every direction), the function is differentiable." ALSO FALSE — and even worse, such a function need not be continuous. Differentiability requires the single 2D limit [2] to vanish, which is strictly stronger than the existence of any collection of 1D limits. The correct sufficient condition is continuous partial derivatives (C1C^1), not mere existence.

CounterexampleDirectional Derivatives Exist Everywhere, Yet Not Differentiable / Not Continuous

Define

f(x,y)={x2yx4+y2,(x,y)≠(0,0),0,(x,y)=(0,0).f(x,y) = \begin{cases} \dfrac{x^2 y}{x^4 + y^2}, & (x,y)\neq(0,0),\\[6pt] 0, & (x,y)=(0,0). \end{cases}

Directional derivatives all exist at the origin. For a unit direction u=(a,b)\mathbf{u}=(a,b) with b≠0b\neq 0:

Duf(0,0)=lim⁡h→01h⋅(ha)2(hb)(ha)4+(hb)2=lim⁡h→0a2b h3h2(h2a4+b2)=a2bb2=a2b.D_{\mathbf{u}}f(0,0)=\lim_{h\to0}\frac{1}{h}\cdot\frac{(ha)^2(hb)}{(ha)^4+(hb)^2} = \lim_{h\to0}\frac{a^2 b\,h^3}{h^2(h^2 a^4 + b^2)} = \frac{a^2 b}{b^2}=\frac{a^2}{b}.

For b=0b=0 (the xx-axis), f(h,0)=0f(h,0)=0, so Duf(0,0)=0D_{\mathbf{u}}f(0,0)=0. Every directional derivative exists.

But ff is not even continuous at the origin. Approach along the parabola y=x2y=x^2:

f(x,x2)=x2⋅x2x4+x4=x42x4=12≠0=f(0,0).f(x,x^2)=\frac{x^2\cdot x^2}{x^4 + x^4}=\frac{x^4}{2x^4}=\frac12 \neq 0 = f(0,0).

The limit depends on the path, so ff is discontinuous — hence (by equation [4]) not differentiable, despite all directional derivatives existing.

Moral: the directional derivatives, even if they existed and satisfied Duf=∇f⋅uD_{\mathbf{u}}f = \nabla f\cdot\mathbf{u}, would not guarantee differentiability. Straight-line probing misses the parabolic ridge.

CounterexamplePartials Exist but Function is Discontinuous

A simpler classic:

g(x,y)={xyx2+y2,(x,y)≠(0,0),0,(x,y)=(0,0).g(x,y) = \begin{cases} \dfrac{xy}{x^2+y^2}, & (x,y)\neq(0,0),\\ 0, & (x,y)=(0,0). \end{cases}

Both partials exist at the origin (g(x,0)=g(0,y)=0g(x,0)=g(0,y)=0, so gx(0,0)=gy(0,0)=0g_x(0,0)=g_y(0,0)=0), yet g(t,t)=12→12≠0g(t,t)=\tfrac{1}{2}\to\tfrac12\neq 0 along y=xy=x. So gg is discontinuous, hence not differentiable, even though both partials exist. Existence of partials says nothing about differentiability.

Connections

connection

Directional derivatives and differentiability sit at the hub of multivariable analysis. The gradient they define is the workhorse of Gradient Descent in optimization and machine learning. Equation [3] is the seed of the Multivariable Chain Rule, which expresses ddtf(r(t))=∇f⋅r′(t)\frac{d}{dt}f(\mathbf{r}(t)) = \nabla f\cdot\mathbf{r}'(t) — a directional derivative along a curve. The condition [2] generalizes directly to the Total Derivative (Jacobian) for vector-valued maps Rn→Rm\mathbb{R}^n\to\mathbb{R}^m, and onward to the Fréchet Derivative in Banach spaces, where the directional version becomes the Gâteaux Derivative. Geometrically, the vanishing of all directional derivatives at an interior extremum gives the first-order condition ∇f=0\nabla f=\mathbf{0}, linking to Lagrange Multipliers and critical-point theory. The orthogonality of ∇f\nabla f to level sets connects to Tangent Planes and Linear Approximation and the Implicit Function Theorem.

Real-World Applications

🔬 Where this appears

Historical Development

⏳ History
- 1797 — Lagrange: Théorie des fonctions analytiques develops partial derivatives systematically and introduces the notation f′f', treating derivatives as coefficients of Taylor expansions.
- 1821 — Cauchy: Cours d'analyse puts limits and continuity on rigorous footing, giving the modern definition of the derivative via difference quotients — the basis of equation [1].
- 1840s–1870s — Weierstrass: The ε\varepsilon–δ\delta formulation of limits makes precise what "approximation to first order" means, enabling the rigorous remainder condition [2]; his pathological functions warn against naive intuition.
- 1873 — Hamilton & the nabla: The operator ∇\nabla, introduced by Hamilton and popularized by Tait, gives the gradient its modern symbol and vector-calculus identity.
- 1881 — Gibbs & Heaviside: Develop vector analysis as we know it, formalizing ∇f\nabla f, dot products, and the directional-derivative formula [3] for physics applications.
- 1887 — Peano: Provides explicit counterexamples showing existence of partials does not imply differentiability or continuity, sharpening the conceptual distinction.
- 1911–1925 — Fréchet: Defines the (strong) derivative for general normed spaces via condition [2], establishing the modern abstract notion of differentiability.
- 1913 — Gâteaux: Introduces the weaker directional-derivative-style derivative in function spaces, posthumously named the Gâteaux derivative, formalizing the directional vs. total distinction at the highest level.
- 20th century — optimization era: Cauchy's steepest-descent idea (1847) blossoms into modern numerical optimization and, ultimately, deep-learning training.

Subtleties & Limits

open-problem

Several deep issues hover around this seemingly elementary topic. (1) The gap between Gâteaux and Fréchet differentiability is enormous in infinite dimensions: a functional can be Gâteaux-differentiable everywhere yet Fréchet-differentiable nowhere, and characterizing where Lipschitz functions on Banach spaces are differentiable is the subject of deep results (Preiss's theorem, 1990) and still-open questions in the geometry of Banach spaces. (2) Differentiability of Lipschitz functions: Rademacher's theorem guarantees a Lipschitz f:Rn→Rf:\mathbb{R}^n\to\mathbb{R} is differentiable almost everywhere, but the structure of the (measure-zero) non-differentiability set is subtle — related to open problems on "universal differentiability sets." (3) Weak derivatives and Sobolev spaces replace pointwise directional derivatives with distributional ones, the foundation of modern PDE theory, where "differentiability" is reinterpreted entirely. (4) Even in finite dimensions, finding clean necessary-and-sufficient pointwise conditions for differentiability (beyond the sufficient C1C^1 criterion) remains genuinely delicate; existence of all directional derivatives plus continuity still does not suffice in general.

See Also

Gradient · Jacobian Matrix · Lagrange Multipliers · Implicit Function Theorem · Fréchet Derivative · Gâteaux Derivative · Level Sets and Contours · Directional Derivative in Differential Geometry