Sign up freeSign in

Courses · Calculus 3 · Unit guide

Calculus 3: Gradient and directional derivatives

How to find slope in any direction, and why the gradient points straight uphill

This unit covers: Directional derivatives, the gradient and what it means, level curves and surfaces.

Take the unit quiz Study the flashcards Make flashcards from my notes
Calculus 3: Gradient and directional derivatives mindmap: Slopes Beyond the Axes, Defining the Directional Derivative, The Gradient Vector, Directional Derivative from the Gradient, The Recipe, Step by Step, Worked Example, Why the Gradient Points Uphill, Level Curves and the Gradient, Level Surfaces and Tangent Planes
The unit on one page. Open the image to save or print it.

Do you remember to turn your direction into a unit vector before you dot it with the gradient? Plenty of students forget. In this multivariable calculus unit, we'll cover directional derivatives, the gradient and what it means, and level curves and surfaces.

In this guide
  1. Slopes Beyond the Axes
  2. Defining the Directional Derivative
  3. The Gradient Vector
  4. Directional Derivative from the Gradient
  5. The Recipe, Step by Step
  6. Worked Example
  7. Why the Gradient Points Uphill
  8. Level Curves and the Gradient
  9. Level Surfaces and Tangent Planes

Slopes Beyond the Axes

Partial derivatives tell you how fast a function changes when you move along just one axis. The partial with respect to x is the slope as you walk in the x direction while holding y fixed, and the partial with respect to y is the slope walking in the y direction. But on a hillside you can walk any way you like, so we need a slope for every possible heading.

Key points.

  • Partial fx is the slope moving in the x direction, y fixed
  • Partial fy is the slope moving in the y direction, x fixed
  • On a surface you can move in any direction
  • We need a slope for every heading, not just two

Defining the Directional Derivative

Here's the formal definition. Pick a point and a unit vector u with components a and b. The directional derivative is the limit, as h goes to zero, of the change in f when you step a distance h along u, divided by h. Because u has length one, h really is the distance you travel, so the result is a genuine rate of change per unit distance.

D_u f(x0, y0) = lim as h→0 of [f(x0 + ha, y0 + hb) − f(x0, y0)] / h, where u = ⟨a, b⟩ is a unit vector Definition of the directional derivative

Key points.

  • Choose a point and a unit vector u = ⟨a, b⟩
  • Step a distance h along u and measure the change in f
  • Divide by h and let h go to zero

The Gradient Vector

Now let's package the partial derivatives into a single object. The gradient of f, written del f, is the vector with components f sub x and f sub y. In three variables you simply add f sub z. For example, if f equals x squared plus y squared, the gradient is the vector two x, two y. Notice it gives a different vector at every point.

∇f = ⟨fx, fy⟩
∇f = ⟨fx, fy, fz⟩
f = x² + y²
∇f = ⟨2x, 2y⟩

Key points.

  • The gradient collects all partial derivatives into one vector
  • In two variables it has two components, in three it has three
  • It's a vector field: a different vector at every point

Directional Derivative from the Gradient

The gradient makes directional derivatives easy. The directional derivative of f along u equals the gradient dotted with u, which works out to f sub x times a plus f sub y times b. This only holds when u has length one. So if you're given a direction vector v that isn't a unit vector, divide it by its length first. Skipping that step is the most common mistake here.

Du f = ∇f · u
Du f = fx·a + fy·b
requires |u| = 1
u = v / |v|

Key points.

  • The directional derivative is the gradient dotted with u
  • The formula needs u to be a unit vector
  • Normalize any direction vector by dividing by its length

The Recipe, Step by Step

Here's the routine you'll use every time. First, compute the partial derivatives. Second, plug in your point to get the gradient there as actual numbers. Third, turn the given direction into a unit vector by dividing by its length. Fourth, take the dot product. Finally, sanity check the sign: a positive answer means f is increasing in that direction, and a negative one means it's decreasing.

  1. Compute the partial derivatives
  2. Evaluate the gradient at the point
  3. Normalize the direction: u = v / |v|
  4. Take the dot product ∇f · u
  5. Check the sign: positive means increasing

Worked Example

Let's work one through. Take f equals x squared y plus three y at the point one, two, in the direction of the vector three, four. The gradient is two x y, x squared plus three, which at our point is four, four. The vector three, four has length five, so u is three fifths, four fifths. Dotting gives twelve fifths plus sixteen fifths, which is twenty-eight fifths.

f = x²y + 3y at (1, 2), v = ⟨3, 4⟩
∇f = ⟨2xy, x² + 3⟩ = ⟨4, 4⟩
|v| = 5, u = ⟨3/5, 4/5⟩
Du f = 12/5 + 16/5 = 28/5

Key points.

  • f = x²y + 3y at (1, 2) toward ⟨3, 4⟩
  • Gradient at the point is ⟨4, 4⟩
  • Unit vector is ⟨3/5, 4/5⟩, answer is 28/5

Why the Gradient Points Uphill

Why does the gradient matter so much? Write the dot product using the angle theta between the gradient and u. Since u has length one, you get the length of the gradient times cosine theta. Cosine is largest at theta equals zero, so f increases fastest along the gradient, at a rate equal to its length. It decreases fastest the opposite way, and doesn't change at ninety degrees.

Du f = |∇f||u| cos θ
Du f = |∇f| cos θ
max at θ = 0: |∇f|
min at θ = π: −|∇f|
θ = π/2: Du f = 0

Key points.

  • Du f equals the length of the gradient times cos θ
  • Fastest increase is along the gradient, at rate |∇f|
  • Fastest decrease is opposite, zero change at right angles

Level Curves and the Gradient

A level curve is the set of points where f equals some constant k, like a contour line on a hiking map. Moving along a level curve, f doesn't change, so the directional derivative there is zero. That's exactly the ninety degree case, which means the gradient is always perpendicular to the level curve. For x squared plus y squared, the level curves are circles and the gradient points straight outward.

Key points.

  • A level curve is where f(x, y) equals a constant k
  • The gradient is perpendicular to the level curve
  • Closely spaced curves mean a large gradient

Level Surfaces and Tangent Planes

The same idea works one dimension up. A level surface is where F of x, y, z equals a constant, and the gradient of F is normal to it. Take the sphere x squared plus y squared plus z squared equals fourteen at the point one, two, three. The gradient is two x, two y, two z, which is two, four, six there. So the tangent plane simplifies to x plus two y plus three z equals fourteen.

x² + y² + z² = 14 at (1, 2, 3)
∇F = ⟨2x, 2y, 2z⟩ = ⟨2, 4, 6⟩
2(x−1) + 4(y−2) + 6(z−3) = 0
x + 2y + 3z = 14

Key points.

  • A level surface is where F(x, y, z) equals a constant
  • The gradient of F is normal to the level surface
  • Use it as the normal vector for the tangent plane

Remember this

Remember this: the directional derivative is the gradient dotted with a unit vector, and the gradient points uphill, perpendicular to level curves and surfaces. Now quiz yourself with a few practice problems to make it stick.

Practice this unit

  • Calculus 3: Gradient and Directional Derivatives quiz15 multiple-choice questions with explanations · no account needed
  • Calculus 3: Vectors and the Geometry of Space quiz15 multiple-choice questions with explanations · no account needed
  • Calculus 3: Vector Functions and Motion in Space quiz15 multiple-choice questions with explanations · no account needed
  • Calculus 3: Gradient and Directional Derivatives31 flashcards · study free
  • Calculus 3: Vectors and the Geometry of Space36 flashcards · study free
  • Calculus 3: Vector Functions and Motion in Space32 flashcards · study free
  • Calculus 3: Partial Derivatives30 flashcards · study free

Every Calculus 3 deck and quiz: the Calculus 3 page.

Other Calculus 3 unit guides

  • Vectors and the geometry of spaceStudy guide
  • Vector functions and motion in spaceStudy guide
  • Partial derivativesStudy guide
  • Optimization and Lagrange multipliersStudy guide
  • Double integralsStudy guide
  • Triple integrals and coordinate changesStudy guide
  • Vector fields and line integralsStudy guide
  • Green’s theoremStudy guide
  • Surface integrals, Stokes’ theorem and the Divergence TheoremStudy guide

Try it with your own material

Upload a PDF, slides or notes and study the deck in minutes. Making your own cards is free with no limits.

Make flashcards from my notesSee how Quizcard works