Multivariable calculus

Directional derivative of x^2 y at (1, 2)

At the point (1, 2) the gradient of f(x,y) = x^2 y is (4, 1). Dotting that with the unit direction (0.6, 0.8) gives a directional derivative of 16/5, which is 3.2. That number is the rate of change of f per unit of distance moved from (1, 2) in that direction.

f(x,y)=x2yf(x,y) = x^2 y
Duf(1,2)=165=3.2D_{\mathbf{u}} f(1,2) = \frac{16}{5} = 3.2

At x = 1, y = 2, in the unit direction (0.6, 0.8).

Gradient first, then one dot product

A directional derivative in a unit direction u=u1,u2\mathbf{u} = \langle u_1, u_2 \rangle is nothing more than the gradient dotted with that direction. There is no new differentiation rule to learn.

Duf=fu=fxu1+fyu2D_{\mathbf{u}} f = \nabla f \cdot \mathbf{u} = \frac{\partial f}{\partial x} u_1 + \frac{\partial f}{\partial y} u_2

Treat yy as a constant to get fx=2xy\frac{\partial f}{\partial x} = 2xy, then treat xx as a constant to get fy=x2\frac{\partial f}{\partial y} = x^2. Evaluate both at the point before you dot, not after.

f(1,2)=4,1,Duf(1,2)=4(0.6)+1(0.8)=165\nabla f(1,2) = \langle 4, 1 \rangle, \qquad D_{\mathbf{u}} f(1,2) = 4(0.6) + 1(0.8) = \frac{16}{5}

The direction has to be a unit vector

This is the mistake that costs the most marks. If the question hands you the direction 3,4\langle 3, 4 \rangle and you dot with it as given, you get 4(3)+1(4)=164(3) + 1(4) = 16, which is five times too large. Divide by the length first.

u=3,43,4=35,45\mathbf{u} = \frac{\langle 3, 4 \rangle}{\lVert \langle 3, 4 \rangle \rVert} = \left\langle \frac{3}{5}, \frac{4}{5} \right\rangle

The reason is what the number means: change in ff per unit of distance travelled. A vector of length 5 walks five units for every one unit the formula assumes, so the rate comes out scaled by 5.

How 3.2 compares with the steepest rate

The largest directional derivative at a point is the length of the gradient there, and it happens in the gradient's own direction. Here f(1,2)=174.123\lVert \nabla f(1,2) \rVert = \sqrt{17} \approx 4.123.

Duf=fcosθ=17cosθD_{\mathbf{u}} f = \lVert \nabla f \rVert \cos\theta = \sqrt{17}\,\cos\theta
  • Steepest ascent direction: 4,1/170.970,0.243\langle 4, 1 \rangle / \sqrt{17} \approx \langle 0.970, 0.243 \rangle
  • Our direction sits about 39.1 degrees away from that, so cosθ0.776\cos\theta \approx 0.776
  • 17×0.7763.1995\sqrt{17} \times 0.776 \approx 3.1995, which is the answer above up to the rounding in the cosine

The build re-checks that (0.6, 0.8) has length 1, rebuilds the gradient of x^2 y at (1, 2) by central differences on the function itself, and fails unless that gradient dotted with the direction is still 3.2 to within a relative 1e-4.

Frequently asked questions

What happens if I dot with (3, 4) instead of (0.6, 0.8)?

You get 16 instead of 3.2. The two vectors point the same way, but only the unit one measures change per unit distance. Always normalise before the dot product.

Can the directional derivative here ever be larger than 3.2?

Yes. The maximum over all unit directions is f(1,2)=174.123\lVert \nabla f(1,2) \rVert = \sqrt{17} \approx 4.123, reached in the direction of the gradient 4,1\langle 4, 1 \rangle itself.