Multivariable calculus

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

For F(x, y) = (x^2 y, x y^2) the divergence is 4xy. Differentiating x^2 y with respect to x gives 2xy, differentiating x y^2 with respect to y gives 2xy, and the two add. The result is positive in the first and third quadrants, where the field spreads, and negative in the other two.

F(x,y)=x2y, xy2\mathbf{F}(x,y) = \left\langle x^{2}y,\ xy^{2} \right\rangle
Px=x(x2y)=2xy\frac{\partial P}{\partial x} = \frac{\partial}{\partial x}\left(x^{2}y\right) = 2xy
Qy=y(xy2)=2xy\frac{\partial Q}{\partial y} = \frac{\partial}{\partial y}\left(xy^{2}\right) = 2xy
F=2xy+2xy=4xy\nabla \cdot \mathbf{F} = 2xy + 2xy = 4xy

Treat the other variable as a coefficient

In x(x2y)\frac{\partial}{\partial x}\left(x^{2}y\right) the letter yy is frozen. Frozen means it behaves like the 77 in 7x27x^{2}, so it rides out front while you differentiate x2x^{2}.

x(x2y)=yx(x2)=y2x=2xy\frac{\partial}{\partial x}\left(x^{2}y\right) = y \cdot \frac{\partial}{\partial x}\left(x^{2}\right) = y \cdot 2x = 2xy

The second component is the mirror image, with xx frozen instead.

y(xy2)=xy(y2)=x2y=2xy\frac{\partial}{\partial y}\left(xy^{2}\right) = x \cdot \frac{\partial}{\partial y}\left(y^{2}\right) = x \cdot 2y = 2xy

Now add. The two terms happen to be identical, so F=2xy+2xy=4xy\nabla \cdot \mathbf{F} = 2xy + 2xy = 4xy.

The mistake: stopping at 2xy

This is the single most common wrong answer on this field, and it is not a calculus error. It is a bookkeeping error. The two partials come out looking the same, and one of them quietly gets treated as a repeat of the other rather than as a second term to add.

Guard against it by writing both partials on their own line before you sum anything, and by counting: a plane field always contributes exactly two terms to the divergence, even when they are twins.

The other slip is inventing a product rule term. Some students write x(x2y)=2xy+x2dydx\frac{\partial}{\partial x}\left(x^{2}y\right) = 2xy + x^{2}\frac{dy}{dx}. There is no dydx\frac{dy}{dx} here: xx and yy are independent inputs, not linked by a curve, so the extra term is zero and should never be written.

Reading the sign off the quadrant

Because the answer factors as 4xy4xy, its sign is decided by the signs of the coordinates alone.

  • First quadrant, x>0x>0 and y>0y>0: divergence positive, the field acts as a source.
  • Third quadrant, x<0x<0 and y<0y<0: the product is positive again, so also a source.
  • Second and fourth quadrants: divergence negative, the field acts as a sink.
  • On either axis, x=0x=0 or y=0y=0: divergence exactly zero.

The two coordinate axes form the dividing curve between source behaviour and sink behaviour. This is the sort of picture you can sketch straight from the algebra, without plotting a single arrow.

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

Why is there no product rule term for y when differentiating x^2 y?

Because yy is an independent input, not a function of xx. Holding it fixed makes x2yx^{2}y a constant multiple of x2x^{2}, so the derivative is just 2xy2xy.

Where is this field divergence free?

Exactly on the coordinate axes. Setting 4xy=04xy = 0 forces x=0x = 0 or y=0y = 0, so the field neither sources nor sinks along either axis.