The Chain Rule, Directional Derivatives, and the Gradient, MATH 215 Sections 14.5–14.6 – Study Notes
offline

Difficulty: Intermediate to Advanced | Prerequisites: Sections 14.1 through 14.4 (partial derivatives, tangent planes, differentials). Solid comfort with the single-variable chain rule.

Big Picture

Sections 14.5 and 14.6 answer two questions that arise as soon as you have partial derivatives: what happens when your variables themselves depend on other variables (the chain rule), and what happens when you move in a direction that is not along an axis (directional derivatives and the gradient).

The multivariable chain rule is the engine behind related-rates problems in higher dimensions and behind converting between coordinate systems (Cartesian to polar, for instance). The gradient vector collects all partial derivatives into a single object that points uphill as steeply as possible, and the directional derivative tells you the slope in any direction you choose.

If you are comfortable computing partial derivatives and writing tangent-plane equations, you are ready for this material. These sections tie the earlier tools together and set the stage for optimisation.

TL;DR

The multivariable chain rule lets you differentiate composite functions by tracing every path from output to the variable you care about, multiplying partials along each path, and summing. The gradient vector ∇f =

Key Terms

Multivariable chain rule

If z = f(x, y) and x, y each depend on one or more other variables (say t, or r and θ), then dz/dt = (∂z/∂x)(dx/dt) + (∂z/∂y)(dy/dt). For every intermediate variable, multiply the partial along the link and sum over all paths.

Think of it as: tracing every route from the output back to the variable you want, multiplying the derivatives along each leg, then adding them up.

Tree diagram (dependency diagram)

A visual map of which variables depend on which. Each branch from z down to x, y, and then to t (or r, θ) represents one term in the chain rule. Drawing the tree before writing the formula prevents missed terms.

Related rates (multivariable)

Problems where several quantities change with time and you need to find the rate of change of a quantity that depends on all of them. The chain rule provides the framework: dV/dt = (∂V/∂r1)(dr1/dt) + (∂V/∂r2)(dr2/dt) + (∂V/∂h)(dh/dt).

Gradient vector (∇f)

The vector of all first partial derivatives: ∇f =

In simple terms, this means: the gradient answers "which way is uphill, and how steep?"

Directional derivative (Duf)

The rate of change of f in the direction of a unit vector u. Computed as Duf = ∇f · u. If u is not a unit vector, normalise it first.

Think of it as: the slope of the surface if you walk in direction u. Positive means ascending, negative means descending.

Level curve / level surface

The set of points where f takes a constant value. The gradient ∇f is always perpendicular to level curves (in 2D) or level surfaces (in 3D). This perpendicularity is the geometric key to many gradient problems.

Core Content: The Multivariable Chain Rule

General form

  • If z = f(x, y) with x = x(t) and y = y(t), then dz/dt = fx(dx/dt) + fy(dy/dt).

  • If z = f(x, y) with x = x(s, t) and y = y(s, t), then ∂z/∂s = fx(∂x/∂s) + fy(∂y/∂s), and similarly for ∂z/∂t.

  • The pattern generalises to any number of intermediate and independent variables.

Using a tree diagram

  1. Place the dependent variable (z) at the top.

  1. Draw branches to each intermediate variable (x, y).

  1. Draw branches from each intermediate variable to the independent variable(s) (t, or s and t, or r and θ).

  1. Each path from top to bottom contributes a product of derivatives along its edges. Sum all paths to the variable you want.

Converting between coordinate systems

  • A classic application: if z = f(x, y) and x = r cos θ, y = r sin θ, the chain rule gives ∂z/∂r and ∂z/∂θ in terms of fx, fy, and the trigonometric functions.

  • To show the Laplacian identity ∂²z/∂x² + ∂²z/∂y² = ∂²z/∂r² + (1/r²)(∂²z/∂θ²) + (1/r)(∂z/∂r), you apply the chain rule twice and carefully combine second-order terms. This requires computing ∂²z/∂r² and ∂²z/∂θ² using the product rule on the first-order chain-rule expressions.

  • The key intermediate steps are: ∂z/∂r = fx cos θ + fy sin θ, and ∂z/∂θ = -fx r sin θ + fy r cos θ. Differentiating these again (using the chain rule on fx and fy themselves) produces the second-order terms.

Core Content: Related Rates with the Chain Rule

Strategy

  1. Identify the quantity whose rate of change you need (e.g. dV/dt).

  1. Write a formula for that quantity in terms of the changing variables.

  1. Differentiate with respect to time using the chain rule.

  1. Substitute the known values and rates.

Truncated cone example (from the homework)

  • Volume of a truncated right circular cone: V = (πh/3)(r1² + r1 r2 + r2²), where r1 is the larger radius, r2 the smaller, and h the height.

  • Given: dr2/dt = -1 cm/s (decreasing), dr1/dt = 2 cm/s (increasing), dh/dt = -3 cm/s (decreasing).

  • Apply the chain rule: dV/dt = (∂V/∂r1)(dr1/dt) + (∂V/∂r2)(dr2/dt) + (∂V/∂h)(dh/dt).

  • Compute each partial, substitute r1 = 15, r2 = 10, h = 8, and the given rates.

Laplacian in polar coordinates (from the homework)

  • The problem asks you to prove the Laplacian identity by applying the chain rule to z = f(x, y) with x = r cos θ, y = r sin θ.

  • This is an exercise in careful bookkeeping: differentiate ∂z/∂r and ∂z/∂θ a second time, remembering that fx and fy are themselves functions of r and θ through the chain rule.

  • The identity ∂²z/∂x² + ∂²z/∂y² = ∂²z/∂r² + (1/r²)(∂²z/∂θ²) + (1/r)(∂z/∂r) is used throughout physics and engineering wherever problems have circular or radial symmetry.

Core Content: Directional Derivatives and the Gradient

The gradient vector

  • For f(x, y): ∇f =

  • For f(x, y, z): ∇f =

  • The gradient points in the direction of steepest ascent. Its magnitude |∇f| equals the maximum rate of change of f at that point.

  • The direction of steepest descent is -∇f.

The directional derivative

  • Definition: Duf(a, b) = ∇f(a, b) · u, where u is a unit vector.

  • If u is not already a unit vector, normalise: u_hat = u / |u|.

  • Geometric interpretation: Duf is the slope of the surface in the direction u. Positive means ascending, negative means descending, zero means the surface is locally flat in that direction.

Estimating directional derivatives from a table

  • Direct approach: if u = <1, -1>, normalise to u_hat = <1/√2, -1/√2>, then step in the (1, -1) direction in the table and take the difference quotient.

  • Gradient approach: approximate fx and fy from the table using central differences, form ∇f, then compute ∇f · u_hat.

  • These two methods may give slightly different results because the table has finite spacing. Both are valid approximations.

Tangent vectors to the graph

  • If u =

  • Given a tangent vector

Core Content: Applications of the Gradient (Volcano Surface)

Composition and the chain rule for gradients

  • The homework's volcano surface z = 4(x² + 2y²)e^(-(x² + 2y²)) can be written as f(x, y) = h(u(x, y)) where u(x, y) = x² + 2y² and h(u) = 4ue^(-u).

  • By the chain rule: ∇f = h'(u) ∇u.

  • h'(u) = 4e^(-u) - 4ue^(-u) = 4(1 - u)e^(-u).

  • ∇u = <2x, 4y>.

  • So ∇f = 4(1 - u)e^(-u) <2x, 4y> = <8x(1 - x² - 2y²)e^(-(x²+2y²)), 16y(1 - x² - 2y²)e^(-(x²+2y²))>.

Ascent or descent in a given direction

  • At a point on the surface, compute the directional derivative in the walking direction (e.g. northeast = <1/√2, 1/√2>).

  • If Duf > 0, you ascend. If Duf < 0, you descend.

  • The angle φ with respect to the vertical (k-hat) is found from tan(φ) = 1 / Duf (or more precisely, the angle of the tangent vector to the graph with the horizontal gives the steepness).

Finding the rim of the volcano

  • The rim is where the surface reaches a local maximum in the radial direction, which corresponds to h'(u) = 0, i.e. u = 1.

  • Setting x² + 2y² = 1 gives an ellipse in the xy-plane.

  • The height at the rim: h(1) = 4(1)e^(-1) = 4/e ≈ 1.472.

Formulas

\frac{dz}{dt} = \frac{\partial z}{\partial x}\frac{dx}{dt} + \frac{\partial z}{\partial y}\frac{dy}{dt} \quad \text{(chain rule, one parameter)}
\frac{\partial z}{\partial s} = \frac{\partial z}{\partial x}\frac{\partial x}{\partial s} + \frac{\partial z}{\partial y}\frac{\partial y}{\partial s} \quad \text{(chain rule, two parameters)}
\nabla f = \left\langle f_x,\, f_y \right\rangle \quad \text{(gradient, two variables)}
D_{\mathbf{u}} f = \nabla f \cdot \mathbf{u} \quad \text{(directional derivative, u a unit vector)}
V = \frac{\pi h}{3}\left(r_1^2 + r_1 r_2 + r_2^2\right) \quad \text{(truncated cone)}
\frac{\partial^2 z}{\partial x^2} + \frac{\partial^2 z}{\partial y^2} = \frac{\partial^2 z}{\partial r^2} + \frac{1}{r^2}\frac{\partial^2 z}{\partial \theta^2} + \frac{1}{r}\frac{\partial z}{\partial r} \quad \text{(Laplacian in polar)}

Real-World Applications

The gradient is central to machine learning: gradient descent, the workhorse algorithm behind training neural networks, works by repeatedly stepping in the -∇f direction to minimise a loss function. In physics, the gradient of a potential function gives the force field (gravity, electrostatics), and the Laplacian in polar coordinates appears whenever you solve heat, wave, or diffusion equations in systems with circular symmetry, from drum vibrations to heat flow in a pipe.

Common Misconceptions

  • Students often forget to normalise the direction vector before computing a directional derivative. Duf = ∇f · u only works when u is a unit vector. Using an un-normalised vector gives a wrong answer.

  • Students sometimes think the gradient points along the surface. It does not. The gradient of f(x, y) lives in the xy-plane (or the domain), not on the surface z = f(x, y). It points in the direction of steepest ascent in the input space.

  • When using the chain rule in polar coordinates, students often treat fx and fy as constants when differentiating a second time. They are not: fx = fx(x(r,θ), y(r,θ)), so differentiating fx with respect to r requires another application of the chain rule.

  • Students confuse the directional derivative (a scalar) with the gradient (a vector). The directional derivative is the dot product of the gradient with a unit vector; it tells you the rate of change in one particular direction.

Why It Matters / Exam Flags

  • ⚠️ Directional derivative computations are very likely on exams. Practise both the formula Duf = ∇f · u and the table-based estimation until they are automatic.

  • ⚠️ The chain rule in polar coordinates (and the Laplacian proof) is a classic exam and homework problem. You need fluency with second-order chain-rule expansions.

  • ⚠️ Questions that give a tangent vector to a graph and ask for a directional derivative test whether you understand the relationship

  • ⚠️ Composition problems (writing f as h(u(x,y)) and computing ∇f via h'(u)∇u) appear whenever a surface has a symmetric structure. Recognising the composition saves significant algebra.

Quick Self-Test

  1. True or False: The gradient ∇f always points perpendicular to the level curves of f.
    Answer: True.

  1. Fill in the blank: If ∇f(1, 2) = <3, -4>, the maximum rate of change of f at (1, 2) is ___.
    Answer: |∇f| = √(9 + 16) = 5.

  1. True or False: Duf can be larger than |∇f|.
    Answer: False. The directional derivative is maximised in the gradient direction, where it equals |∇f|.

  1. Fill in the blank: If z = f(x, y), x = r cos θ, y = r sin θ, then ∂z/∂θ = ___ · fx + ___ · fy.
    Answer: -r sin θ; r cos θ.

  1. True or False: If <2, 2, 7> is tangent to the graph of f at P, then the directional derivative in the direction <1/√2, 1/√2> is 7/2.
    Answer: True. Normalise the first two components: <2, 2> has magnitude 2√2, giving unit direction <1/√2, 1/√2>. The third component scales the same way: 7/(2√2). Wait, let us re-examine. The vector

Practice Q&A

Q: For the volcano surface z = 4(x² + 2y²)e^(-(x²+2y²)), write f as a composition h(u(x,y)) and compute ∇f.

A: Let u = x² + 2y², h(u) = 4ue^(-u). Then h'(u) = 4(1-u)e^(-u) and ∇u = <2x, 4y>. By the chain rule, ∇f = h'(u)∇u = 4(1 - x² - 2y²)e^(-(x²+2y²)) <2x, 4y>.

Q: A climber stands at (1/2, 1/2, 3e^(-3/4)) on the volcano and walks northeast. Do they ascend or descend?

A: Northeast = <1/√2, 1/√2>. Compute ∇f at (1/2, 1/2): u = 1/4 + 1/2 = 3/4, so h'(3/4) = 4(1/4)e^(-3/4) = e^(-3/4). ∇f = e^(-3/4)<1, 2>. Duf = e^(-3/4)(1/√2 + 2/√2) = 3e^(-3/4)/√2 > 0. The climber ascends.

Q: Find the equation of the curve in the xy-plane where the rim of the volcano projects, and its height.

A: The rim occurs where h'(u) = 0, i.e. u = 1. So x² + 2y² = 1 (an ellipse). Height: h(1) = 4e^(-1) = 4/e.

Q: Using the table in Question 4, approximate the directional derivative of f at (1, 2) in the direction <1, -1> via (i) the table directly and (ii) the gradient.

A: (i) Move one step in the <1, -1> direction from (1, 2) to (2, 1): Duf ≈ (f(2,1) - f(1,2))/(√2) = (19 - 25)/√2 = -6/√2 = -3√2. (ii) Approximate fx(1,2) = (f(2,2) - f(0,2))/(2) = (22 - 26)/2 = -2. Approximate fy(1,2) = (f(1,3) - f(1,1))/(2) = (18 - 22)/2 = -2. ∇f ≈ <-2, -2>. u_hat = <1/√2, -1/√2>. Duf = (-2/√2) - (-2/√2) = 0. The two methods give different results because finite differences are approximations; the table-based approach uses a full step while the gradient approach uses the linearisation at the point.

Connections to Other Topics

The chain rule from Section 14.5 underpins implicit differentiation for multivariable functions and is essential for the change-of-variables techniques in double and triple integrals (Chapter 15). The gradient from Section 14.6 is the foundation for Lagrange multipliers (Section 14.8), where the constraint ∇f = λ∇g uses the fact that two gradients are parallel at a constrained extremum. In vector calculus (Chapters 16-17), the gradient reappears as the building block for divergence, curl, and the fundamental theorems of line and surface integrals.

Related Terms / Search Tags

chain rule multivariable, tree diagram, dependency diagram, related rates, truncated cone volume, Laplacian polar coordinates, gradient vector, nabla, directional derivative, steepest ascent, steepest descent, level curve, level surface, unit vector, normalise direction, composition of functions, h(u(x,y)), volcano surface, rim of volcano, ellipse, Calculus III, MATH 215, Section 14.5, Section 14.6, tangent vector to graph, compass direction derivative