Math graphic
πŸ“ Concept diagram

06-06 β€” Directional Derivatives and the Gradient

Phase: 6 β€” Calculus III: Multivariable Calculus Subject: 06-06 Prerequisites: 06-03 β€” Partial Derivatives, dot products, unit vectors Next subject: 06-07 β€” Optimization (Multivariable)


Learning Objectives

By the end of this subject, you will be able to:

  1. Define and compute the directional derivative D_u f in the direction of any unit vector u
  2. Define the gradient vector βˆ‡f and express the directional derivative as D_u f = βˆ‡f Β· u
  3. Prove that the gradient points in the direction of steepest ascent and has magnitude equal to the maximum rate of change
  4. Show that the gradient is perpendicular (normal) to level curves and level surfaces
  5. Apply gradients to find tangent lines to level curves and tangent planes to level surfaces

Core Content

1. Directional Derivative β€” Definition

⚠️ CRITICAL FOUNDATION: D_u f = βˆ‡f Β· u is the single most important formula in multivariable calculus. It connects the gradient to directional rates of change and leads directly to steepest ascent, level curves, and optimization.

Partial derivatives f_x and f_y measure rates of change in the x and y directions only. The directional derivative generalizes this to measure the rate of change in any direction.

Definition: Let u = ⟨a, b⟩ be a unit vector (so aΒ² + bΒ² = 1). The directional derivative of f at (xβ‚€, yβ‚€) in the direction of u is:

$                    f(xβ‚€ + ha, yβ‚€ + hb) βˆ’ f(xβ‚€, yβ‚€)
D_u f(xβ‚€, yβ‚€) = lim β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
               h→0                h
$

Geometric interpretation: Take the vertical plane that contains the point (xβ‚€, yβ‚€, f(xβ‚€, yβ‚€)) and is parallel to the vector u. This plane intersects the surface in a curve. D_u f is the slope of the tangent line to that curve.

Key case: If u = ⟨1, 0⟩ (the unit vector in the x-direction), D_u f = f_x. If u = ⟨0, 1⟩, D_u f = f_y. So partial derivatives are special cases of directional derivatives.


2. Computing D_u f β€” The Gradient Formula

Theorem: If f is differentiable at (xβ‚€, yβ‚€), then for any unit vector u = ⟨a, b⟩:

$D_u f(xβ‚€, yβ‚€) = f_x(xβ‚€, yβ‚€)Β·a + f_y(xβ‚€, yβ‚€)Β·b
$

Or more compactly, using the gradient vector:

βˆ‡f = ⟨f_x, f_y⟩      (also written as grad f)

D_u f = βˆ‡f Β· u       (dot product: f_xΒ·a + f_yΒ·b)

This is the most important formula in multivariable calculus.

For three variables: βˆ‡f = ⟨f_x, f_y, f_z⟩, and D_u f = βˆ‡f Β· u for any unit vector u ∈ RΒ³.

Example 1: Find the directional derivative of f(x, y) = xΒ²yΒ³ βˆ’ 4y at (2, βˆ’1) in the direction of v = ⟨2, 5⟩.

Step 1: Compute the gradient.

$f_x = 2xyΒ³        β†’    f_x(2, βˆ’1) = 2(2)(βˆ’1)Β³ = βˆ’4
f_y = 3xΒ²yΒ² βˆ’ 4   β†’    f_y(2, βˆ’1) = 3(4)(1) βˆ’ 4 = 12 βˆ’ 4 = 8

βˆ‡f(2, βˆ’1) = βŸ¨βˆ’4, 8⟩
$

Step 2: Make v into a unit vector.

$β€–vβ€– = √(2Β² + 5Β²) = √29
u = v/β€–vβ€– = ⟨2/√29, 5/√29⟩
$

Step 3: Compute the dot product.

$D_u f = βŸ¨βˆ’4, 8⟩ Β· ⟨2/√29, 5/√29⟩ = (βˆ’8 + 40)/√29 = 32/√29 β‰ˆ 5.94
$

3. Steepest Ascent and the Gradient

Recall the dot product identity: βˆ‡f Β· u = β€–βˆ‡fβ€– β€–uβ€– cos ΞΈ = β€–βˆ‡fβ€– cos ΞΈ, where ΞΈ is the angle between βˆ‡f and u.

Since cos ΞΈ has maximum value 1 (when ΞΈ = 0), the directional derivative is maximized when u points in the same direction as βˆ‡f. The maximum value is β€–βˆ‡fβ€–.

Theorem β€” Properties of the Gradient:

  1. Steepest ascent: βˆ‡f points in the direction in which f increases most rapidly. The maximum rate of increase is β€–βˆ‡fβ€–.
  2. Steepest descent: βˆ’βˆ‡f points in the direction in which f decreases most rapidly. The maximum rate of decrease is βˆ’β€–βˆ‡fβ€–.
  3. Zero change: If u βŠ₯ βˆ‡f (perpendicular), then D_u f = 0. Along level curves, the change is zero.

Example 2: For f(x, y) = 4 βˆ’ xΒ² βˆ’ 2yΒ² at (1, 1):

$βˆ‡f = βŸ¨βˆ’2x, βˆ’4y⟩ β†’ βˆ‡f(1, 1) = βŸ¨βˆ’2, βˆ’4⟩
β€–βˆ‡fβ€– = √(4 + 16) = √20 = 2√5 β‰ˆ 4.47
$

The direction of steepest ascent from (1, 1) is βŸ¨βˆ’2, βˆ’4⟩ (or equivalently, the normalized vector βŸ¨βˆ’1/√5, βˆ’2/√5⟩). The maximum rate of increase is 2√5 β‰ˆ 4.47.

In which direction should you walk to go downhill fastest? Opposite the gradient: the direction ⟨2, 4⟩ (normalized: ⟨1/√5, 2/√5⟩).

Example 3 (temperature): If T(x, y) = 60/(1 + xΒ² + yΒ²) represents temperature on a metal plate, find the direction of greatest temperature increase at (2, 1).

βˆ‡T = ⟨60Β·(βˆ’2x)/(1+xΒ²+yΒ²)Β², 60Β·(βˆ’2y)/(1+xΒ²+yΒ²)²⟩ = βŸ¨βˆ’120x/(1+xΒ²+yΒ²)Β², βˆ’120y/(1+xΒ²+yΒ²)²⟩

At (2, 1): 1 + xΒ² + yΒ² = 1 + 4 + 1 = 6
βˆ‡T(2, 1) = βŸ¨βˆ’240/36, βˆ’120/36⟩ = βŸ¨βˆ’20/3, βˆ’10/3⟩

Direction of greatest increase: toward the origin (negative components point radially inward).
Rate: β€–βˆ‡Tβ€– = √(400/9 + 100/9) = √(500/9) = 10√5/3 β‰ˆ 7.45 Β°/unit

The temperature increases fastest toward the origin (where T = 60 is maximum). Makes sense: T(x, y) has a peak at the origin.


4. Gradient Perpendicular to Level Curves

Theorem: At any point (xβ‚€, yβ‚€), βˆ‡f(xβ‚€, yβ‚€) is perpendicular to the level curve f(x, y) = k passing through that point.

Proof sketch: Parameterize the level curve as r(t) = ⟨x(t), y(t)⟩ with f(x(t), y(t)) = k. Differentiate:

$βˆ‚f/βˆ‚x Β· dx/dt + βˆ‚f/βˆ‚y Β· dy/dt = 0
βˆ‡f Β· rβ€²(t) = 0
$

βˆ‡f is perpendicular to the tangent vector rβ€²(t), so βˆ‡f is normal to the level curve.

Application β€” Tangent line to a level curve: The tangent line to f(x, y) = k at (xβ‚€, yβ‚€) is:

$f_x(xβ‚€, yβ‚€)(x βˆ’ xβ‚€) + f_y(xβ‚€, yβ‚€)(y βˆ’ yβ‚€) = 0
$

Example 4: Find the tangent line to the ellipse x²/4 + y² = 1 at (√2, 1/√2).

$f(x, y) = xΒ²/4 + yΒ² = 1

βˆ‡f = ⟨x/2, 2y⟩ β†’ βˆ‡f(√2, 1/√2) = ⟨√2/2, 2/√2⟩ = ⟨1/√2, √2⟩

Tangent line: (1/√2)(x βˆ’ √2) + √2(y βˆ’ 1/√2) = 0
β†’ (x βˆ’ √2)/√2 + √2 y βˆ’ 1 = 0
β†’ x/√2 + √2 y = 2
$

5. Gradient for Three Variables β€” Level Surfaces

For f(x, y, z), βˆ‡f = ⟨f_x, f_y, f_z⟩ is perpendicular to the level surface f(x, y, z) = k.

Tangent plane to a level surface: At (xβ‚€, yβ‚€, zβ‚€) on f(x, y, z) = k:

$f_x(xβ‚€, yβ‚€, zβ‚€)(x βˆ’ xβ‚€) + f_y(xβ‚€, yβ‚€, zβ‚€)(y βˆ’ yβ‚€) + f_z(xβ‚€, yβ‚€, zβ‚€)(z βˆ’ zβ‚€) = 0
$

Or compactly: βˆ‡f(xβ‚€, yβ‚€, zβ‚€) Β· ⟨x βˆ’ xβ‚€, y βˆ’ yβ‚€, z βˆ’ zβ‚€βŸ© = 0.

Example 5: Find the tangent plane to the sphere xΒ² + yΒ² + zΒ² = 14 at (1, 2, 3).

$f(x, y, z) = xΒ² + yΒ² + zΒ²
βˆ‡f = ⟨2x, 2y, 2z⟩ β†’ βˆ‡f(1, 2, 3) = ⟨2, 4, 6⟩

Tangent plane: 2(x βˆ’ 1) + 4(y βˆ’ 2) + 6(z βˆ’ 3) = 0
β†’ 2x βˆ’ 2 + 4y βˆ’ 8 + 6z βˆ’ 18 = 0
β†’ 2x + 4y + 6z = 28
β†’ x + 2y + 3z = 14
$

6. Directional Derivative via the Chain Rule

Directional derivatives are connected to the chain rule. If we parameterize motion along the direction u from (xβ‚€, yβ‚€) as:

$x(t) = xβ‚€ + t a,    y(t) = yβ‚€ + t b
$

Then z(t) = f(x(t), y(t)) and:

$dz/dt|_{t=0} = f_xΒ·a + f_yΒ·b = βˆ‡f Β· u = D_u f
$

This is why the formula works β€” it's the chain rule evaluated at t = 0.



Key Terms

Directional derivatives - Computing D_u f β€” The Gradient Formula - Correct: A) 3x + 4y = 25 - Correct: A) ⟨2, 2⟩ - Correct: B) 5 - Correct: B) In the direction of βˆ‡f - Correct: B) ⟨6, 8⟩ - Correct: D) (3√2)/2 - Directional Derivative via the Chain Rule - Directional Derivative β€” Definition - End-of-Subject Quiz**

Worked Examples

Worked Example 1: Directional Derivative Computation

Problem: Find the directional derivative of f(x, y) = e^y sin x at (Ο€/6, 0) in the direction from (Ο€/6, 0) to (Ο€/3, 1).

Solution: First, find the direction vector: v = βŸ¨Ο€/3 βˆ’ Ο€/6, 1 βˆ’ 0⟩ = βŸ¨Ο€/6, 1⟩.

Unit vector: β€–vβ€– = √(π²/36 + 1) = √(π² + 36)/6. u = βŸ¨Ο€/6, 1⟩ Β· 6/√(π² + 36) = βŸ¨Ο€, 6⟩/√(π² + 36).

Gradient:

$f_x = e^y cos x    β†’    f_x(Ο€/6, 0) = 1Β·cos(Ο€/6) = √3/2
f_y = e^y sin x    β†’    f_y(Ο€/6, 0) = 1Β·sin(Ο€/6) = 1/2

βˆ‡f = ⟨√3/2, 1/2⟩
$

Directional derivative:

$D_u f = ⟨√3/2, 1/2⟩ Β· βŸ¨Ο€, 6⟩/√(π² + 36)
      = (Ο€βˆš3/2 + 3)/√(π² + 36)
      = (Ο€βˆš3 + 6)/(2√(π² + 36))
$

Worked Example 2: Maximum Rate of Change

Problem: The height of a mountain is given by h(x, y) = 2000 βˆ’ 0.001xΒ² βˆ’ 0.004yΒ² (in meters, x and y in meters from the peak). You are at (500, 300). In what direction should you go to climb most steeply, and what is that rate?

Solution:

$βˆ‡h = βŸ¨βˆ’0.002x, βˆ’0.008y⟩
βˆ‡h(500, 300) = βŸ¨βˆ’1, βˆ’2.4⟩
β€–βˆ‡hβ€– = √(1 + 5.76) = √6.76 = 2.6 meters per meter

Direction of steepest ascent: βŸ¨βˆ’1, βˆ’2.4⟩ (toward the origin/peak).
Unit direction: βŸ¨βˆ’1/2.6, βˆ’2.4/2.6⟩ β‰ˆ βŸ¨βˆ’0.385, βˆ’0.923⟩.
$

Worked Example 3: Tangent Line to Level Curve

Problem: Find the tangent line to the curve xΒ²y + xyΒ² = 6 at (1, 2).

Solution:

$f(x, y) = xΒ²y + xyΒ²
βˆ‡f = ⟨2xy + yΒ², xΒ² + 2xy⟩
βˆ‡f(1, 2) = ⟨2(1)(2) + 4, 1 + 2(1)(2)⟩ = ⟨4 + 4, 1 + 4⟩ = ⟨8, 5⟩

Tangent line: 8(x βˆ’ 1) + 5(y βˆ’ 2) = 0
β†’ 8x βˆ’ 8 + 5y βˆ’ 10 = 0
β†’ 8x + 5y = 18
$

Worked Example 4: Tangent Plane to Level Surface

Problem: Find the tangent plane to the ellipsoid xΒ² + 2yΒ² + 3zΒ² = 21 at (1, 2, 2).

Solution:

$f(x, y, z) = xΒ² + 2yΒ² + 3zΒ²
βˆ‡f = ⟨2x, 4y, 6z⟩
βˆ‡f(1, 2, 2) = ⟨2, 8, 12⟩

Tangent plane: 2(x βˆ’ 1) + 8(y βˆ’ 2) + 12(z βˆ’ 2) = 0
β†’ 2x βˆ’ 2 + 8y βˆ’ 16 + 12z βˆ’ 24 = 0
β†’ 2x + 8y + 12z = 42
β†’ x + 4y + 6z = 21
$

Quiz

Q1: The directional derivative D_u f requires u to be:

A) Any vector B) A unit vector (β€–uβ€– = 1) C) A vector parallel to βˆ‡f D) A vector perpendicular to βˆ‡f

Correct: B)


Q2: For f(x, y) = xΒ² + yΒ², the gradient βˆ‡f(3, 4) is:

A) ⟨3, 4⟩ B) ⟨6, 8⟩ C) ⟨9, 16⟩ D) ⟨5, 5⟩

Correct: B)


Q3: The gradient βˆ‡f at a point is always:

A) Tangent to the level curve through that point B) Perpendicular (normal) to the level curve through that point C) Zero D) Parallel to the x-axis

Correct: B)


Q4: The direction of steepest ascent is:

A) Any direction perpendicular to βˆ‡f B) The direction of βˆ‡f C) The direction of βˆ’βˆ‡f D) The direction of the x-axis

Correct: B)


Q5: Find D_u f at (1, 1) for f(x, y) = x²y in the direction ⟨1, 1⟩.

A) 3 B) √2 C) 3√2 D) (3√2)/2

Correct: D)


Q6: Given βˆ‡f(2, βˆ’1) = βŸ¨βˆ’4, 8⟩, what is the maximum rate of increase of f at that point?

A) 4 B) √80 = 4√5 C) 12 D) 8

Correct: B)


Practice Problems

(Answers are below. Try each problem before checking.)

Problem 1: Find the directional derivative of f(x, y) = xΒ³ βˆ’ 3xy + 4yΒ² at (1, 2) in the direction of the vector ⟨3, 4⟩.

Problem 2: Find the direction in which f(x, y) = xΒ² + xy + yΒ² increases most rapidly at (βˆ’1, 1). What is the maximum rate of increase?

Problem 3: Find the tangent line to the level curve xΒ³ + yΒ³ = 9 at (2, 1).

Problem 4: Find the tangent plane to the surface z = 9 βˆ’ xΒ² βˆ’ yΒ² at (1, 2, 4). (Hint: write as F(x, y, z) = xΒ² + yΒ² + z βˆ’ 9 = 0, a level surface of F.)

Problem 5: If T(x, y) = 100 βˆ’ xΒ² βˆ’ 2yΒ² describes temperature, in which direction from (3, 2) should an insect move to cool down fastest?

Problem 6: Compute D_u f(0, 0) for f(x, y) = xΒ²y/(xΒ² + yΒ²) if (x, y) β‰  (0, 0), f(0, 0) = 0, in the direction u = ⟨1/√2, 1/√2⟩. Use the limit definition.

Problem 7: Find the points on the ellipsoid xΒ² + 2yΒ² + 3zΒ² = 1 where the tangent plane is parallel to the plane 3x βˆ’ y + 3z = 1.

Answers (click to expand) **Problem 1:** f_x = 3xΒ² βˆ’ 3y β†’ f_x(1,2) = 3 βˆ’ 6 = βˆ’3 f_y = βˆ’3x + 8y β†’ f_y(1,2) = βˆ’3 + 16 = 13 βˆ‡f = βŸ¨βˆ’3, 13⟩ v = ⟨3, 4⟩, β€–vβ€– = 5, u = ⟨3/5, 4/5⟩ D_u f = (βˆ’3)(3/5) + 13(4/5) = (βˆ’9 + 52)/5 = 43/5 = 8.6 **Problem 2:** βˆ‡f = ⟨2x + y, x + 2y⟩ β†’ βˆ‡f(βˆ’1,1) = βŸ¨βˆ’2 + 1, βˆ’1 + 2⟩ = βŸ¨βˆ’1, 1⟩ Direction of steepest ascent: βŸ¨βˆ’1, 1⟩ (unit: βŸ¨βˆ’1/√2, 1/√2⟩). Maximum rate: β€–βˆ‡fβ€– = √(1 + 1) = √2 β‰ˆ 1.414. **Problem 3:** f(x,y) = xΒ³ + yΒ³, βˆ‡f = ⟨3xΒ², 3y²⟩, βˆ‡f(2,1) = ⟨12, 3⟩. Tangent line: 12(x βˆ’ 2) + 3(y βˆ’ 1) = 0 β†’ 12x βˆ’ 24 + 3y βˆ’ 3 = 0 β†’ 12x + 3y = 27 β†’ 4x + y = 9. **Problem 4:** F(x,y,z) = xΒ² + yΒ² + z βˆ’ 9. βˆ‡F = ⟨2x, 2y, 1⟩. βˆ‡F(1,2,4) = ⟨2, 4, 1⟩. Tangent plane: 2(xβˆ’1) + 4(yβˆ’2) + 1(zβˆ’4) = 0 β†’ 2x + 4y + z = 2 + 8 + 4 = 14. Or equivalently: z = 14 βˆ’ 2x βˆ’ 4y. This matches the tangent plane formula z = f(1,2) + f_x(1,2)(xβˆ’1) + f_y(1,2)(yβˆ’1) = 4 βˆ’ 2(xβˆ’1) βˆ’ 4(yβˆ’2) = 4 βˆ’ 2x + 2 βˆ’ 4y + 8 = 14 βˆ’ 2x βˆ’ 4y. βœ“ **Problem 5:** βˆ‡T = βŸ¨βˆ’2x, βˆ’4y⟩ β†’ βˆ‡T(3,2) = βŸ¨βˆ’6, βˆ’8⟩. Steepest descent direction: opposite gradient = ⟨6, 8⟩ (unit: ⟨3/5, 4/5⟩). **Problem 6:** D_u f(0,0) = lim_{hβ†’0} [f(h/√2, h/√2) βˆ’ f(0,0)]/h = lim [((h/√2)Β²(h/√2))/((h/√2)Β²+(h/√2)Β²)]/h = lim [(hΒ³/2√2)/(hΒ²/2 + hΒ²/2)]/h = lim [(hΒ³/2√2)/(hΒ²)]/h = lim [h/(2√2)]/h = 1/(2√2) = √2/4. So D_u f(0,0) exists and equals √2/4, even though f is not continuous at (0,0) (check along y=xΒ²). **Problem 7:** βˆ‡F = ⟨2x, 4y, 6z⟩ must be parallel to ⟨3, βˆ’1, 3⟩. So ⟨2x, 4y, 6z⟩ = λ⟨3, βˆ’1, 3⟩ β†’ x = 3Ξ»/2, y = βˆ’Ξ»/4, z = Ξ»/2. Plug into ellipsoid: (9λ²/4) + 2(λ²/16) + 3(λ²/4) = 1 β†’ (9/4 + 1/8 + 3/4)λ² = 1 β†’ (18/8 + 1/8 + 6/8)λ² = 1 β†’ (25/8)λ² = 1 β†’ Ξ» = Β±2√2/5. Two points: (Β±3√2/5, βˆ“βˆš2/10, ±√2/5).

Summary

  1. The directional derivative D_u f = βˆ‡f Β· u gives the rate of change of f in the direction of the unit vector u β€” it generalizes partial derivatives to arbitrary directions
  2. The gradient βˆ‡f = ⟨f_x, f_y⟩ (or ⟨f_x, f_y, f_z⟩ in RΒ³) is the central vector in multivariable calculus: D_u f = βˆ‡f Β· u = β€–βˆ‡fβ€– cos ΞΈ
  3. βˆ‡f points in the direction of steepest ascent with magnitude equal to the maximum rate of change; βˆ’βˆ‡f points in the direction of steepest descent
  4. The gradient is always perpendicular to level curves (RΒ²) and level surfaces (RΒ³), providing an effortless way to find tangent lines and tangent planes to implicitly defined curves and surfaces
  5. The directional derivative exists even for some non-differentiable functions, highlighting that it probes only one path while differentiability requires good behavior in all directions

Pitfalls



Next Steps

Move on to 06-07 β€” Optimization (Multivariable) to learn how to find local maximums and minimums of multivariable functions using critical points, the second derivative test (Hessian determinant), and the Extreme Value Theorem on closed bounded regions.