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.

Start here

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:

Duf = fx · u1 + fy · u2 = (fx, fy) · (u1, u2) = ∇f · u

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 saysIt 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 + jthe vector (1, 1) (i means one step in x, j one step in y)
−2jthe vector (0, −2): straight down
−i − 2jthe 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 unknowns

The 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 vector

The formula needs u of length 1, and the given directions aren't. Divide each by its length:

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.

Step 3 · Turn each measurement into an equation

Measurement 1: ∇f · u1 = 2√2, i.e.

a · (1/√2) + b · (1/√2) = 2√2  ⟹  (a + b)/√2 = 2√2  ⟹  a + b = 2√2 · √2 = 4

(Multiply both sides by √2, and use √2 · √2 = 2.)

Measurement 2: ∇f · u2 = −3, i.e.

a · 0 + b · (−1) = −3  ⟹  b = 3

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 ✓.

Step 4 · Answer the question asked

The new direction is (−1, −2), with length √(1 + 4) = √5, so u = (−1/√5, −2/√5). Then

Duf = (1, 3) · (−1/√5, −2/√5) = (−1 − 6)/√5 = −7/√5 ≈ −3.13
Step 5 · "Give reasons": the sentence to write
Write this

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.

The two measured directions, the recovered gradient (1, 3), and the asked direction, drawn at the point P0
All arrows start at P0. Grey: the two measured unit directions. Blue: the recovered gradient (1, 3), the uphill direction. Rust: the direction asked about. It points almost exactly opposite the gradient (about 172° away), so the answer is close to the most negative rate possible, −|∇f| = −√10 ≈ −3.16. Our −3.13 fits.

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 origin

Try 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.

Lines through the origin labelled with the constant value of f on each
The value of f along each line through the origin (computed as cos θ sin θ for the line at angle θ). Walking into the origin along y = x, the height stays ½ the whole way and then suddenly drops to 0 at the origin. That jump is what breaks everything in (b) and (c).
Step 2 · Part (a): the partial derivatives at the origin

fx(0, 0) means: move only in x, a small amount h, and take the school limit.

fx(0, 0) = limh→0 [f(h, 0) − f(0, 0)] / h

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 definition

Same idea as a partial derivative, but step along u: the point h units along u from the origin is (hu1, hu2).

Duf(0, 0) = limh→0 [f(hu1, hu2) − f(0, 0)] / h

First simplify the top. Put x = hu1, y = hu2 into the formula:

f(hu1, hu2) = h2u1u2 / (h2u12 + h2u22) = h2u1u2 / (h2(u12 + u22)) = u1u2

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

[u1u2 − 0] / h = u1u2 / h

Now let h → 0. There are two cases:

u1u2 = 0 means u1 = 0 or u2 = 0. With length 1, that leaves exactly four directions, the axis directions:

Duf(0, 0) exists only for u = (1, 0), (−1, 0), (0, 1), (0, −1), and then it equals 0.

Turn the direction and watch the quotient

Left: the unit direction u on a circle. Right: the difference quotient u1u2/h plotted against h

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.

Step 4 · Part (c): why ∇f · u gives the wrong answer

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:

differentiable ⟹ continuous.   Not continuous ⟹ not differentiable ⟹ Duf = ∇f · u is not guaranteed.

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.

Write this for (c)

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.

Classic trap · the exam version

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

Ask an AI well

"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."