Multivariable calculus

Gradient of 1/sqrt(1 + x^2 + y^2 + z^2): Inward Field

For f(x, y, z) = 1/sqrt(1 + x^2 + y^2 + z^2) the gradient is minus (x, y, z) divided by (1 + x^2 + y^2 + z^2)^(3/2). Every component is negative when the coordinate is positive, so the vector points back toward the origin, where f reaches its maximum of 1. At (1, 1, 1) it is (-1/8, -1/8, -1/8).

f(x,y,z)=11+x2+y2+z2f(x,y,z) = \frac{1}{\sqrt{1 + x^2 + y^2 + z^2}}
f=1(1+x2+y2+z2)3/2x,  y,  z\nabla f = \frac{-1}{\left(1 + x^2 + y^2 + z^2\right)^{3/2}}\left\langle x,\; y,\; z \right\rangle
fx=x(1+x2+y2+z2)3/2\frac{\partial f}{\partial x} = \frac{-x}{\left(1 + x^2 + y^2 + z^2\right)^{3/2}}
fy=y(1+x2+y2+z2)3/2\frac{\partial f}{\partial y} = \frac{-y}{\left(1 + x^2 + y^2 + z^2\right)^{3/2}}
fz=z(1+x2+y2+z2)3/2\frac{\partial f}{\partial z} = \frac{-z}{\left(1 + x^2 + y^2 + z^2\right)^{3/2}}

Rewrite the root as a power, then use the chain rule

Radicals are easier to differentiate once they are powers. Put D=1+x2+y2+z2D = 1 + x^2 + y^2 + z^2 and write f=D1/2f = D^{-1/2}. Differentiating with respect to xx brings the exponent down, drops it by one, and multiplies by the derivative of the inside.

fx=12D3/2Dx=12D3/2(2x)=x(1+x2+y2+z2)3/2\frac{\partial f}{\partial x} = -\frac{1}{2}D^{-3/2}\cdot\frac{\partial D}{\partial x} = -\frac{1}{2}D^{-3/2}\left(2x\right) = \frac{-x}{\left(1 + x^2 + y^2 + z^2\right)^{3/2}}

The factor of 2 from Dx=2x\frac{\partial D}{\partial x} = 2x cancels the 12\frac{1}{2} out front, which is why the answer is so tidy. The other two variables enter DD in exactly the same way, so their partials match by symmetry.

f=1(1+x2+y2+z2)3/2x,  y,  z\nabla f = \frac{-1}{\left(1 + x^2 + y^2 + z^2\right)^{3/2}}\left\langle x,\; y,\; z \right\rangle

This is a softened version of the inverse distance potential from physics. The +1+1 inside the root keeps everything defined and smooth at the origin, which the raw 1r\frac{1}{r} is not.

The mistake: the wrong exponent after differentiating

The usual wrong answer keeps the exponent at 12-\frac{1}{2}, giving x1+x2+y2+z2\frac{-x}{\sqrt{1+x^2+y^2+z^2}}. Differentiating a power lowers the exponent by 1, and 121=32-\frac{1}{2} - 1 = -\frac{3}{2}, so the root becomes a three halves power in the denominator.

  • Track the exponent explicitly: D1/2D^{-1/2} differentiates to a multiple of D3/2D^{-3/2}, never back to D1/2D^{-1/2}.
  • The inner derivative 2x2x is not optional. Drop it and you are left with 12D3/2-\frac{1}{2}D^{-3/2}, which equals 12-\frac{1}{2} at the origin, so the gradient no longer vanishes at the smooth maximum.
  • The overall minus sign comes from the negative exponent, not from anything in DD, which is always positive.

A fast structural check: ff is largest at the origin and decays outward, so the gradient must point inward, which means every component carries a minus sign in front of its coordinate. An answer with no minus sign is describing a function that grows outward.

Evaluating, and the single critical point

At (1,1,1)(1,1,1) the inside is D=4D = 4, so D=2\sqrt{D} = 2, D3/2=8D^{3/2} = 8 and f=12f = \frac{1}{2}.

f(1,1,1)=18,  18,  18,f=380.217\nabla f(1,1,1) = \left\langle -\tfrac{1}{8},\; -\tfrac{1}{8},\; -\tfrac{1}{8} \right\rangle, \qquad \left| \nabla f \right| = \frac{\sqrt{3}}{8} \approx 0.217

The vector points along 1,1,1\left\langle -1,-1,-1 \right\rangle, straight back at the origin. That is the direction of fastest increase, and it makes sense: the closer you get to the origin, the larger ff becomes.

Setting the gradient to zero needs x=y=z=0x = y = z = 0, since the denominator is never zero. The origin is the only critical point, and f(0,0,0)=1f(0,0,0) = 1 is the global maximum. Level surfaces are spheres centred at the origin, and the gradient is normal to each of them, pointing to the smaller sphere rather than the larger one.

Frequently asked questions

Why does the gradient point toward the origin instead of away from it?

Because ff decreases as you move outward. The gradient always points toward increasing values, and the largest values sit at the centre, so every component carries the opposite sign to its coordinate.

Where does the three halves power come from?

From differentiating D1/2D^{-1/2}. The power rule lowers the exponent by one, producing D3/2D^{-3/2}, which is 1DD\frac{1}{D\sqrt{D}} when written out. The 12\frac{1}{2} it brings down is cancelled by the 2x2x from the inner derivative.