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)=exsin⁡yf(x,y) = e^{x}\sin y
∂f∂x=exsin⁡y\frac{\partial f}{\partial x} = e^{x}\sin y
∂f∂y=excos⁡y\frac{\partial f}{\partial y} = e^{x}\cos y

Second and mixed partials

∂2f∂x2=exsin⁡y\frac{\partial^2 f}{\partial x^2} = e^{x}\sin y
∂2f∂y ∂x=excos⁡y\frac{\partial^2 f}{\partial y\,\partial x} = e^{x}\cos y
∂2f∂y2=−exsin⁡y\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 sin⁡y\sin y is just a constant multiplier sitting in front of exe^{x}, which is its own derivative.

∂f∂x=exsin⁡y\frac{\partial f}{\partial x} = e^{x}\sin y

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

∂f∂y=excos⁡y\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 exsin⁡ye^{x}\sin y in xx reproduces it, differentiating it in yy swaps sine for cosine, and differentiating excos⁡ye^{x}\cos y in yy brings out a minus sign.

∂2f∂x2=exsin⁡y,∂2f∂y ∂x=excos⁡y,∂2f∂y2=−exsin⁡y\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 ∂2f∂y2=excos⁡y\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 sin⁡→cos⁡→−sin⁡→−cos⁡\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 sin⁡y\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 excos⁡ye^{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.

∂2f∂x2+∂2f∂y2=exsin⁡y−exsin⁡y=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 (exsin⁡y)(−exsin⁡y)−(excos⁡y)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 ∂2f∂y ∂x\frac{\partial^2 f}{\partial y\,\partial x} and ∂2f∂x ∂y\frac{\partial^2 f}{\partial x\,\partial y} equal excos⁡ye^{x}\cos y. All second partials of exsin⁡ye^{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.