Multivariable calculus

Gradient of x ln(1 + y^2) and Its Line of Zeros

For f(x, y) = x ln(1 + y^2) the gradient is (ln(1 + y^2), 2xy over 1 + y^2). The x partial needs no work, since x appears to the first power with a constant multiplier. The y partial is a chain rule on the logarithm. Both components vanish along the whole x axis.

f(x,y)=xln(1+y2)f(x,y) = x\ln\left(1+y^{2}\right)
f=ln(1+y2),  2xy1+y2\nabla f = \left\langle \ln\left(1+y^{2}\right),\; \frac{2xy}{1+y^{2}} \right\rangle
fx=ln(1+y2)\frac{\partial f}{\partial x} = \ln\left(1+y^{2}\right)
fy=2xy1+y2\frac{\partial f}{\partial y} = \frac{2xy}{1+y^{2}}

One easy component and one chain rule

For fx\frac{\partial f}{\partial x}, the whole logarithm is a constant multiplier and xx is to the first power, so the derivative is the multiplier itself.

fx=ln(1+y2)ddx(x)=ln(1+y2)\frac{\partial f}{\partial x} = \ln\left(1+y^{2}\right)\cdot\frac{d}{dx}(x) = \ln\left(1+y^{2}\right)

The other component needs the chain rule inside the logarithm, with xx riding along as a constant.

fy=x11+y2y(1+y2)=2xy1+y2\frac{\partial f}{\partial y} = x\cdot\frac{1}{1+y^{2}}\cdot\frac{\partial}{\partial y}\left(1+y^{2}\right) = \frac{2xy}{1+y^{2}}

Note the difference in flavour. One component keeps the logarithm and the other loses it entirely, because differentiating a logarithm produces a rational function. If both of your components contain a logarithm, or neither does, something has gone wrong.

A whole line of critical points

Set both components to zero. The first needs ln(1+y2)=0\ln(1+y^{2}) = 0, which happens only at y=0y = 0. The second needs 2xy=02xy = 0, which is automatic once y=0y = 0.

f(x,0)=ln1,  0=0,  0for every x\nabla f(x, 0) = \left\langle \ln 1,\; 0 \right\rangle = \left\langle 0,\; 0 \right\rangle \quad \text{for every } x

So the entire xx axis is critical. It is not a ridge of maxima or a trough of minima though. Since ln(1+y2)>0\ln(1+y^{2}) > 0 for y0y \neq 0, the sign of ff near the axis is the sign of xx, so at a point like (2,0)(2,0) the surface rises on both sides in yy, while at (2,0)(-2, 0) it falls on both sides. The second derivative test is inconclusive along the whole line, and you have to look at the sign of ff instead.

Away from the axis, evaluate at (2,1)(2,1): the logarithm gives ln20.6931\ln 2 \approx 0.6931 and the second component is 2212=2\frac{2\cdot 2\cdot 1}{2} = 2.

f(2,1)=ln2,  20.6931,  2\nabla f(2,1) = \left\langle \ln 2,\; 2 \right\rangle \approx \left\langle 0.6931,\; 2 \right\rangle

The surface is climbing about three times faster in yy than in xx there, which is the kind of comparison a gradient is for.

The mistake: dropping the denominator, or the x

Two errors account for nearly all wrong answers on this one.

  • Writing fy=2xy\frac{\partial f}{\partial y} = 2xy, which keeps the inner derivative and forgets the 11+y2\frac{1}{1+y^{2}} from the logarithm. That answer grows without bound in yy, while the true one is bounded, since 2y1+y2\frac{2y}{1+y^{2}} never exceeds 11 in absolute value.
  • Writing fy=2y1+y2\frac{\partial f}{\partial y} = \frac{2y}{1+y^{2}}, dropping the factor xx. Then the surface would be predicted to change in yy even along the line x=0x = 0, where ff is identically zero.

There is also a domain point worth stating: 1+y211 + y^{2} \geq 1 for every real yy, so the logarithm is defined on the whole plane and the denominator is never zero. That is why this function is a safe example, unlike xlnyx\ln y, which needs y>0y > 0.

Frequently asked questions

Why does the xx component keep the logarithm?

Because nothing differentiates it. With respect to xx, the factor ln(1+y2)\ln(1+y^{2}) is a number, and the derivative of a number times xx is that number. The logarithm only turns into a rational function when you differentiate with respect to yy.

How large can the yy component get?

For fixed xx it is xx times 2y1+y2\frac{2y}{1+y^{2}}, and that factor has maximum value 11 at y=1y = 1 and minimum 1-1 at y=1y = -1. So the yy component never exceeds x\left|x\right| in absolute value, and the steepest climb in yy always happens at y=±1y = \pm 1.