Multivariable calculus

Divergence of F = (x^2 y, y^2 z, z^2 x)

For F(x, y, z) = (x^2 y, y^2 z, z^2 x) the divergence is 2xy + 2yz + 2zx. Each component is differentiated with respect to its own variable only: x^2 y gives 2xy, y^2 z gives 2yz, and z^2 x gives 2zx. The cyclic structure of the field carries straight through to the answer.

F(x,y,z)=x2y, y2z, z2x\mathbf{F}(x,y,z) = \left\langle x^{2}y,\ y^{2}z,\ z^{2}x \right\rangle
Px=x(x2y)=2xy\frac{\partial P}{\partial x} = \frac{\partial}{\partial x}\left(x^{2}y\right) = 2xy
Qy=y(y2z)=2yz\frac{\partial Q}{\partial y} = \frac{\partial}{\partial y}\left(y^{2}z\right) = 2yz
Rz=z(z2x)=2zx\frac{\partial R}{\partial z} = \frac{\partial}{\partial z}\left(z^{2}x\right) = 2zx
F=2xy+2yz+2zx\nabla \cdot \mathbf{F} = 2xy + 2yz + 2zx

Three components, three diagonal partials, one sum

In three dimensions the rule extends by one term and changes in no other way.

F=Px+Qy+Rz\nabla \cdot \mathbf{F} = \frac{\partial P}{\partial x} + \frac{\partial Q}{\partial y} + \frac{\partial R}{\partial z}

Each component is a square times a single other variable, so the other variable is a frozen coefficient and only the square gets differentiated.

x(x2y)=2xy,y(y2z)=2yz,z(z2x)=2zx\frac{\partial}{\partial x}\left(x^{2}y\right) = 2xy, \qquad \frac{\partial}{\partial y}\left(y^{2}z\right) = 2yz, \qquad \frac{\partial}{\partial z}\left(z^{2}x\right) = 2zx

Adding gives 2xy+2yz+2zx2xy + 2yz + 2zx, or 2(xy+yz+zx)2(xy+yz+zx) if you prefer it factored. That grouping is worth keeping, because it makes the sign analysis below much easier.

The mistake: pairing a component with the wrong variable

A 3D field has nine first partial derivatives. Divergence uses three of them, the ones on the diagonal, and the cyclic naming here makes it unusually easy to grab the wrong one.

The classic wrong move is differentiating y2zy^{2}z with respect to zz, because zz is sitting right there in the expression. That yields y2y^{2}, and the answer 2xy+y2+2zx2xy + y^{2} + 2zx is wrong at almost every point.

Label before you differentiate. Write P=x2yP = x^{2}y, Q=y2zQ = y^{2}z, R=z2xR = z^{2}x on their own lines, then attach xx to PP, yy to QQ, zz to RR. The position of the component in the list, not the letters inside it, decides the variable.

The other nine-partials trap is summing everything. Adding all nine is not a divergence, not a curl, and not any object that appears in the course.

Where this field sources and where it sinks

Factored, the divergence is 2(xy+yz+zx)2(xy+yz+zx), so its sign is the sign of the symmetric expression xy+yz+zxxy+yz+zx.

  • At (1,1,1)(1,1,1) the divergence is 2(1+1+1)=62(1+1+1) = 6, a strong source.
  • At (1,1,1)(1,-1,1) it is 2(11+1)=22(-1-1+1) = -2, a sink.
  • At (1,1,12)(1,1,-\tfrac{1}{2}) it is 2(11212)=02(1-\tfrac{1}{2}-\tfrac{1}{2}) = 0.

The surface xy+yz+zx=0xy+yz+zx = 0 is a cone through the origin, and it is exactly the dividing wall between source regions and sink regions. Points with all three coordinates of the same sign always sit strictly inside a source region.

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

How many partial derivatives does a 3D divergence need?

Three of the nine. Only Px\frac{\partial P}{\partial x}, Qy\frac{\partial Q}{\partial y} and Rz\frac{\partial R}{\partial z} appear. The other six carry the curl information and play no part here.

Is this field ever divergence free?

Yes, on the cone xy+yz+zx=0xy+yz+zx = 0. That includes the origin and points such as (1,1,12)(1,1,-\tfrac{1}{2}), where the three products sum to zero.