Multivariable calculus

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

At (1, 2) the exponent 2x - y equals 0, so f equals 1 there and the gradient is (2, -1). Dotting with the unit direction (-0.8, 0.6) gives -11/5, that is -2.2. The value is negative because that direction points almost straight down the surface.

f(x,y)=e2xyf(x,y) = e^{2x - y}
Duf(1,2)=115=2.2D_{\mathbf{u}} f(1,2) = -\frac{11}{5} = -2.2

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

One exponential, two chain factors

The exponential reproduces itself and each partial multiplies by the partial of the exponent. Here the exponent 2xy2x - y contributes 22 in the xx slot and 1-1 in the yy slot.

f=2e2xy,  e2xy\nabla f = \left\langle 2e^{2x-y},\; -e^{2x-y} \right\rangle

At (1,2)(1,2) the exponent is 2(1)2=02(1) - 2 = 0, so the common factor e0e^{0} is 1 and the gradient is simply 2,1\langle 2, -1 \rangle. Choosing a point on the line y=2xy = 2x is what makes the arithmetic clean.

Duf(1,2)=2(0.8)+(1)(0.6)=1.60.6=115D_{\mathbf{u}} f(1,2) = 2(-0.8) + (-1)(0.6) = -1.6 - 0.6 = -\frac{11}{5}

The mistake: losing the 2 or the minus

Writing fx=e2xy\frac{\partial f}{\partial x} = e^{2x-y} without the 2 gives a gradient of 1,1\langle 1, -1 \rangle and an answer of 1.4-1.4. Writing fy=e2xy\frac{\partial f}{\partial y} = e^{2x-y} without the minus gives 2,1\langle 2, 1 \rangle and an answer of 1.0-1.0. Neither is close.

There is also a reading mistake. A negative directional derivative does not mean the function is negative; e2xye^{2x-y} is positive everywhere. It means the value is falling as you move that way, from 1 toward smaller positive numbers.

You can see why from the exponent alone. Moving along 0.8,0.6\langle -0.8, 0.6 \rangle decreases 2x2x and increases yy, so 2xy2x - y drops and the exponential follows it down.

Close to the steepest descent

The fastest decrease at a point runs along f-\nabla f, at rate f-\lVert \nabla f \rVert. Here that is 52.2361-\sqrt{5} \approx -2.2361, in the direction 2,1/50.894,0.447\langle -2, 1 \rangle / \sqrt{5} \approx \langle -0.894, 0.447 \rangle.

  • Our direction 0.8,0.6\langle -0.8, 0.6 \rangle is about 10.3 degrees off that steepest descent direction
  • The rate 2.2-2.2 is therefore about 98.4 percent of the fastest possible drop
  • Any direction perpendicular to 2,1\langle 2, -1 \rangle, such as 1,2/5\langle 1, 2 \rangle / \sqrt{5}, gives exactly 0

The level curves are the lines 2xy=c2x - y = c, which is why a whole family of points shares the same behaviour along a fixed direction.

The build re-checks that (-0.8, 0.6) has length 1, rebuilds the gradient of e^(2x - y) at (1, 2) by central differences on the function itself, and fails unless the dot product is still -2.2.

Frequently asked questions

Why is the gradient exactly (2, -1) and not something with an e in it?

Because the point (1,2)(1,2) sits on the line 2xy=02x - y = 0, where the common factor e2xye^{2x-y} equals 1. At (2,2)(2,2) the same formulas give 2e2,e2\langle 2e^{2}, -e^{2} \rangle instead.

What is the most negative directional derivative possible at (1, 2)?

It is 52.236-\sqrt{5} \approx -2.236, reached in the direction 2,1/5\langle -2, 1 \rangle / \sqrt{5}. Our value of 2.2-2.2 is only just above that floor.