◀ Back to Note

Tony's Intertwingled Memex • Reference Manual

Directional Derivatives

Formulas & Definitions
Core Definition

Let fff be a differentiable function of two or three variables at a point PPP, and let u⃗\vec{u}u be a unit vector (∥u⃗∥=1\|\vec{u}\| = 1∥u∥=1). The directional derivative of fff at PPP in the direction of u⃗\vec{u}u, denoted by Du⃗f(P)D_{\vec{u}} f(P)Du​f(P), is defined as the limit:

Du⃗f(P)=lim⁡h→0f(P+hu⃗)−f(P)hD_{\vec{u}} f(P) = \lim_{h \to 0} \frac{f(P + h\vec{u}) - f(P)}{h}Du​f(P)=h→0lim​hf(P+hu)−f(P)​

By the Gradient Theorem for Directional Derivatives, if fff is differentiable, this limit can be computed directly using the vector dot product of the gradient ∇f\nabla f∇f and the unit vector u⃗\vec{u}u:

  1. Two Variables (f(x,y)f(x, y)f(x,y) with u⃗=⟨u1,u2⟩\vec{u} = \langle u_1, u_2 \rangleu=⟨u1​,u2​⟩):

    Du⃗f(x,y)=∇f(x,y)⋅u⃗=fx(x,y)u1+fy(x,y)u2D_{\vec{u}} f(x, y) = \nabla f(x, y) \cdot \vec{u} = f_x(x, y)u_1 + f_y(x, y)u_2Du​f(x,y)=∇f(x,y)⋅u=fx​(x,y)u1​+fy​(x,y)u2​

  2. Three Variables (f(x,y,z)f(x, y, z)f(x,y,z) with u⃗=⟨u1,u2,u3⟩\vec{u} = \langle u_1, u_2, u_3 \rangleu=⟨u1​,u2​,u3​⟩):

    Du⃗f(x,y,z)=∇f(x,y,z)⋅u⃗=fxu1+fyu2+fzu3D_{\vec{u}} f(x, y, z) = \nabla f(x, y, z) \cdot \vec{u} = f_x u_1 + f_y u_2 + f_z u_3Du​f(x,y,z)=∇f(x,y,z)⋅u=fx​u1​+fy​u2​+fz​u3​

The output Du⃗fD_{\vec{u}} fDu​f is always a scalar quantity representing the instantaneous rate of change of fff per unit distance traveled in the specific direction of u⃗\vec{u}u.


Concept Explanation

Bridging from Partial Derivatives to Arbitrary Directions

Partial derivatives fxf_xfx​ and fyf_yfy​ measure the instantaneous rate of change of z=f(x,y)z = f(x, y)z=f(x,y) strictly parallel to the coordinate axes:

  • fx=Di^f=∇f⋅⟨1,0⟩f_x = D_{\hat{i}} f = \nabla f \cdot \langle 1, 0 \ranglefx​=Di^​f=∇f⋅⟨1,0⟩ (moving due East)
  • fy=Dj^f=∇f⋅⟨0,1⟩f_y = D_{\hat{j}} f = \nabla f \cdot \langle 0, 1 \ranglefy​=Dj^​​f=∇f⋅⟨0,1⟩ (moving due North)

In practical engineering applications, observers, vehicles, fluid streams, and structural loads rarely move parallel to grid axes. The directional derivative Du⃗fD_{\vec{u}} fDu​f generalizes differentiation to any arbitrary compass heading or 3D spatial trajectory:

                  ^ y
                  |           ^ u = <cos(theta), sin(theta)>
                  |          /
                  |         /  (Heading direction)
                  |        /
                  |       * P(x_0, y_0)
                  |        \
                  |         \  grad f (Steepest ascent)
                  +----------> x

The Mandatory Unit Vector Normalization Rule

The dot product formula Du⃗f=∇f⋅u⃗D_{\vec{u}} f = \nabla f \cdot \vec{u}Du​f=∇f⋅u strictly requires that the direction vector is a unit vector (∥u⃗∥=1\|\vec{u}\| = 1∥u∥=1).

  • If a problem specifies direction via an arbitrary non-unit vector v⃗\vec{v}v (where ∥v⃗∥≠1\|\vec{v}\| \neq 1∥v∥=1), you must normalize it first:
    u⃗=v⃗∥v⃗∥=⟨v1,v2⟩v12+v22\vec{u} = \frac{\vec{v}}{\|\vec{v}\|} = \frac{\langle v_1, v_2 \rangle}{\sqrt{v_1^2 + v_2^2}}u=∥v∥v​=v12​+v22​​⟨v1​,v2​⟩​
  • If direction is specified as moving from point PPP toward a destination point QQQ, compute the displacement vector PQ→=Q−P\overrightarrow{PQ} = Q - PPQ​=Q−P and normalize it:
    u⃗=PQ→∥PQ→∥\vec{u} = \frac{\overrightarrow{PQ}}{\|\overrightarrow{PQ}\|}u=∥PQ​∥PQ​​
Pitfall Warning

Computing ∇f⋅v⃗\nabla f \cdot \vec{v}∇f⋅v with an unnormalized vector scales your result by ∥v⃗∥\|\vec{v}\|∥v∥. This yields an incorrect rate of change with distorted units.

Angle Parameterization in 2D

In two dimensions, any unit vector u⃗\vec{u}u making an angle θ\thetaθ measured counterclockwise from the positive xxx-axis can be written as:

u⃗=⟨cos⁡θ, sin⁡θ⟩\vec{u} = \langle \cos\theta, \, \sin\theta \rangleu=⟨cosθ,sinθ⟩
Substituting into the directional derivative formula gives:
Du⃗f(x,y)=fx(x,y)cos⁡θ+fy(x,y)sin⁡θD_{\vec{u}} f(x, y) = f_x(x, y)\cos\theta + f_y(x, y)\sin\thetaDu​f(x,y)=fx​(x,y)cosθ+fy​(x,y)sinθ

Geometric Interpretation via the Dot Product Angle Formula

From the geometric definition of the dot product:

Du⃗f=∇f⋅u⃗=∥∇f∥∥u⃗∥cos⁡ϕ=∥∇f∥cos⁡ϕD_{\vec{u}} f = \nabla f \cdot \vec{u} = \|\nabla f\| \|\vec{u}\| \cos\phi = \|\nabla f\|\cos\phiDu​f=∇f⋅u=∥∇f∥∥u∥cosϕ=∥∇f∥cosϕ
where ϕ\phiϕ is the angle between the gradient vector ∇f\nabla f∇f and the direction vector u⃗\vec{u}u. Because −1≤cos⁡ϕ≤1-1 \le \cos\phi \le 1−1≤cosϕ≤1:

  1. Maximum Rate of Increase (ϕ=0\phi = 0ϕ=0): When u⃗\vec{u}u points in the same direction as ∇f\nabla f∇f, cos⁡(0)=1\cos(0) = 1cos(0)=1, yielding Du⃗f=∥∇f∥D_{\vec{u}} f = \|\nabla f\|Du​f=∥∇f∥.
  2. Maximum Rate of Decrease (ϕ=π\phi = \piϕ=π): When u⃗\vec{u}u points opposite to ∇f\nabla f∇f, cos⁡(π)=−1\cos(\pi) = -1cos(π)=−1, yielding Du⃗f=−∥∇f∥D_{\vec{u}} f = -\|\nabla f\|Du​f=−∥∇f∥.
  3. Zero Rate of Change (ϕ=π/2\phi = \pi/2ϕ=π/2 or 3π/23\pi/23π/2): When u⃗\vec{u}u is orthogonal to ∇f\nabla f∇f, cos⁡(π/2)=0\cos(\pi/2) = 0cos(π/2)=0, yielding Du⃗f=0D_{\vec{u}} f = 0Du​f=0 (moving tangent to a level curve).

Engineering Applications

  • Civil & Transportation Engineering: Roadway design engineers calculate ground grades along angled road cuts using directional derivatives. If a proposed highway alignment vector u⃗\vec{u}u yields a slope Du⃗hD_{\vec{u}} hDu​h exceeding federal grade standards (e.g., 6%6\%6%), the alignment must be modified.
  • Entertainment Engineering & Lighting Design: Lighting designers model stage illuminance fields I(x,y)I(x, y)I(x,y) in lux. When a performer moves along a trajectory u⃗\vec{u}u, Du⃗ID_{\vec{u}} IDu​I dictates the required dynamic dimmer response to prevent shadows and maintain consistent video capture.
  • Environmental & Atmospheric Modeling: Meteorology stations track atmospheric pressure P(x,y)P(x, y)P(x,y). The directional derivative Du⃗PD_{\vec{u}} PDu​P in the direction of an aircraft's flight heading dictates localized altimeter drift and crosswind shear.

Example Problems

Example 1: Directional Derivative via Vector Normalization

Find the directional derivative of f(x,y)=3x2−2y2+5xyf(x, y) = 3x^2 - 2y^2 + 5xyf(x,y)=3x2−2y2+5xy at the point P(2,−1)P(2, -1)P(2,−1) in the direction of the vector v⃗=⟨3,4⟩\vec{v} = \langle 3, 4 \ranglev=⟨3,4⟩.

Solution
  1. Compute and evaluate the gradient:

    fx=6x+5y  ⟹  fx(2,−1)=6(2)+5(−1)=12−5=7f_x = 6x + 5y \implies f_x(2, -1) = 6(2) + 5(-1) = 12 - 5 = 7fx​=6x+5y⟹fx​(2,−1)=6(2)+5(−1)=12−5=7
    fy=−4y+5x  ⟹  fy(2,−1)=−4(−1)+5(2)=4+10=14f_y = -4y + 5x \implies f_y(2, -1) = -4(-1) + 5(2) = 4 + 10 = 14fy​=−4y+5x⟹fy​(2,−1)=−4(−1)+5(2)=4+10=14
    ∇f(2,−1)=⟨7,14⟩\nabla f(2, -1) = \langle 7, 14 \rangle∇f(2,−1)=⟨7,14⟩

  2. Normalize the direction vector:

    ∥v⃗∥=32+42=9+16=25=5\|\vec{v}\| = \sqrt{3^2 + 4^2} = \sqrt{9 + 16} = \sqrt{25} = 5∥v∥=32+42​=9+16​=25​=5
    u⃗=⟨3,4⟩5=⟨35,45⟩\vec{u} = \frac{\langle 3, 4 \rangle}{5} = \left\langle \frac{3}{5}, \frac{4}{5} \right\rangleu=5⟨3,4⟩​=⟨53​,54​⟩

  3. Evaluate the dot product:

    Du⃗f(2,−1)=⟨7,14⟩⋅⟨35,45⟩=7(35)+14(45)=21+565=775=15.4D_{\vec{u}} f(2, -1) = \langle 7, 14 \rangle \cdot \left\langle \frac{3}{5}, \frac{4}{5} \right\rangle = 7\left(\frac{3}{5}\right) + 14\left(\frac{4}{5}\right) = \frac{21 + 56}{5} = \frac{77}{5} = 15.4Du​f(2,−1)=⟨7,14⟩⋅⟨53​,54​⟩=7(53​)+14(54​)=521+56​=577​=15.4


Example 2: Three-Variable Directional Derivative Toward a Target Point

Find the directional derivative of f(x,y,z)=x2yz+2z2f(x, y, z) = x^2yz + 2z^2f(x,y,z)=x2yz+2z2 at the point P(1,3,1)P(1, 3, 1)P(1,3,1) in the direction toward the point Q(3,1,2)Q(3, 1, 2)Q(3,1,2).

Solution
  1. Compute partial derivatives and evaluate at P(1,3,1)P(1, 3, 1)P(1,3,1):

    fx=2xyz  ⟹  fx(1,3,1)=2(1)(3)(1)=6f_x = 2xyz \implies f_x(1, 3, 1) = 2(1)(3)(1) = 6fx​=2xyz⟹fx​(1,3,1)=2(1)(3)(1)=6
    fy=x2z  ⟹  fy(1,3,1)=(1)2(1)=1f_y = x^2z \implies f_y(1, 3, 1) = (1)^2(1) = 1fy​=x2z⟹fy​(1,3,1)=(1)2(1)=1
    fz=x2y+4z  ⟹  fz(1,3,1)=(1)2(3)+4(1)=7f_z = x^2y + 4z \implies f_z(1, 3, 1) = (1)^2(3) + 4(1) = 7fz​=x2y+4z⟹fz​(1,3,1)=(1)2(3)+4(1)=7
    ∇f(1,3,1)=⟨6,1,7⟩\nabla f(1, 3, 1) = \langle 6, 1, 7 \rangle∇f(1,3,1)=⟨6,1,7⟩

  2. Find and normalize displacement vector PQ→\overrightarrow{PQ}PQ​:

    PQ→=⟨3−1, 1−3, 2−1⟩=⟨2,−2,1⟩\overrightarrow{PQ} = \langle 3 - 1, \, 1 - 3, \, 2 - 1 \rangle = \langle 2, -2, 1 \ranglePQ​=⟨3−1,1−3,2−1⟩=⟨2,−2,1⟩
    ∥PQ→∥=22+(−2)2+12=4+4+1=9=3\|\overrightarrow{PQ}\| = \sqrt{2^2 + (-2)^2 + 1^2} = \sqrt{4 + 4 + 1} = \sqrt{9} = 3∥PQ​∥=22+(−2)2+12​=4+4+1​=9​=3
    u⃗=⟨2,−2,1⟩3=⟨23,−23,13⟩\vec{u} = \frac{\langle 2, -2, 1 \rangle}{3} = \left\langle \frac{2}{3}, -\frac{2}{3}, \frac{1}{3} \right\rangleu=3⟨2,−2,1⟩​=⟨32​,−32​,31​⟩

  3. Evaluate the directional derivative:

    Du⃗f(P)=⟨6,1,7⟩⋅⟨23,−23,13⟩=6(23)+1(−23)+7(13)=12−2+73=173≈5.67D_{\vec{u}} f(P) = \langle 6, 1, 7 \rangle \cdot \left\langle \frac{2}{3}, -\frac{2}{3}, \frac{1}{3} \right\rangle = 6\left(\frac{2}{3}\right) + 1\left(-\frac{2}{3}\right) + 7\left(\frac{1}{3}\right) = \frac{12 - 2 + 7}{3} = \frac{17}{3} \approx 5.67Du​f(P)=⟨6,1,7⟩⋅⟨32​,−32​,31​⟩=6(32​)+1(−32​)+7(31​)=312−2+7​=317​≈5.67


Connections & References

  • Prerequisites:
    • The Gradient Vector — Foundation for the vector differential operator ∇f\nabla f∇f.
    • Vectors — Unit vectors, dot products, and displacement vectors PQ→\overrightarrow{PQ}PQ​.
    • Partial Derivatives — Coordinate-aligned rates of change fxf_xfx​ and fyf_yfy​.
  • Direct Successors & Extensions:
    • Tangent Planes to Level Surfaces — Normal vectors and surface geometry.
    • Level Curves and Contour Maps — Orthogonal paths and contour intersections.
  • Course Sessions:
    • Session 12 - Gradient and Directional Derivatives