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)=sinxcosyf(x,y) = \sin x \cos y
fx=cosxcosy\frac{\partial f}{\partial x} = \cos x \cos y
fy=sinxsiny\frac{\partial f}{\partial y} = -\sin x \sin y

Second and mixed partials

2fx2=sinxcosy\frac{\partial^{2} f}{\partial x^{2}} = -\sin x \cos y
2fyx=cosxsiny\frac{\partial^{2} f}{\partial y\,\partial x} = -\cos x \sin y
2fy2=sinxcosy\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 cosy\cos y factor is a constant multiplier, so no product rule appears at any stage.

fx=cosxcosy,fy=sinxsiny\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.

2fx2=sinxcosy=f,2fy2=sinxcosy=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 sinx\sin x into cosx\cos x and cosy\cos y into siny-\sin y.

2fyx=y(cosxcosy)=cosxsiny\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 sinxsiny-\sin x \sin y in xx, which gives cosxsiny-\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=2sinxcosy=2f\nabla^{2} f = f_{xx} + f_{yy} = -2\sin x \cos y = -2f

The Hessian determinant follows quickly. Using fxxfyy=sin2xcos2yf_{xx}f_{yy} = \sin^{2}x\cos^{2}y and fxy2=cos2xsin2yf_{xy}^{2} = \cos^{2}x\sin^{2}y, you get D=sin2xcos2ycos2xsin2yD = \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 cosy\cos y once gives siny-\sin y and twice gives cosy-\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 sinxcosy\sin x \cos y while differentiating in xx gives cosxcosysinxsiny\cos x \cos y - \sin x \sin y, which treats cosy\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 cosxcosy\cos x \cos y and the second is sinxcosy-\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 sinxcosy-\sin x \cos y.

Is sin(x)cos(y) harmonic?

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