Source: Stewart's Multivariable Calculus, §14.6 | Homework Set 5
Difficulty: Intermediate | Prerequisites: Partial derivatives (§14.3), vectors and dot products, chain rule (§14.5)
Partial derivatives tell you the rate of change along the x- or y-axis, but what about any other direction? Section 14.6 answers that question with the directional derivative, and packages the partial derivatives into a single vector, the gradient, that points in the direction of steepest increase. This section is where contour maps, rates of change, and optimisation start to connect. You need to be comfortable with partial derivatives and the dot product before this will click.
The gradient vector ∇f collects the partial derivatives into one object that points toward the steepest uphill direction. The directional derivative D_u f = ∇f · u gives the rate of change of f in any direction u. The gradient's magnitude is the maximum possible rate of change, and it is always perpendicular to level curves.
Gradient vector (∇f or grad f)
For f(x, y), the gradient is the vector ∇f = ⟨∂f/∂x, ∂f/∂y⟩. For f(x, y, z), it is ∇f = ⟨fx, fy, fz⟩.
Think of it as: a vector that lives in the input space (not on the surface) pointing in the direction where f increases fastest.
Directional derivative (D_u f)
The rate of change of f at a point in the direction of a unit vector u. Formally: D_u f(x₀, y₀) = lim(h→0) [f(x₀ + ha, y₀ + hb) - f(x₀, y₀)] / h, where u = ⟨a, b⟩.
In simple terms, this means: how fast f is changing as you walk in the direction u.
Unit vector
A vector of length 1. To get the unit vector in the direction of any vector v, divide by its magnitude: u = v / |v|.
Think of it as: the direction without any magnitude. Directional derivatives require a unit vector because you want the rate of change per unit distance.
Level curve (contour line)
The set of points (x, y) where f(x, y) = k for some constant k. On a contour map, each curve represents a fixed value of f.
In simple terms, this means: a line on a map connecting all points at the same height (or temperature, or pressure, or whatever f measures).
For f(x, y): ∇f = ⟨fx, fy⟩
For f(x, y, z): ∇f = ⟨fx, fy, fz⟩
The gradient is a vector field: at each point in the domain, it assigns a vector.
∇f points in the direction of maximum rate of increase of f.
|∇f| equals the maximum rate of increase.
∇f is perpendicular (normal) to the level curve f(x, y) = k at every point on that curve.
If ∇f = 0 at a point, the point is a critical point (no preferred direction of increase).
D_u f(x₀, y₀) = lim(h→0) [f(x₀ + ha, y₀ + hb) - f(x₀, y₀)] / h
where u = ⟨a, b⟩ is a unit vector.
D_u f = ∇f · u = fx a + fy b
This is far quicker and works whenever f is differentiable (which covers nearly every function on an exam).
f(x, y) = x²y² - y³, P = (3, -1), Q = (-3, 5). Find D_u f at P in the direction of PQ.
Step 1: find the direction vector PQ.
PQ = Q - P = (-3 - 3, 5 - (-1)) = (-6, 6)
Step 2: find the unit vector u.
|PQ| = √(36 + 36) = √72 = 6√2
u = (-6, 6) / (6√2) = (-1/√2, 1/√2)
Step 3: compute the gradient at P.
fx = 2xy², fy = 2x²y - 3y²
At (3, -1): fx = 2(3)(1) = 6, fy = 2(9)(-1) - 3(1) = -18 - 3 = -21
∇f(3, -1) = ⟨6, -21⟩
Step 4: compute D_u f.
D_u f = ∇f · u = 6(-1/√2) + (-21)(1/√2) = (-6 - 21)/√2 = -27/√2 = -27√2/2
Using the definition (part a): You would parametrise the line from P in the direction u as (3 - h/√2, -1 + h/√2), substitute into f, and take the limit as h → 0. The algebra is longer but gives the same answer.
The gradient ∇f is always perpendicular to level curves, pointing from lower values toward higher values.
Where contour lines are closely spaced, |∇f| is large (the function is changing rapidly).
Where contour lines are widely spaced, |∇f| is small.
To minimise cumulative elevation gain on a hike (Problem 1a), stay as close to a single contour as possible, avoiding unnecessary crossings of contour lines.
Reading pressure from the map. Dublin sits between the isobars on the map. By interpolation between neighbouring contour lines, the pressure in Dublin is roughly 996 hPa.
Direction of fastest increase. The gradient points perpendicular to the isobars, from lower pressure toward higher pressure. Standing in Dublin, the pressure increases fastest roughly toward the southeast (toward the continent where higher pressure is marked).
Rate of increase. Estimate |∇f| by picking two nearby isobars and dividing the pressure difference by the geographic distance between them. If two isobars 4 hPa apart are separated by roughly 200 km, then |∇f| ≈ 4/200,000 = 0.00002 hPa/m.
Directional derivative along a given path. Walking due south at 2 m/s, the rate of pressure change is dp/dt = (∇p · u_south) × speed. If the southward component of ∇p is roughly 0.000015 hPa/m, then dp/dt ≈ 0.000015 × 2 = 0.00003 hPa/s. The sign depends on whether pressure increases or decreases to the south.
Extrema on the pressure map. Lows (L) are local minima, highs (H) are local maxima. Saddle points appear between adjacent lows or between adjacent highs, where the isobars form an hourglass shape.
\nabla f = \left\langle \frac{\partial f}{\partial x}, \frac{\partial f}{\partial y} \right\rangleD_{\mathbf{u}} f = \nabla f \cdot \mathbf{u} = f_x a + f_y b\text{Max rate of increase} = |\nabla f|, \quad \text{in the direction of } \nabla f\text{Min rate of increase} = -|\nabla f|, \quad \text{in the direction of } -\nabla fWeather forecasting relies on gradients of pressure, temperature, and humidity to predict wind direction and storm movement. In machine learning, gradient descent uses ∇f to find the direction that reduces a loss function fastest, which is how neural networks learn.
Students forget to normalise the direction vector to a unit vector. If you use a non-unit vector, your directional derivative will be scaled incorrectly.
The gradient lives in the input space (the xy-plane for f(x,y)), not in 3D on the surface. Students sometimes confuse ∇f with a vector pointing "uphill on the surface."
Students sometimes think the gradient is tangent to level curves. It is perpendicular to them.
A directional derivative of zero does not mean the function is constant nearby; it means you are walking along a level curve at that instant.
⚠️ Computing D_u f using the gradient shortcut is one of the most frequently tested skills. Know the workflow cold: direction vector → unit vector → gradient → dot product.
⚠️ "In what direction does f increase fastest?" always means: state the gradient direction (and normalise it if they ask for a unit vector).
⚠️ Contour map interpretation questions (Problem 1, Problem 8) test whether you understand the gradient geometrically, not just algebraically.
⚠️ You may be asked to compute D_u f both ways: from the definition and from the shortcut. Be ready for both.
True or False: The gradient of f(x, y) at a point is tangent to the level curve through that point. False – it is perpendicular to it.
Fill in the blank: D_u f = ____ . Answer: ∇f · u
True or False: The maximum value of D_u f over all unit vectors u is |∇f|. True.
True or False: If D_u f = 0 for some direction u, then f has a critical point there. False – it just means u is tangent to the level curve.
Fill in the blank: The directional derivative requires u to be a ____ vector. Answer: unit
Q: For f(x, y) = xe^y + y cos x, find the directional derivative at (0, 0) in the direction of v = ⟨3, 4⟩.
A: First, unit vector u = ⟨3, 4⟩/5 = ⟨3/5, 4/5⟩. Then fx = e^y - y sin x, fy = xe^y + cos x. At (0, 0): fx = 1, fy = 1. So D_u f = (1)(3/5) + (1)(4/5) = 7/5.
Q: In what direction does f(x, y) = x² + 3xy - y² increase fastest at (1, 2)? What is that maximum rate?
A: ∇f = ⟨2x + 3y, 3x - 2y⟩. At (1, 2): ∇f = ⟨8, -1⟩. The direction of fastest increase is ⟨8, -1⟩ (or the unit vector ⟨8, -1⟩/√65). The maximum rate is |∇f| = √(64 + 1) = √65.
Q: On a contour map, the 100 m and 120 m contour lines are 50 m apart (horizontal distance). Estimate |∇f| at a point between them.
A: |∇f| ≈ (120 - 100)/50 = 20/50 = 0.4 (metres of elevation per metre of horizontal distance).
The gradient is central to §14.7 (finding critical points, since ∇f = 0 at extrema) and to Lagrange multipliers (§14.8), where you set two gradients proportional. The directional derivative extends the chain rule: D_u f is really df/ds along a parametrised path. In vector calculus (Calc IV / MATH 216), the gradient becomes one of three fundamental differential operators alongside divergence and curl.
Gradient vector, nabla, del operator, directional derivative, rate of change in a direction, unit vector, level curve, contour map, isobar, steepest ascent, steepest descent, gradient descent, normal to level curve, atmospheric pressure gradient, MATH 215, Stewart §14.6, Calculus III