Multivariable calculus

Gradient of x^3 - 3xy^2: Monkey Saddle Worked Out

For f(x, y) = x^3 - 3xy^2 the gradient is (3x^2 - 3y^2, -6xy). At the point (2, 1) it equals (9, -12), a vector of length 15. The gradient is zero only at the origin, where the surface forms a monkey saddle with three rising and three falling directions.

f(x,y)=x33xy2f(x,y) = x^3 - 3xy^2
f(x,y)=3x23y2, 6xy\nabla f(x,y) = \left\langle 3x^2 - 3y^2,\ -6xy \right\rangle
fx=3x23y2\frac{\partial f}{\partial x} = 3x^2 - 3y^2
fy=6xy\frac{\partial f}{\partial y} = -6xy

Take the mixed term apart one variable at a time

The term 3xy2-3xy^2 contains both variables, so it contributes to both partials, just in different ways. Holding yy fixed makes 3y2-3y^2 a coefficient in front of xx.

fx=x(x3)3y2x(x)=3x23y2\frac{\partial f}{\partial x} = \frac{\partial}{\partial x}\left(x^3\right) - 3y^2 \cdot \frac{\partial}{\partial x}\left(x\right) = 3x^2 - 3y^2

Now hold xx fixed. The x3x^3 term is a constant and disappears, while 3x-3x becomes the coefficient in front of y2y^2.

fy=03xy(y2)=6xy\frac{\partial f}{\partial y} = 0 - 3x \cdot \frac{\partial}{\partial y}\left(y^2\right) = -6xy
f(x,y)=3x23y2, 6xy\nabla f(x,y) = \left\langle 3x^2 - 3y^2,\ -6xy \right\rangle

At (2,1)(2,1): 3(4)3(1)=93(4) - 3(1) = 9 and 6(2)(1)=12-6(2)(1) = -12, so f(2,1)=9,12\nabla f(2,1) = \langle 9, -12\rangle with f=81+144=15\left|\nabla f\right| = \sqrt{81 + 144} = 15.

The mistake: letting the mixed term vanish from one partial

The most common wrong answer is f=3x2,6xy\nabla f = \langle 3x^2, -6xy\rangle, dropping 3y2-3y^2 from the xx-component. The reasoning behind the slip is that y2y^2 is a constant when yy is frozen, so surely it differentiates to zero.

It does not, because y2y^2 is not standing alone. It is multiplied by xx, and xx is the live variable. A constant times xx differentiates to that constant, not to zero. Compare ddx(7)=0\frac{d}{dx}(7) = 0 with ddx(7x)=7\frac{d}{dx}(7x) = 7.

  • A term dies under x\frac{\partial}{\partial x} only if it contains no xx at all.
  • 3xy2-3xy^2 contains xx, so it survives in fx\frac{\partial f}{\partial x} as 3y2-3y^2.
  • Sanity check at (0,1)(0,1): f(x,1)=x33xf(x,1) = x^3 - 3x has derivative 3x233x^2 - 3, which is 3-3 at x=0x = 0. The formula gives 3(0)3(1)=33(0) - 3(1) = -3, so it agrees.

One critical point, and a surface that goes up three ways

Set both components to zero. From 6xy=0-6xy = 0 you get x=0x = 0 or y=0y = 0. If x=0x = 0, the first equation gives 3y2=0-3y^2 = 0, so y=0y = 0. If y=0y = 0, it gives 3x2=03x^2 = 0, so x=0x = 0. The origin is the only critical point.

In polar coordinates f=r3cos3θf = r^3\cos 3\theta, which oscillates three times as you circle the origin. That is the monkey saddle: three directions where the surface rises and three where it falls, so the animal gets grooves for two legs and a tail.

This function is also harmonic, meaning its two pure second partials cancel.

2fx2+2fy2=6x+(6x)=0\frac{\partial^2 f}{\partial x^2} + \frac{\partial^2 f}{\partial y^2} = 6x + (-6x) = 0

Frequently asked questions

Why does the second derivative test fail at the origin here?

At (0,0)(0,0) every second partial is zero, so D=fxxfyyfxy2=0D = f_{xx}f_{yy} - f_{xy}^2 = 0 and the test is inconclusive. You classify the point directly instead: f(x,0)=x3f(x,0) = x^3 changes sign through the origin, so it is neither a maximum nor a minimum.

Where does the gradient of x^3 - 3xy^2 point purely along the y-axis?

You need 3x23y2=03x^2 - 3y^2 = 0 with 6xy0-6xy \ne 0, so y=±xy = \pm x with x0x \ne 0. Along the diagonals the gradient is 0,6xy\langle 0, -6xy\rangle, which is vertical.