Multivariable calculus

Second partials of x e^y + y e^x

For f(x,y) = x e^y + y e^x the second partials are f_xx = y e^x, f_yy = x e^y, and the mixed partial f_xy = f_yx = e^x + e^y. The two routes to the mixed partial look nothing alike on the way, but both finish at e^x + e^y, which is Clairaut symmetry made visible.

f(x,y)=xey+yexf(x,y) = x e^{y} + y e^{x}
fx=ey+yex\frac{\partial f}{\partial x} = e^{y} + y e^{x}
fy=xey+ex\frac{\partial f}{\partial y} = x e^{y} + e^{x}

Second and mixed partials

2fx2=yex\frac{\partial^2 f}{\partial x^2} = y e^{x}
2fyx=ex+ey\frac{\partial^2 f}{\partial y\,\partial x} = e^{x} + e^{y}
2fy2=xey\frac{\partial^2 f}{\partial y^2} = x e^{y}

Term by term, holding the other variable still

Differentiate in xx with yy frozen. In the first term xeyx e^{y}, the factor eye^{y} is a constant, so the derivative is just eye^{y}. In the second term yexy e^{x}, the constant is yy and exe^{x} differentiates to itself.

fx=ey+yex,fy=xey+ex\frac{\partial f}{\partial x} = e^{y} + y e^{x}, \qquad \frac{\partial f}{\partial y} = x e^{y} + e^{x}

Now take a second xx derivative of fx=ey+yexf_x = e^{y} + y e^{x}. The term eye^{y} is a constant in xx and dies, leaving only yexy e^{x}.

2fx2=yex,2fy2=xey\frac{\partial^2 f}{\partial x^2} = y e^{x}, \qquad \frac{\partial^2 f}{\partial y^2} = x e^{y}

For the mixed partial, differentiate fx=ey+yexf_x = e^{y} + y e^{x} with respect to yy. Now the first term survives as eye^{y} and the second contributes exe^{x}, because yy is the variable and exe^{x} is the constant.

2fyx=ey+ex\frac{\partial^2 f}{\partial y\,\partial x} = e^{y} + e^{x}

The mistake: keeping a term that should have vanished

Terms disappear and reappear as you switch variables, and that is where marks are lost. Going from fx=ey+yexf_x = e^{y} + y e^{x} to fxxf_{xx}, the eye^{y} must vanish, because it is constant in xx. Going from the same fxf_x to fxyf_{xy}, that identical eye^{y} is the term that survives while nothing else does. Students who carry the same term through both steps get fxx=ey+yexf_{xx} = e^{y} + y e^{x}, which is the first partial written out again.

Before each step, ask which factors contain the variable you are differentiating in and cross out the rest. Here no term ever needs the product rule, since in xeyx e^{y} the two factors depend on different variables, and the same is true of yexy e^{x}.

Clairaut symmetry, and the one critical point

Take the other route. Start from fy=xey+exf_y = x e^{y} + e^{x} and differentiate in xx: the first term gives eye^{y} and the second gives exe^{x}, so the answer is ex+eye^{x} + e^{y} again.

2fxy=ey+ex=2fyx\frac{\partial^2 f}{\partial x\,\partial y} = e^{y} + e^{x} = \frac{\partial^2 f}{\partial y\,\partial x}

What makes this example worth remembering is that the surviving terms swap places. Going xx first, the eye^{y} in the answer comes from the term xeyx e^{y}; going yy first, it comes from the same term but through the opposite factor. The totals match because Clairaut's theorem says they must, given that both mixed partials are continuous everywhere.

The function is also symmetric under swapping xx and yy, so fxx(x,y)=yexf_{xx}(x,y) = y e^{x} and fyy(x,y)=xeyf_{yy}(x,y) = x e^{y} are mirror images. The discriminant D=xyex+y(ex+ey)2D = xy\,e^{x+y} - (e^{x}+e^{y})^{2} is worth evaluating only where both first partials vanish. Setting ey=yexe^{y} = -y e^{x} and xey=exx e^{y} = -e^{x}, then substituting the first into the second, gives xy=1xy = 1, with y<0y < 0 forced because yex-y e^{x} has to come out positive. The one point meeting both conditions is (1,1)(-1,-1).

D(1,1)=(e1)(e1)(2e1)2=3e2<0D(-1,-1) = \left(-e^{-1}\right)\left(-e^{-1}\right) - \left(2e^{-1}\right)^{2} = -3e^{-2} < 0

So this surface has exactly one critical point, a saddle at (1,1)(-1,-1) of height f(1,1)=2/ef(-1,-1) = -2/e. Everywhere else the discriminant tells you nothing, because the second derivative test only classifies points where the gradient is already zero.

Frequently asked questions

Why does f_xx have no e^y term?

Because the term xeyx e^{y} is linear in xx. Its first xx derivative is the constant eye^{y}, and differentiating a constant in xx gives zero, so only yexy e^{x} from the other term survives to the second derivative.

Do both mixed partials really give the same thing here?

Yes, both equal ex+eye^{x} + e^{y}. It is a good example because the two calculations pick up their terms in the opposite order, and the agreement is Clairaut's theorem rather than an algebraic coincidence.