= Directional derivative
{title2=$D_vf$}
{wiki}
The <directional derivative> tests a <function> along a chosen <straight line>, including lines that follow neither coordinate axis. For a fixed <vector> $v$ and a point $a$ in an <open subset> of $\mathbb R^n$, define
$$
D_vf(a)=\lim_{t\to0}\frac{f(a+tv)-f(a)}{t}
=\left.\frac d{dt}f(a+tv)\right|_{t=0},
$$
if the <limit> exists. With a <unit vector> $v$, the parameter $t$ measures signed distance in the input <Euclidean space>, so the <directional derivative> is change per unit distance. For a general $v$, it is change per unit parameter; the <norm> of $v$ also sets the rate of travel.<Calculus Volume 3 by Gilbert Strang and others/4.6 Directional Derivatives and the Gradient>[Calculus Volume 3, §4.6, definition (4.36), unit-direction convention]{ref}
For a <differentiable> real-valued <function>, the <multivariable chain rule> gives
$$
D_vf(a)=\nabla f(a)\cdot v.
$$
Thus one <gradient> predicts the local response in every direction. This formula requires <differentiability>, rather than merely separate <partial derivatives>.<Calculus Volume 3 by Gilbert Strang and others/4.6 Directional Derivatives and the Gradient>[Calculus Volume 3, §4.6, Theorem 4.12 and the gradient formulation]{ref}
Return to $f(x,y)=x^2+xy+2y^2$ at $a=(1,1)$. Its <gradient> is $(3,5)$. In the <unit direction> $u=(3/5,4/5)$,
$$
D_uf(a)=3\frac35+5\frac45=\boxed{\frac{29}{5}}.
$$
One can check this without invoking the <gradient> formula: substitution gives
$$
f\left(1+\frac35t,1+\frac45t\right)
=4+\frac{29}{5}t+\frac{53}{25}t^2.
$$
The <difference quotient> is $29/5+(53/25)t$, whose <limit> is $29/5$. This calculation separates the exact change along a finite path from its first-order rate at the starting point.
Changing the travel speed changes the parameter rate. Taking $v=(3,4)=5u$ gives $D_vf(a)=29$, because the input travels five distance units per parameter unit. For a <differentiable function>, $D_{cv}f(a)=cD_vf(a)$ for any real $c$: negative $c$ reverses the orientation as well as scaling the rate. Normalizing $v$ before comparing different slopes avoids confusing direction with speed.
\Image[/directional-derivative-angle-and-local-change.png]
{title=<Directional derivatives> compare directions; a <total differential> predicts small finite changes}
{description=Left: for $f=x^2+xy+2y^2$ at $(1,1)$, the rate in the <unit direction> $(\cos\theta,\sin\theta)$ is $3\cos\theta+5\sin\theta$. Right: along the displacement $s(0.02,-0.01)$, the exact height change is $0.01s+0.0004s^2$, compared with its <linear approximation> $0.01s$. All curves are exact calculations for the example, rather than measured data.}
The <Cauchy-Schwarz inequality> bounds the rate in any <unit direction> by $\|\nabla f(a)\|$. Here the largest rate is $\sqrt{34}\approx5.831$, attained in the direction $(3,5)/\sqrt{34}$; the chosen $(3/5,4/5)$ gives the slightly smaller rate $5.8$. The perpendicular <unit direction> $(-5,3)/\sqrt{34}$ gives zero. That means no first-order height change, rather than no change at all: along this direction the example has $f(a+tu)=4+(28/34)t^2$.
This is useful for following a height or <temperature> <scalar field>, choosing a local search direction in <mathematical optimization>, and distinguishing a coordinate sensitivity from a response along an actual path. For a curved path, <derivative along a curve> uses its instantaneous <tangent vector>. Even existence of all <directional derivatives> does not guarantee one common <linear approximation>; <directional derivatives do not imply differentiability> gives a concrete counterexample.
Back to article page