MATH U101 · Tutorial 6 · directional derivatives §14.5
Tutorial 6 Q11–Q12, from Zero
The two hardest questions on Sheet 6, taught as if you'd never seen a directional derivative. Every phrase is translated, every step is written out, and there's one figure or widget per idea. The short solutions are in the tutorial companion. Read this page first. Prefer to listen? The same lesson as a 🎧 10-minute narrated walkthrough.
You only need three things you already have: the dot product (a, b) · (c, d) = ac + bd; the length of a vector |(a, b)| = √(a2 + b2); and the school definition of a derivative, f′(a) = limh→0 [f(a + h) − f(a)]/h. Q11 uses the first two. Q12 uses the third. Both questions are about one formula, Duf = ∇f · u: Q11 uses it, and Q12 shows when it's not allowed.
The one idea behind both questions
Stand at a point on a hilly landscape, where f(x, y) is the height. Pick a direction and take a small step. How fast does the height change, per unit of distance walked? That rate is the directional derivative, written Duf. The direction is a unit vector u = (u1, u2), meaning its length is 1. It has to be, because "per unit distance" only makes sense if the step you measure along is one unit long.
Two special directions you already know: walking along the x-axis, the rate is fx; walking along the y-axis, it is fy. A general direction is part x-step and part y-step: u1 of the step goes along x and u2 along y. For a smooth landscape the two changes simply add:
The pair ∇f = (fx, fy) is called the gradient. It's just the two partial derivatives written as a vector.
The word smooth is doing real work there. The formula needs f to be differentiable at the point: close up, the surface looks like a flat tilted plane. Q11 assumes that. Q12 is a function where it fails, and the formula gives the wrong answer.
Question 11 · Recover the gradient from two readings
The derivative of f(x, y) at P0(1, 2) in the direction of i + j is 2√2 and in the direction of −2j is −3. What is the derivative of f in the direction of −i − 2j? Give reasons for your answer.
Step 0 · Translate the words| The question says | It means |
|---|---|
| "the derivative of f at P0 in the direction of …" | the directional derivative Duf(P0), the rate of change as you walk away from P0 that way |
| i + j | the vector (1, 1) (i means one step in x, j one step in y) |
| −2j | the vector (0, −2): straight down |
| −i − 2j | the vector (−1, −2) |
| "is 2√2", "is −3" | two measurements: we're told the rate in two directions |
We are never told what f is. That's the point: two measurements are enough to work out the gradient, and the gradient gives the rate in every direction.
Step 1 · Name the unknownsThe gradient at P0 is two numbers we don't know yet. Call them ∇f(P0) = (a, b), where a = fx(1, 2) and b = fy(1, 2). Two unknowns need two equations, and the question gives us two measurements.
Step 2 · Make each direction a unit vectorThe formula needs u of length 1, and the given directions aren't. Divide each by its length:
- |(1, 1)| = √(1 + 1) = √2, so u1 = (1/√2, 1/√2).
- |(0, −2)| = 2, so u2 = (0, −1).
Check yourself: what goes wrong if you use (0, −2) as it is?
(a, b) · (0, −2) = −2b, which is twice the true rate. You'd get −2b = −3, b = 3/2, and every answer after that would be wrong. The "−2" in −2j only tells you the direction (down), not a speed.
Measurement 1: ∇f · u1 = 2√2, i.e.
(Multiply both sides by √2, and use √2 · √2 = 2.)
Measurement 2: ∇f · u2 = −3, i.e.
Then a + 3 = 4, so a = 1. The gradient at P0 is (1, 3): the slope is 1 in the x-direction and 3 in the y-direction.
Check yourself: does (1, 3) really reproduce the first measurement?
(1, 3) · (1/√2, 1/√2) = 4/√2. Multiply top and bottom by √2: 4√2/2 = 2√2 ✓. And (1, 3) · (0, −1) = −3 ✓.
The new direction is (−1, −2), with length √(1 + 4) = √5, so u = (−1/√5, −2/√5). Then
Assuming f is differentiable at P0, Duf = ∇f(P0) · u for every unit vector u. The two given directions are not parallel, so the two readings give two independent equations that fix both components of ∇f(P0) = (1, 3). Then the derivative along −i − 2j is (1, 3) · (−1, −2)/√5 = −7/√5.
Why "not parallel" matters: if both readings were along the same line (say j and −2j), they would both only tell you b, and a could be anything.
Question 12 · When ∇f · u lies
Consider the function f : ℝ2 → ℝ defined by f(x, y) = xy/(x2 + y2) for (x, y) ≠ (0, 0), and 0 for (x, y) = (0, 0). Let u = ⟨u1, u2⟩ be a unit vector (u12 + u22 = 1). (a) Show that fx(0, 0) and fy(0, 0) exist and find their values. (b) Determine all unit vectors u for which Duf(0, 0) exists using the limit definition. (c) Explain why the formula Duf = ∇f · u cannot be used here.
Step 0 · What kind of function is this?It's a piecewise function: one formula everywhere except the origin, and a separate value, 0, at the origin. The formula can't be used at (0, 0) because it gives 0/0. So at the origin the quotient rule, the gradient formula and every shortcut are unavailable. The only tool is the definition, the same limit you used for derivatives in school.
Step 1 · See the function: it's constant along every line through the originTry some points. On the x-axis, f(x, 0) = 0/x2 = 0. On the line y = x: f(t, t) = t2/(2t2) = ½ for every t ≠ 0, however close to the origin. On y = −x it is always −½. Each line through the origin carries its own constant value, and at the origin itself the value is 0.
fx(0, 0) means: move only in x, a small amount h, and take the school limit.
The point (h, 0) is not the origin (since h ≠ 0), so use the formula: f(h, 0) = h · 0/(h2 + 0) = 0. And f(0, 0) = 0 is given. So the quotient is (0 − 0)/h = 0 for every h, and its limit is 0. Exactly the same happens along the y-axis: fy(0, 0) = 0. Both exist, and both equal 0, because f is 0 all along both axes.
Step 3 · Part (b): the directional derivative from the definitionSame idea as a partial derivative, but step along u: the point h units along u from the origin is (hu1, hu2).
First simplify the top. Put x = hu1, y = hu2 into the formula:
The h2 cancels, and u12 + u22 = 1 because u is a unit vector. This is Step 1's picture as algebra: along the line in direction u, f is the constant u1u2. So the quotient is
Now let h → 0. There are two cases:
- If u1u2 ≠ 0, a fixed non-zero number is divided by something shrinking to 0. Take u = (1/√2, 1/√2), where u1u2 = ½: at h = 0.1 the quotient is 5, at 0.01 it's 50, at 0.001 it's 500, and at h = −0.01 it's −50. It blows up, with opposite signs on the two sides, so there is no limit.
- If u1u2 = 0, the quotient is 0/h = 0 for every h, so the limit is 0.
u1u2 = 0 means u1 = 0 or u2 = 0. With length 1, that leaves exactly four directions, the axis directions:
Drag the slider. At every angle except 0°, 90° and 180°, the right-hand graph is a hyperbola, shooting up on one side of h = 0 and down on the other, so no single value is approached. On an axis direction it flattens into the line 0, and the limit exists.
Check yourself: what is the quotient along u = (3/5, 4/5) when h = 0.01?
u1u2 = 12/25 = 0.48, so the quotient is 0.48/0.01 = 48. At h = 0.001 it's 480, so there's no limit.
From part (a), ∇f(0, 0) = (fx, fy) = (0, 0). If the formula worked, it would say Duf(0, 0) = (0, 0) · u = 0 in every direction. Part (b) showed the truth: in most directions the directional derivative doesn't even exist. So the formula must have a condition, and here it isn't met.
The condition is differentiability: close up, the surface must look like a flat plane. This f is nowhere near that at the origin. It isn't even continuous there, because along y = x the values stay at ½ right up to the origin, where the value is 0 (Step 1's jump). The chain of facts is:
The lesson the question is built around: having both partial derivatives is not enough. The partials only look along the two axes, and this function behaves perfectly along the axes (it's 0 there) while jumping in between.
The formula Duf = ∇f · u holds only where f is differentiable. Here f is not even continuous at (0, 0): along y = x, f = ½ → ½ ≠ 0 = f(0, 0). So f is not differentiable there. The formula would predict (0, 0) · u = 0 in every direction, but by (b) the directional derivative exists only along the axes.
Piecewise function + "at (0, 0)" means definitions only. The past mid-sems ask exactly this: 2024 Q3(a) (x2y/(x6 + y2)) and 2025 Q1. Differentiating the formula and putting in (0, 0) gives 0/0. Using ∇f · u there gives a confident wrong answer. Both score zero.
The two questions in one line each
- Q11: when f is smooth, the gradient is two unknown numbers, each measured rate is one equation (after making the direction unit), and once you know ∇f you know the rate in every direction.
- Q12: at a piecewise point, use the definition. If the function jumps there, ∇f · u is not allowed, even though the partials exist.
"The rate of f at P in the direction of 3i + 4j is 2 and in the direction of j is 1. Don't solve it. Ask me for the two equations I'd write, then check them."
"Give me a piecewise function like xy/(x² + y²) that is 0 at the origin. Ask me for Duf(0, 0) from the definition, and stop me if I use the gradient formula."