Multivariable calculus

Divergence of the Gradient Field of x^3 - 3x y^2

For F equal to the gradient of x^3 - 3x y^2, that is F(x, y) = (3x^2 - 3y^2, -6xy), the divergence is 0 at every point. Divergence of a gradient is the Laplacian, here 6x plus negative 6x. A function whose Laplacian is zero is called harmonic, and this cubic is the standard first example.

F(x,y)=(x33xy2)=3x23y2, 6xy\mathbf{F}(x,y) = \nabla\left(x^{3}-3xy^{2}\right) = \left\langle 3x^{2}-3y^{2},\ -6xy \right\rangle
Px=x(3x23y2)=6x\frac{\partial P}{\partial x} = \frac{\partial}{\partial x}\left(3x^{2}-3y^{2}\right) = 6x
Qy=y(6xy)=6x\frac{\partial Q}{\partial y} = \frac{\partial}{\partial y}\left(-6xy\right) = -6x
F=6x+(6x)=0\nabla \cdot \mathbf{F} = 6x + (-6x) = 0

Divergence of a gradient is the Laplacian

Start from f(x,y)=x33xy2f(x,y) = x^{3}-3xy^{2}. Its gradient is the field on this page, so the divergence you are computing is a second derivative of ff, not a first derivative of something unrelated.

(f)=2fx2+2fy2=Δf\nabla \cdot \left(\nabla f\right) = \frac{\partial^{2} f}{\partial x^{2}} + \frac{\partial^{2} f}{\partial y^{2}} = \Delta f

So the two diagonal partials of the field are the two pure second partials of ff. Compute them and the cancellation is immediate.

2fx2=6x,2fy2=6x\frac{\partial^{2} f}{\partial x^{2}} = 6x, \qquad \frac{\partial^{2} f}{\partial y^{2}} = -6x

Their sum is 00 at every point, so this gradient field is divergence free and ff is harmonic.

The mistake: concluding f must be constant

A zero answer invites the wrong summary. Nothing here says the field is zero or that ff is flat. At (1,0)(1,0) the field is 3,0\langle 3, 0 \rangle and ff is climbing steadily.

What actually vanishes is the sum of two curvatures that are equal and opposite. Along the xx direction the surface curves upward when x>0x>0; along the yy direction it curves downward by exactly the same amount. Cancellation, not absence.

The second half of the mistake is generalising in the wrong direction: assuming every gradient field is divergence free. It is not. The gradient of x2+y2x^{2}+y^{2} is 2x,2y\langle 2x, 2y \rangle, whose divergence is 44. Being a gradient field says the curl is zero, not the divergence.

Harmonic functions and what they look like

A function with Δf=0\Delta f = 0 is harmonic, and harmonic functions are the steady states of the heat equation: no point is hotter or colder than the average of its neighbours.

  • A non-constant harmonic function has no interior local maximum or minimum, so every critical point it has is a saddle.
  • f(x,y)=x33xy2f(x,y) = x^{3}-3xy^{2} has a single critical point, at the origin, and it is a monkey saddle.
  • The value of ff at the centre of any circle equals its average around that circle.

The cubic x33xy2x^{3}-3xy^{2} earns its place in the textbooks because it is the real part of (x+iy)3(x+iy)^{3}, and the real part of any polynomial in x+iyx+iy is harmonic. The imaginary part is harmonic too: expanding (x+iy)3(x+iy)^{3} gives 3x2yy33x^{2}y-y^{3}, whose two pure second partials are 6y6y and 6y-6y. One cube therefore hands you two different divergence-free gradient fields.

Checked on every build: each component is differentiated numerically with respect to its own variable, and the sum is compared against the divergence above at six sample points.

Frequently asked questions

Does zero divergence mean x^3 - 3x y^2 is constant?

No. It means the two pure second partials, 6x6x and 6x-6x, cancel. The function itself is far from constant: at (1,0)(1,0) it equals 11 and at (2,0)(2,0) it equals 88.

Is every gradient field divergence free?

No. A gradient field always has zero curl, but its divergence is the Laplacian, which is usually nonzero. The gradient of x2+y2x^{2}+y^{2} is 2x,2y\langle 2x, 2y \rangle, with divergence 44.