Multivariable calculus

Partial Derivatives of ln(x^2 + y^2 + z^2 + 1)

For f(x,y,z) = ln(x^2 + y^2 + z^2 + 1), the partial derivative with respect to x is 2x divided by (x^2 + y^2 + z^2 + 1), and the y and z partials are the same with 2y and 2z on top. The log chain rule puts the whole inside function in the denominator every time.

f(x,y,z)=ln(x2+y2+z2+1)f(x,y,z) = \ln\left(x^2 + y^2 + z^2 + 1\right)
fx=2xx2+y2+z2+1\frac{\partial f}{\partial x} = \frac{2x}{x^2 + y^2 + z^2 + 1}
fy=2yx2+y2+z2+1\frac{\partial f}{\partial y} = \frac{2y}{x^2 + y^2 + z^2 + 1}
fz=2zx2+y2+z2+1\frac{\partial f}{\partial z} = \frac{2z}{x^2 + y^2 + z^2 + 1}

The log chain rule in three variables

Set u=x2+y2+z2+1u = x^2 + y^2 + z^2 + 1, so that f=lnuf = \ln u. The derivative of lnu\ln u is 1u\frac{1}{u} times the derivative of uu, and that is true one variable at a time exactly as it is in single variable calculus.

fx=1uux=2xx2+y2+z2+1\frac{\partial f}{\partial x} = \frac{1}{u}\cdot\frac{\partial u}{\partial x} = \frac{2x}{x^2 + y^2 + z^2 + 1}

Holding yy and zz fixed makes y2+z2+1y^2 + z^2 + 1 a constant, whose derivative is zero, so only x2x^2 contributes to the numerator. The denominator is never touched by differentiation: it is always the full inside function, all four terms of it.

The other two follow by symmetry, since the inside function treats the three variables identically. Only the numerator changes.

The mistake: differentiating the denominator too

A frequent wrong answer is 2x2x\frac{2x}{2x}, or some other version where the denominator has been differentiated along with the numerator. The rule is uu\frac{u'}{u}: the bottom stays as the original inside function, untouched.

The other slip is dropping the y2+z2+1y^2 + z^2 + 1 from the denominator because those variables are being held constant. Held constant means not differentiated, not deleted. All four terms remain downstairs in every one of the three answers.

  • Wrong: 2x2x\frac{2x}{2x}, where the denominator was differentiated.
  • Wrong: 2xx2+1\frac{2x}{x^2 + 1}, where the constant variables were dropped.
  • Right: 2xx2+y2+z2+1\frac{2x}{x^2 + y^2 + z^2 + 1}.

Why the constant 1 matters, and where the gradient points

Without the +1+1 the function would be undefined at the origin, since ln0\ln 0 does not exist. The +1+1 keeps the inside function at least 11 everywhere, so ff and all its partial derivatives are defined and smooth on the whole of three dimensional space.

Reading the three answers as one vector shows the structure: the gradient is a positive scalar times the position vector, so it points straight away from the origin. That fits the geometry, because the level surfaces of ff are spheres centred at the origin and the gradient is perpendicular to them.

f=2x2+y2+z2+1x,y,z\nabla f = \frac{2}{x^2 + y^2 + z^2 + 1}\,\langle x, y, z \rangle

At (1,1,1)(1,1,1) the denominator is 44, so each partial derivative equals 12\frac{1}{2} and the gradient is 12,12,12\langle \tfrac12, \tfrac12, \tfrac12 \rangle. At the origin the gradient is the zero vector, which makes the origin the only critical point.

Frequently asked questions

Does the base of the logarithm change the answer?

Yes, by a constant factor. For log10\log_{10} you divide by ln10\ln 10, so the xx partial becomes 2x(x2+y2+z2+1)ln10\frac{2x}{(x^2 + y^2 + z^2 + 1)\ln 10}. On this page ln\ln means the natural logarithm, so no extra factor appears.

Where is this partial derivative largest?

Along the xx axis, at x=1x = 1. Setting y=z=0y = z = 0 leaves 2xx2+1\frac{2x}{x^2+1}, which peaks at x=1x = 1 with value 11. Far from the origin the denominator grows faster than the numerator, so the partial derivative decays back toward zero.