Multivariable calculus
Divergence of F = (x, y, z) / (x^2 + y^2 + z^2 + 1)
For F = (x, y, z) divided by x^2 + y^2 + z^2 + 1, write r squared for x^2 + y^2 + z^2. The divergence is (r squared plus 3) divided by (r squared plus 1) squared. Each quotient rule contributes r squared plus 1 minus twice one coordinate square, and adding the three collapses them into a single r squared.
One quotient rule, then relabel twice
Let and , so the field is . Every component has the same denominator, and that denominator depends on all three variables.
The field is symmetric in the three variables, so the other two partials are the same formula with or in place of . Write them down rather than repeating the work.
Now add. Three copies of appear, and the three squares reassemble into .
The mistake: using symmetry to multiply by three
Symmetry is real here, and it is tempting to compute once and then triple it. That gives , which is wrong except on the cone , the one place where subtracting three times happens to match subtracting , and once each.
Test it at , where and . The correct divergence is , while tripling the first partial gives . Not close.
What symmetry actually buys you is permission to relabel, not permission to multiply. Swapping and throughout turns the first partial into the second, so you may copy the formula with new letters and then add three different expressions.
Reading the answer, and the field it is smoothing
The divergence depends only on , which it must, since the field itself only knows about distance from the origin. At the origin it equals , matching the plain radial field that this one imitates near the centre.
For large the numerator grows like and the denominator like , so the divergence decays like . It is positive at every point, so the whole of space is a source, most strongly near the origin.
Compare the genuine inverse square field , the one gravity and electrostatics use. Its divergence is everywhere it is defined, with the entire source crushed into the undefined point at the origin. Replacing with spreads that source out and makes the field defined everywhere.
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 can I not compute one partial and multiply by three?
Because the three partials differ: they subtract , and respectively. At the true value is about and the tripled one about .
What is the divergence at the origin?
It is . Setting gives , the same value as the simple radial field , which this field resembles near the origin.