Multivariable calculus

Second partial derivatives of e^x sin y

For f(x,y) = e^x sin y the second partials are f_xx = e^x sin y, f_yy = -e^x sin y, and the mixed partial f_xy = f_yx = e^x cos y. Because f_xx + f_yy = 0 the function is harmonic, and the discriminant f_xx f_yy - f_xy^2 equals -e^(2x), which is negative at every point.

f(x,y)=exsinyf(x,y) = e^{x}\sin y
fx=exsiny\frac{\partial f}{\partial x} = e^{x}\sin y
fy=excosy\frac{\partial f}{\partial y} = e^{x}\cos y

Second and mixed partials

2fx2=exsiny\frac{\partial^2 f}{\partial x^2} = e^{x}\sin y
2fyx=excosy\frac{\partial^2 f}{\partial y\,\partial x} = e^{x}\cos y
2fy2=exsiny\frac{\partial^2 f}{\partial y^2} = -e^{x}\sin y

Differentiate once, then differentiate again

The two factors depend on different variables, so no product rule is needed. Freeze yy and siny\sin y is just a constant multiplier sitting in front of exe^{x}, which is its own derivative.

fx=exsiny\frac{\partial f}{\partial x} = e^{x}\sin y

Freeze xx instead and exe^{x} becomes the constant, while siny\sin y differentiates to cosy\cos y.

fy=excosy\frac{\partial f}{\partial y} = e^{x}\cos y

Each first partial is again an xx factor times a yy factor, so the second round works the same way. Differentiating exsinye^{x}\sin y in xx reproduces it, differentiating it in yy swaps sine for cosine, and differentiating excosye^{x}\cos y in yy brings out a minus sign.

2fx2=exsiny,2fyx=excosy,2fy2=exsiny\frac{\partial^2 f}{\partial x^2} = e^{x}\sin y, \qquad \frac{\partial^2 f}{\partial y\,\partial x} = e^{x}\cos y, \qquad \frac{\partial^2 f}{\partial y^2} = -e^{x}\sin y

The mistake: losing the sign on the second y derivative

Sine goes to cosine, but cosine goes to negative sine. Anyone who writes 2fy2=excosy\frac{\partial^2 f}{\partial y^2} = e^{x}\cos y has differentiated once and then copied the answer instead of differentiating again. The four step cycle sincossincos\sin \to \cos \to -\sin \to -\cos is the check: two yy derivatives always flip the sign.

The second slip is reaching for the product rule. Using it is not wrong, just wasteful, because the derivative of siny\sin y with respect to xx is zero and the extra term dies. Spotting a separated product saves a line of algebra every time.

Clairaut symmetry and what the Laplacian says

Differentiating in xx then yy, and in yy then xx, both land on excosye^{x}\cos y. That is Clairaut's theorem: when the second partials are continuous, and here they are continuous on the whole plane, the mixed partials agree and the order is yours to choose.

Adding the two pure second partials gives zero.

2fx2+2fy2=exsinyexsiny=0\frac{\partial^2 f}{\partial x^2} + \frac{\partial^2 f}{\partial y^2} = e^{x}\sin y - e^{x}\sin y = 0

A function with zero Laplacian is called harmonic. The Hessian discriminant reads off as (exsiny)(exsiny)(excosy)2=e2x(e^{x}\sin y)(-e^{x}\sin y) - (e^{x}\cos y)^2 = -e^{2x}, which is negative everywhere, so this surface has no local maximum and no local minimum at any point.

Frequently asked questions

Does the order of differentiation change the mixed partial?

No. Both 2fyx\frac{\partial^2 f}{\partial y\,\partial x} and 2fxy\frac{\partial^2 f}{\partial x\,\partial y} equal excosye^{x}\cos y. All second partials of exsinye^{x}\sin y are continuous on the whole plane, so Clairaut's theorem guarantees the two orders agree.

What does it mean that this function is harmonic?

It means fxx+fyy=0f_{xx} + f_{yy} = 0, so at every point the upward curvature in one direction is cancelled by downward curvature in the other. A nonconstant harmonic function cannot have an interior local maximum or minimum, which matches the discriminant e2x<0-e^{2x} < 0 found here.