Skip to content

Directional derivatives

Find the slope of the hill in any direction you choose to walk, by weighting the east and north slopes with the parts of a unit vector, and apply it to a direction given by any vector and to three variables.

It opens on

At (2, 0) the hill falls 4 per unit east and rises 2 per unit north. Walking northeast, halfway between the two, how steep is the hill?

Why it matters

A hiker, a drone or a heat sensor rarely moves exactly along an axis; the rate of change of a quantity in the direction of travel is what is felt, and it is also the key to finding the steepest way.

Good to know first

  • The chain rule for several variables: along a path the rate is fx dx/dt + fy dy/dt, with the slopes read where the walker is
  • The dot product: a · b = a₁b₁ + a₂b₂ + a₃b₃, and a vector divided by its length has length 1

Step by step

  1. Slope in a chosen direction

    Write the slope of the hill at (2, 0) along a unit vector u as Du f = fx u₁ + fy u₂ and compute it for northeast.

    For northeast, Du f = (−4)(1/√2) + (2)(1/√2) = −2/√2 = −√2 ≈ −1.41.

    A common mix-up

    The slope northeast is the average of −4 and 2, which is −1.

    In fact: The weights are 1/√2, not 1/2: the answer is −√2, as the trace shows.

  2. Directions given by any vector

    Scale a given direction vector to a unit vector before using the formula, and see that the opposite direction reverses the sign.

    On the hill at (2, 0), Du f = (−4)(3/5) + (2)(4/5) = −12/5 + 8/5 = −4/5.

    A common mix-up

    Dot the slopes with ⟨3, 4⟩ directly.

    In fact: That is −4, five times the true −4/5; scale to length 1 first.

  3. Three variables

    Compute Du g = gx a + gy b + gz c = ∇g · u in space, scaling the direction vector first.

    For the walk along v from (1, 2, 3), g = xyz has gx = yz = 6, gy = xz = 3, gz = xy = 2, so ∇g = ⟨6, 3, 2⟩.

    A common mix-up

    Average the three partials for a diagonal direction.

    In fact: The weights are the components of u: 16/3, not 11/3.

Try it

Find Du f for f = x² + y² at (1, 1) with u = ⟨1/√2, 1/√2⟩.Answer

2√2

Hint: fx = 2x = 2, fy = 2y = 2

Find Du f for f = x²y at (1, 2) in the direction ⟨3, 4⟩.Answer

16/5

Hint: fx = 2xy = 4, fy = x² = 1, u = ⟨3/5, 4/5⟩

Find Du g for g = x + y² + z³ at (1, 1, 1) in the direction ⟨2, 2, 1⟩.Answer

3

Hint: ∇g = ⟨1, 2, 3⟩, |v| = 3, dot product 9

East the hill falls 4 per unit, north it rises 2. Walking northeast, is the slope −4, 2, or something else?Answer

Something else, a mixture of both.

Walking the opposite way, u = ⟨−3/5, −4/5⟩, what is Du f?Answer

+4/5; reversing flips the sign.

Directional derivatives

30 minutes every month. No card.