Multivariable calculus

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

Write D = x^2 + y^2 + 1. For f(x,y) = ln(D) the second partials are f_xx = 2(y^2 - x^2 + 1)/D^2, f_yy = 2(x^2 - y^2 + 1)/D^2, and the mixed partial f_xy = -4xy/D^2. Both mixed orders agree. The pure ones add to 4/D^2, which is positive everywhere, so this surface is not harmonic.

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

Second and mixed partials

2fx2=2(y2x2+1)(x2+y2+1)2\frac{\partial^{2} f}{\partial x^{2}} = \frac{2\left(y^{2} - x^{2} + 1\right)}{\left(x^{2} + y^{2} + 1\right)^{2}}
2fyx=4xy(x2+y2+1)2\frac{\partial^{2} f}{\partial y\,\partial x} = \frac{-4xy}{\left(x^{2} + y^{2} + 1\right)^{2}}
2fy2=2(x2y2+1)(x2+y2+1)2\frac{\partial^{2} f}{\partial y^{2}} = \frac{2\left(x^{2} - y^{2} + 1\right)}{\left(x^{2} + y^{2} + 1\right)^{2}}

Chain rule out, quotient rule back in

Write D=x2+y2+1D = x^{2} + y^{2} + 1, which is at least 1 everywhere, so the logarithm and every derivative below are defined on the whole plane. The first partials are chain rule applications of ddulnu=1u\frac{d}{du}\ln u = \frac{1}{u}.

fx=2xD,fy=2yD\frac{\partial f}{\partial x} = \frac{2x}{D}, \qquad \frac{\partial f}{\partial y} = \frac{2y}{D}

Now 2xD\frac{2x}{D} is a genuine quotient in xx, since DD contains x2x^{2}. Apply the quotient rule with numerator 2x2x and denominator DD.

2fx2=2D2x(2x)D2=2(y2x2+1)D2\frac{\partial^{2} f}{\partial x^{2}} = \frac{2D - 2x(2x)}{D^{2}} = \frac{2\left(y^{2} - x^{2} + 1\right)}{D^{2}}

For the mixed partial the numerator 2x2x is constant in yy, so only the denominator moves and the derivative is much shorter.

2fyx=2xy(D1)=2x(2yD2)=4xyD2\frac{\partial^{2} f}{\partial y\,\partial x} = 2x \cdot \frac{\partial}{\partial y}\left(D^{-1}\right) = 2x\left(-\frac{2y}{D^{2}}\right) = \frac{-4xy}{D^{2}}

Symmetry as a shortcut and a check

This function is unchanged when you swap xx and yy, so fyyf_{yy} must be fxxf_{xx} with the roles of xx and yy exchanged. You get it without doing the quotient rule a second time.

2fy2=2(x2y2+1)D2\frac{\partial^{2} f}{\partial y^{2}} = \frac{2\left(x^{2} - y^{2} + 1\right)}{D^{2}}

Clairaut symmetry gives an independent check on the mixed partial. Differentiating 2yD\frac{2y}{D} in xx gives 4xyD2-\frac{4xy}{D^{2}}, matching the other order exactly. Since DD never vanishes, all of these are continuous everywhere and the theorem applies at every point.

Adding the pure partials collapses nicely, which is the sort of simplification worth looking for after any messy quotient rule.

2f=2(y2x2+1)+2(x2y2+1)D2=4D2\nabla^{2} f = \frac{2\left(y^{2} - x^{2} + 1\right) + 2\left(x^{2} - y^{2} + 1\right)}{D^{2}} = \frac{4}{D^{2}}

The mistake students make

The most common wrong answer is fxx=2Df_{xx} = \frac{2}{D}, from differentiating only the numerator and forgetting that the denominator also depends on xx. That version misses the sign change: the correct fxxf_{xx} is negative once x2>y2+1x^{2} > y^{2} + 1, because the surface flattens out far from the origin.

The second common error is a wrong chain rule at the very start, writing fx=1x2+y2+1\frac{\partial f}{\partial x} = \frac{1}{x^{2} + y^{2} + 1} without the factor 2x2x from the inside function. Everything downstream then fails.

Check any candidate formula at a point. At x=2x = 2, y=0y = 0 you have D=5D = 5, and the correct fxx=2(04+1)25=625=0.24f_{xx} = \frac{2(0 - 4 + 1)}{25} = -\frac{6}{25} = -0.24, clearly negative.

Frequently asked questions

Why keep the plus 1 inside the logarithm?

It keeps the argument positive at the origin. Without it, ln(x2+y2)\ln(x^{2} + y^{2}) blows up at (0,0)(0,0) and no derivative exists there. With it, the function is smooth on the entire plane.

Is ln(x^2 + y^2 + 1) harmonic?

No. Its Laplacian is 4(x2+y2+1)2\frac{4}{(x^{2} + y^{2} + 1)^{2}}, which is strictly positive. The function lnx2+y2\ln\sqrt{x^{2} + y^{2}} is the harmonic one, and it is undefined at the origin.