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:
- Define and compute the directional derivative D_u f in the direction of any unit vector u
- Define the gradient vector βf and express the directional derivative as D_u f = βf Β· u
- Prove that the gradient points in the direction of steepest ascent and has magnitude equal to the maximum rate of change
- Show that the gradient is perpendicular (normal) to level curves and level surfaces
- 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:
- Steepest ascent: βf points in the direction in which f increases most rapidly. The maximum rate of increase is ββfβ.
- Steepest descent: ββf points in the direction in which f decreases most rapidly. The maximum rate of decrease is βββfβ.
- 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
- 06 06 Directional Derivatives And Gradient
- **Chain Rule
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)
- If you chose B: D_u f = βf Β· u is only valid when u is a unit vector. Using a non-unit vector scales the result by βvβ. Correct!
- If you chose A: Using any vector without normalizing gives the wrong rate of change.
- If you chose C: That maximizes D_u f but isn't required.
- If you chose D: That makes D_u f = 0, which is a valid direction but not a requirement.
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)
- If you chose B: f_x = 2x β 6, f_y = 2y β 8. βf = β¨6, 8β©. Correct!
- If you chose A: This is the position vector at (3,4), not the gradient.
- If you chose C: This is f evaluated componentwise as 3Β²=9, 4Β²=16 β didn't differentiate.
- If you chose D: Random values.
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)
- If you chose B: βf is perpendicular to level curves. The tangent line equation is βf Β· β¨xβxβ, yβyββ© = 0. Correct!
- If you chose A: The tangent vector is perpendicular to the gradient.
- If you chose C: Only at critical points.
- If you chose D: No reason for βf to align with the x-axis.
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)
- If you chose B: D_u f = ββfβ cos ΞΈ is maximized when cos ΞΈ = 1, i.e., u is parallel to βf. Correct!
- If you chose A: Perpendicular to βf gives D_u f = 0 (direction of no change).
- If you chose C: ββf is steepest descent.
- If you chose D: Only if βf happens to point along the x-axis.
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)
- If you chose D: βf = β¨2xy, xΒ²β© β βf(1,1) = β¨2, 1β©. u = β¨1,1β©/β2. D_u f = 2/β2 + 1/β2 = 3/β2 = 3β2/2. Correct!
- If you chose A: Forgot to normalize u β used v = β¨1,1β© directly: 2Β·1 + 1Β·1 = 3.
- If you chose B: That's ββfβ but βf(1,1) norm is β(4+1) = β5, not β2.
- If you chose C: Multiplied 3 by β2 instead of dividing.
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)
- If you chose B: Maximum rate = ββfβ = β(16 + 64) = β80 = 4β5 β 8.94. Correct!
- If you chose A: That's just |f_x|.
- If you chose C: That's |f_x| + |f_y| = 4 + 8 = 12, not the magnitude.
- If you chose D: That's just |f_y|.
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
- 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
- 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 ΞΈ
- β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
- 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
- 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
- Forgetting to normalize the direction vector. The directional derivative formula D_u f = βf Β· u requires u to be a UNIT vector. Using the raw direction vector v = β¨a, bβ© without normalizing by βvβ gives a result that is off by a factor of βvβ. Always compute u = v/βvβ first.
- Confusing steepest ascent with steepest descent. βf points in the direction of maximum INCREASE. The direction of maximum DECREASE is ββf. Students often lose points by giving the gradient as the answer when asked "which way is downhill?".
- Thinking the gradient points along level curves. The gradient is PERPENDICULAR (normal) to level curves and level surfaces. If you think βf lies tangent to the level curve, you'll write the wrong tangent line equation β the tangent line uses βf as the normal vector, not the direction vector.
- Misapplying the dot product interpretation. D_u f = ββfβ cos ΞΈ only equals ββfβ when u is parallel to βf. Students sometimes set D_u f = ββfβ without checking whether u is actually in the gradient direction, or neglect to normalize u and get a mismatch between formula and computation.
- Assuming D_u f exists implies differentiability. The directional derivative can exist in every direction at a point even when the function is not differentiable (or even continuous) there. If all directional derivatives exist but the function is not differentiable, the gradient formula D_u f = βf Β· u may fail.
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.