🌱 Tony's Memex Tony's Intertwingled Memex
Digital Garden | OER Curriculum
Home / Digital Garden / Directional Derivatives

Directional Derivatives

Core Definition

Let ff be a differentiable function of two or three variables at a point PP, and let u⃗\vec{u} be a unit vector (∥u⃗∥=1\|\vec{u}\| = 1). The directional derivative of ff at PP in the direction of u⃗\vec{u}, denoted by Du⃗f(P)D_{\vec{u}} 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}

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

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

    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_2

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

    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_3

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


Concept Explanation

Bridging from Partial Derivatives to Arbitrary Directions

Partial derivatives fxf_x and fyf_y measure the instantaneous rate of change of 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 \rangle (moving due East)
  • fy=Dj^f=∇f⋅⟨0,1⟩f_y = D_{\hat{j}} f = \nabla f \cdot \langle 0, 1 \rangle (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}} 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} strictly requires that the direction vector is a unit vector (∥u⃗∥=1\|\vec{u}\| = 1).

  • If a problem specifies direction via an arbitrary non-unit vector v⃗\vec{v} (where ∥v⃗∥≠1\|\vec{v}\| \neq 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}}
  • If direction is specified as moving from point PP toward a destination point QQ, compute the displacement vector PQ→=Q−P\overrightarrow{PQ} = Q - P and normalize it:
    u⃗=PQ→∥PQ→∥\vec{u} = \frac{\overrightarrow{PQ}}{\|\overrightarrow{PQ}\|}
Pitfall Warning

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

Angle Parameterization in 2D

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

u⃗=⟨cos⁡θ, sin⁡θ⟩\vec{u} = \langle \cos\theta, \, \sin\theta \rangle
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\theta

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\phi
where ϕ\phi is the angle between the gradient vector ∇f\nabla f and the direction vector u⃗\vec{u}. Because −1≤cos⁡ϕ≤1-1 \le \cos\phi \le 1:

  1. Maximum Rate of Increase (ϕ=0\phi = 0): When u⃗\vec{u} points in the same direction as ∇f\nabla f, cos⁡(0)=1\cos(0) = 1, yielding Du⃗f=∥∇f∥D_{\vec{u}} f = \|\nabla f\|.
  2. Maximum Rate of Decrease (ϕ=π\phi = \pi): When u⃗\vec{u} points opposite to ∇f\nabla f, cos⁡(π)=−1\cos(\pi) = -1, yielding Du⃗f=−∥∇f∥D_{\vec{u}} f = -\|\nabla f\|.
  3. Zero Rate of Change (ϕ=π/2\phi = \pi/2 or 3π/23\pi/2): When u⃗\vec{u} is orthogonal to ∇f\nabla f, cos⁡(π/2)=0\cos(\pi/2) = 0, yielding Du⃗f=0D_{\vec{u}} 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} yields a slope Du⃗hD_{\vec{u}} h exceeding federal grade standards (e.g., 6%6\%), the alignment must be modified.
  • Entertainment Engineering & Lighting Design: Lighting designers model stage illuminance fields I(x,y)I(x, y) in lux. When a performer moves along a trajectory u⃗\vec{u}, Du⃗ID_{\vec{u}} 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). The directional derivative Du⃗PD_{\vec{u}} 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 + 5xy at the point P(2,−1)P(2, -1) in the direction of the vector v⃗=⟨3,4⟩\vec{v} = \langle 3, 4 \rangle.

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 = 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 = 14
    ∇f(2,−1)=⟨7,14⟩\nabla f(2, -1) = \langle 7, 14 \rangle

  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
    u⃗=⟨3,4⟩5=⟨35,45⟩\vec{u} = \frac{\langle 3, 4 \rangle}{5} = \left\langle \frac{3}{5}, \frac{4}{5} \right\rangle

  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.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^2 at the point P(1,3,1)P(1, 3, 1) in the direction toward the point Q(3,1,2)Q(3, 1, 2).

Solution
  1. Compute partial derivatives and evaluate at 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) = 6
    fy=x2z  ⟹  fy(1,3,1)=(1)2(1)=1f_y = x^2z \implies f_y(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) = 7
    ∇f(1,3,1)=⟨6,1,7⟩\nabla f(1, 3, 1) = \langle 6, 1, 7 \rangle

  2. Find and normalize displacement vector PQ→\overrightarrow{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 \rangle
    ∥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
    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\rangle

  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.67


Connections & References