Multivariable calculus

Divergence of F = (x, y) / (x^2 + y^2 + 1)

For F(x, y) = (x, y) divided by x^2 + y^2 + 1, the divergence is 2 divided by (x^2 + y^2 + 1) squared. Each quotient rule leaves a term in x squared and one in y squared, and those cancel when the two partials are added. The divergence is positive everywhere but decays fast away from the origin.

F(x,y)=x, yx2+y2+1\mathbf{F}(x,y) = \frac{\langle x,\ y \rangle}{x^{2}+y^{2}+1}
Px=y2+1x2(x2+y2+1)2\frac{\partial P}{\partial x} = \frac{y^{2}+1-x^{2}}{\left(x^{2}+y^{2}+1\right)^{2}}
Qy=x2+1y2(x2+y2+1)2\frac{\partial Q}{\partial y} = \frac{x^{2}+1-y^{2}}{\left(x^{2}+y^{2}+1\right)^{2}}
F=2(x2+y2+1)2\nabla \cdot \mathbf{F} = \frac{2}{\left(x^{2}+y^{2}+1\right)^{2}}

Quotient rule on each component, then add the numerators

Write D=x2+y2+1D = x^{2}+y^{2}+1 for the shared denominator. Both components are something over DD, and DD depends on both variables, so the quotient rule is unavoidable.

x(xD)=1Dx2xD2=y2+1x2D2\frac{\partial}{\partial x}\left(\frac{x}{D}\right) = \frac{1 \cdot D - x \cdot 2x}{D^{2}} = \frac{y^{2}+1-x^{2}}{D^{2}}

The second partial is the same computation with the roles of xx and yy exchanged, which you may write down directly rather than redo.

y(yD)=1Dy2yD2=x2+1y2D2\frac{\partial}{\partial y}\left(\frac{y}{D}\right) = \frac{1 \cdot D - y \cdot 2y}{D^{2}} = \frac{x^{2}+1-y^{2}}{D^{2}}

The denominators already match, so add the numerators. The x2x^{2} terms cancel, the y2y^{2} terms cancel, and only 1+11+1 survives.

F=(y2+1x2)+(x2+1y2)D2=2D2\nabla \cdot \mathbf{F} = \frac{\left(y^{2}+1-x^{2}\right)+\left(x^{2}+1-y^{2}\right)}{D^{2}} = \frac{2}{D^{2}}

The mistake: treating the denominator as a constant

In the first component the numerator is a bare xx, so it is easy to differentiate that and leave DD alone, reporting 1D\frac{1}{D}. But DD contains x2x^{2}, so it changes as xx changes and the quotient rule owes you a second term.

Skipping it gives 2D\frac{2}{D} for the divergence, which is too large by a factor of DD. It is right only at the origin, where D=1D = 1, and the factor it is out by grows without bound as you move outward.

A quick self-test before you differentiate: circle every appearance of the variable you are working in. In xx2+y2+1\frac{x}{x^{2}+y^{2}+1} you should circle two of them, not one.

What the +1 in the denominator is doing

Drop the 11 and you get the classic plane field x,yx2+y2\frac{\langle x, y \rangle}{x^{2}+y^{2}}, whose arrows point outward with length 1r\frac{1}{r}. Run the same two quotient rules on it and the numerators come out as y2x2y^{2}-x^{2} and x2y2x^{2}-y^{2}, which cancel completely.

So that field has divergence 00 everywhere except the origin, where it is undefined. The whole source sits at the single point the formula cannot see, which is why the divergence theorem needs care on any region that contains the origin.

Adding 11 smooths that puncture away. The field is now defined at the origin, the divergence is 22 there, and it falls off like 2r4\frac{2}{r^{4}} for large rr, so the source is spread over the whole plane instead of concentrated at a point.

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 does the final answer contain no x or y in the numerator?

Because the two numerators are y2+1x2y^{2}+1-x^{2} and x2+1y2x^{2}+1-y^{2}. Adding them cancels both squared terms and leaves the constant 22, though the denominator still depends on position.

What happens if the +1 is removed?

The field x,yx2+y2\frac{\langle x, y \rangle}{x^{2}+y^{2}} has divergence 00 at every point where it is defined, and is undefined at the origin. Removing the 11 moves all the source behaviour to that one puncture.