Multivariable calculus

Gradient of ln(1 + x^2 y^2) With Full Working

For f(x, y) = ln(1 + x^2 y^2) the gradient is (2xy^2, 2x^2 y) divided by 1 + x^2 y^2. Differentiate the logarithm to get 1 over the inside, then multiply by the partial derivative of the inside. The gradient is the zero vector on both coordinate axes, where f reaches its minimum value 0.

f(x,y)=ln⁡(1+x2y2)f(x,y) = \ln\left(1 + x^{2}y^{2}\right)
∇f=⟨2xy21+x2y2,  2x2y1+x2y2⟩\nabla f = \left\langle \frac{2xy^{2}}{1 + x^{2}y^{2}},\; \frac{2x^{2}y}{1 + x^{2}y^{2}} \right\rangle
∂f∂x=2xy21+x2y2\frac{\partial f}{\partial x} = \frac{2xy^{2}}{1 + x^{2}y^{2}}
∂f∂y=2x2y1+x2y2\frac{\partial f}{\partial y} = \frac{2x^{2}y}{1 + x^{2}y^{2}}

One over the inside, times the derivative of the inside

Write u=1+x2y2u = 1 + x^{2}y^{2}. Then f=ln⁡uf = \ln u and ∂f∂x=1u⋅∂u∂x\frac{\partial f}{\partial x} = \frac{1}{u}\cdot\frac{\partial u}{\partial x}. The denominator is the same for both components, because it is just uu and uu does not care which variable you are differentiating.

∂u∂x=∂∂x(1+x2y2)=2xy2,∂u∂y=2x2y\frac{\partial u}{\partial x} = \frac{\partial}{\partial x}\left(1 + x^{2}y^{2}\right) = 2xy^{2}, \qquad \frac{\partial u}{\partial y} = 2x^{2}y
∇f=11+x2y2⟨2xy2,  2x2y⟩=2xy1+x2y2⟨y,  x⟩\nabla f = \frac{1}{1 + x^{2}y^{2}}\left\langle 2xy^{2},\; 2x^{2}y \right\rangle = \frac{2xy}{1 + x^{2}y^{2}}\left\langle y,\; x \right\rangle

The constant 11 inside the logarithm contributes nothing to either numerator, since the derivative of a constant is zero. It matters only because it keeps u≥1u \geq 1, so the logarithm is defined everywhere in the plane and the denominator never hits zero.

Where the surface is flat, and how fast it climbs

Both components carry a factor of xyxy. That makes the gradient the zero vector along the entire xx axis and the entire yy axis, not just at the origin.

∇f(x,0)=⟨0,0⟩,∇f(0,y)=⟨0,0⟩\nabla f(x, 0) = \left\langle 0, 0 \right\rangle, \qquad \nabla f(0, y) = \left\langle 0, 0 \right\rangle

That fits the surface. On the axes x2y2=0x^{2}y^{2} = 0 and f=ln⁡1=0f = \ln 1 = 0, which is the smallest value ff ever takes, so the axes form a valley floor of minima.

At (1,1)(1,1) the numerators are 22 and 22, and the denominator is 22.

∇f(1,1)=⟨1,  1⟩\nabla f(1,1) = \left\langle 1,\; 1 \right\rangle

Far from the axes the growth stalls. With x=y=tx = y = t large, each component behaves like 2t3/t4=2/t2t^{3}/t^{4} = 2/t, so the surface flattens out. That is logarithmic growth showing itself in the gradient.

The mistake: stopping at one over the inside

The most frequent wrong answer is ∂f∂x=11+x2y2\frac{\partial f}{\partial x} = \frac{1}{1 + x^{2}y^{2}}, which uses the outer derivative and forgets the inner one. A second version keeps the inner derivative but attaches it to the wrong variable, giving 2x2y1+x2y2\frac{2x^{2}y}{1 + x^{2}y^{2}} for the xx partial.

Two checks catch both.

  • Symmetry: ff is unchanged when you swap xx and yy, so the xx component must become the yy component under that swap. 2xy21+x2y2\frac{2xy^{2}}{1+x^{2}y^{2}} and 2x2y1+x2y2\frac{2x^{2}y}{1+x^{2}y^{2}} do exactly that.
  • The axes: the true xx partial must vanish at (1,0)(1, 0), since ff is identically 00 along the whole xx axis. The dropped-chain-rule answer gives 11 there instead of 00.

Frequently asked questions

Why do both components share the denominator 1+x2y21 + x^{2}y^{2}?

Because that denominator comes from the outer function. For f=ln⁡uf = \ln u every partial derivative is 1u\frac{1}{u} times a partial of uu, and 1u\frac{1}{u} does not depend on which variable you differentiate. Only the numerators differ.

Is the origin a minimum of ln⁡(1+x2y2)\ln(1 + x^{2}y^{2})?

It is a minimum, but not an isolated one. The value f=0f = 0 is achieved along both entire axes, so the origin sits on a valley floor rather than in a bowl. The second derivative test is inconclusive there, which is exactly what you should expect for a degenerate critical set.