Multivariable calculus

Gradient of 1/(x^2+y^2+1): A Radial Bump Surface

For f(x, y) = 1/(x^2 + y^2 + 1) the gradient is (-2x, -2y) divided by (x^2 + y^2 + 1) squared. At (1, 1) it equals (-2/9, -2/9). Every gradient vector points back toward the origin, because the origin is the single peak of this bump-shaped surface.

f(x,y)=1x2+y2+1f(x,y) = \dfrac{1}{x^2 + y^2 + 1}
f(x,y)=2(x2+y2+1)2x, y\nabla f(x,y) = \dfrac{-2}{\left(x^2 + y^2 + 1\right)^2}\left\langle x,\ y \right\rangle
fx=2x(x2+y2+1)2\frac{\partial f}{\partial x} = \frac{-2x}{\left(x^2 + y^2 + 1\right)^2}
fy=2y(x2+y2+1)2\frac{\partial f}{\partial y} = \frac{-2y}{\left(x^2 + y^2 + 1\right)^2}

Rewrite as a power, then use the chain rule

The quotient rule works here, but it is slower than it needs to be, because the numerator is the constant 11. Write u=x2+y2+1u = x^2 + y^2 + 1 and f=u1f = u^{-1} instead.

fx=u2ux=1u22x=2x(x2+y2+1)2\frac{\partial f}{\partial x} = -u^{-2}\,\frac{\partial u}{\partial x} = \frac{-1}{u^2} \cdot 2x = \frac{-2x}{\left(x^2 + y^2 + 1\right)^2}

The inner function uu is symmetric in the two variables, so the yy partial has the identical shape with 2y2y in place of 2x2x.

fy=2y(x2+y2+1)2\frac{\partial f}{\partial y} = \frac{-2y}{\left(x^2 + y^2 + 1\right)^2}
f(x,y)=2(x2+y2+1)2x, y\nabla f(x,y) = \dfrac{-2}{\left(x^2 + y^2 + 1\right)^2}\left\langle x,\ y \right\rangle

At (1,1)(1,1) the denominator uu equals 33, so u2=9u^2 = 9 and f(1,1)=29,29\nabla f(1,1) = \left\langle -\tfrac{2}{9}, -\tfrac{2}{9}\right\rangle.

The mistake: losing the minus sign or the squared denominator

Two errors dominate. The first is writing 2xu2\frac{2x}{u^2} with no minus sign, forgetting that the power rule on u1u^{-1} brings down 1-1. The second is writing 2xu\frac{-2x}{u}, leaving the denominator unsquared.

Both fail a quick reality check. The surface is a hill with its top at the origin, so heading away from the origin must lower the height, which forces the gradient to point inward and the components to carry the opposite sign to xx and yy.

  • ddu(u1)=u2\frac{d}{du}\left(u^{-1}\right) = -u^{-2}, so the exponent goes from 1-1 to 2-2 and the sign flips.
  • Slice at y=0y = 0: f(x,0)=1x2+1f(x,0) = \frac{1}{x^2+1} has derivative 2x(x2+1)2\frac{-2x}{(x^2+1)^2}, which matches the formula.
  • The denominator x2+y2+1x^2 + y^2 + 1 is never zero, so the gradient is defined at every point of the plane.

A bump with one peak, and gradients that all aim at it

The gradient is the negative multiple 2u2\frac{-2}{u^2} of the position vector x,y\langle x, y\rangle, so it points from the point straight back toward the origin. Since steepest ascent means uphill, every point other than the origin is looking uphill at the origin. At the origin itself the gradient is the zero vector, because you are already standing on the summit.

Setting both components to zero gives x=0x = 0 and y=0y = 0, so the origin is the only critical point, and f(0,0)=1f(0,0) = 1 is the global maximum. Far from the origin, ff decays to zero like 1/r21/r^2 and the surface flattens out.

The magnitude tells you where the hillside is steepest. In polar form, with r2=x2+y2r^2 = x^2 + y^2,

f=2r(r2+1)2\left|\nabla f\right| = \frac{2r}{\left(r^2+1\right)^2}

This is zero at the summit, rises to a maximum on the circle r=13r = \tfrac{1}{\sqrt{3}}, and then decays. The steepest part of the hill is a ring partway down, which is what a rounded bump looks like in cross section.

Frequently asked questions

Is the gradient of 1/(x^2+y^2+1) ever undefined?

No. The denominator x2+y2+1x^2 + y^2 + 1 is at least 11 everywhere, so it never vanishes and neither does its square. Both partials are defined and continuous on the whole plane, which makes ff differentiable everywhere.

What are the level curves of this surface?

Circles centred at the origin. Setting f=cf = c gives x2+y2=1c1x^2 + y^2 = \frac{1}{c} - 1, so for 0<c<10 < c < 1 you get a circle whose radius grows as cc shrinks. The value c=1c = 1 is the exception: the radius collapses to zero and the level set is the single peak point at the origin. The radial gradient crosses every one of those circles at a right angle.