Multivariable calculus
Gradient of ln(x^2 + y^2 + z^2 + 1) in Three Variables
For f(x, y, z) = ln(x^2 + y^2 + z^2 + 1) the gradient is 2(x, y, z) divided by x^2 + y^2 + z^2 + 1. One chain rule handles all three components, since only the inner derivative changes. The field points radially outward and is longest on the unit sphere, where its length is exactly 1.
One chain rule, three inner derivatives
Write . Every component of is times the corresponding partial of , and those partials are , and .
Doing three variables costs no more thought than doing two. The outer function is differentiated once, and the only per-variable work is the inner derivative, which for a sum of squares is immediate.
At the denominator is , so the gradient is , a vector of length pointing straight out along the diagonal.
Level surfaces are spheres, and the steepest shell is the unit sphere
Since depends only on , the level surfaces are spheres centred at the origin. The gradient is perpendicular to each sphere, which forces it to be radial, and the positive factor makes it point outward.
That length is zero at the origin, which is the global minimum of with value . It then rises, peaks, and decays. By the arithmetic mean and geometric mean inequality, , so the length never exceeds , and it equals exactly when .
So the unit sphere is where this function climbs fastest, and both inside and outside it the surface flattens. Far away the gradient decays like , because out there behaves like : the function keeps rising, but ever more slowly.
The mistake: differentiating the constant, or splitting the denominator
The inside the logarithm exists to keep the argument positive and the function defined at the origin. It contributes nothing to any numerator, since constants differentiate to zero, but it stays in every denominator. Writing silently changes the function to , which blows up at the origin.
The other frequent error is treating the logarithm of a sum as a sum of logarithms, and computing the gradient of instead. That would give for the first component.
There is no logarithm rule for a sum inside. The rules convert products, quotients and powers, and a sum is none of those. Test at the origin: the true gradient is , while is undefined there.
Frequently asked questions
Why do all three components have the same denominator?
The denominator comes from the outer derivative , which is the same object no matter which variable you differentiate. Only the numerator, the inner derivative of , changes from component to component.
Where is this function increasing fastest?
On the unit sphere , where the gradient has length exactly . The length formula is at most for every , with equality only at , so no point in space has a steeper climb than the points on that sphere.