Multivariable calculus

Second Partial Derivatives of sin(x)cos(y)

For f(x,y) = sin(x)cos(y) the second partials are f_xx = -sin(x)cos(y), f_yy = -sin(x)cos(y), and the mixed partial f_xy = -cos(x)sin(y). Both pure second partials equal -f, so the Laplacian is -2f. This is a separated product, which means no product rule is ever needed in the computation.

f(x,y)=sin⁡xcos⁡yf(x,y) = \sin x \cos y
∂f∂x=cos⁡xcos⁡y\frac{\partial f}{\partial x} = \cos x \cos y
∂f∂y=−sin⁡xsin⁡y\frac{\partial f}{\partial y} = -\sin x \sin y

Second and mixed partials

∂2f∂x2=−sin⁡xcos⁡y\frac{\partial^{2} f}{\partial x^{2}} = -\sin x \cos y
∂2f∂y ∂x=−cos⁡xsin⁡y\frac{\partial^{2} f}{\partial y\,\partial x} = -\cos x \sin y
∂2f∂y2=−sin⁡xcos⁡y\frac{\partial^{2} f}{\partial y^{2}} = -\sin x \cos y

A separated product makes this easy

The function is a product of a function of xx alone and a function of yy alone. When you differentiate in xx, the whole cos⁡y\cos y factor is a constant multiplier, so no product rule appears at any stage.

∂f∂x=cos⁡xcos⁡y,∂f∂y=−sin⁡xsin⁡y\frac{\partial f}{\partial x} = \cos x \cos y, \qquad \frac{\partial f}{\partial y} = -\sin x \sin y

Differentiating each factor twice returns the original with a sign flip, since sine and cosine each satisfy g′′=−gg'' = -g.

∂2f∂x2=−sin⁡xcos⁡y=−f,∂2f∂y2=−sin⁡xcos⁡y=−f\frac{\partial^{2} f}{\partial x^{2}} = -\sin x \cos y = -f, \qquad \frac{\partial^{2} f}{\partial y^{2}} = -\sin x \cos y = -f

The mixed partial takes one derivative from each factor, turning sin⁡x\sin x into cos⁡x\cos x and cos⁡y\cos y into −sin⁡y-\sin y.

∂2f∂y ∂x=∂∂y(cos⁡xcos⁡y)=−cos⁡xsin⁡y\frac{\partial^{2} f}{\partial y\,\partial x} = \frac{\partial}{\partial y}\left(\cos x \cos y\right) = -\cos x \sin y

Clairaut symmetry and the Laplacian

Reversing the order differentiates −sin⁡xsin⁡y-\sin x \sin y in xx, which gives −cos⁡xsin⁡y-\cos x \sin y. The two orders agree, exactly as Clairaut's theorem promises for a product of smooth one variable functions.

Adding the pure second partials gives a clean relation. Functions with this property are eigenfunctions of the Laplacian, and they are the building blocks of separation of variables for the wave and heat equations.

∇2f=fxx+fyy=−2sin⁡xcos⁡y=−2f\nabla^{2} f = f_{xx} + f_{yy} = -2\sin x \cos y = -2f

The Hessian determinant follows quickly. Using fxxfyy=sin⁡2xcos⁡2yf_{xx}f_{yy} = \sin^{2}x\cos^{2}y and fxy2=cos⁡2xsin⁡2yf_{xy}^{2} = \cos^{2}x\sin^{2}y, you get D=sin⁡2xcos⁡2y−cos⁡2xsin⁡2yD = \sin^{2}x\cos^{2}y - \cos^{2}x\sin^{2}y, which is negative wherever the twist beats the curvature.

The mistake students make

Sign bookkeeping is the whole difficulty. Differentiating cos⁡y\cos y once gives −sin⁡y-\sin y and twice gives −cos⁡y-\cos y, so fyyf_{yy} picks up its minus from the yy factor while fxxf_{xx} picks up its minus from the xx factor. Both land at −f-f, which surprises students who expect the two to differ.

The second slip is inventing a product rule that is not needed. Applying one to the product sin⁡xcos⁡y\sin x \cos y while differentiating in xx gives cos⁡xcos⁡y−sin⁡xsin⁡y\cos x \cos y - \sin x \sin y, which treats cos⁡y\cos y as if it varied with xx. It does not, since a partial derivative in xx holds yy fixed, so the first partial is just cos⁡xcos⁡y\cos x \cos y and the second is −sin⁡xcos⁡y-\sin x \cos y.

Test at x=π2x = \frac{\pi}{2}, y=0y = 0: there f=1f = 1, fxx=−1f_{xx} = -1, fyy=−1f_{yy} = -1, and fxy=0f_{xy} = 0. Since D=1>0D = 1 > 0 and fxx<0f_{xx} < 0, that point is a local maximum, which matches the picture of a peak on the surface.

Frequently asked questions

Why do f_xx and f_yy come out equal here?

Each factor satisfies g′′=−gg'' = -g, so differentiating twice in either variable returns the original function with a minus sign. Both pure second partials therefore equal −sin⁡xcos⁡y-\sin x \cos y.

Is sin(x)cos(y) harmonic?

No. Its Laplacian is −2sin⁡xcos⁡y-2\sin x \cos y, which is only zero where the function itself is zero. The corresponding harmonic pair uses hyperbolic functions, such as sin⁡xcosh⁡y\sin x \cosh y.