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 f_xy = f_yx = -cos x sin y. Both pure second partials return the original function with a minus sign, so f_xx + f_yy = -2f. At the point (pi/2, 0) the Hessian gives a local maximum.

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

One variable at a time

Treat cosy\cos y as a constant to differentiate in xx, and treat sinx\sin x as a constant to differentiate in yy. That gives the two first partials.

fx=cosxcosy,fy=sinxsiny\frac{\partial f}{\partial x} = \cos x \cos y, \qquad \frac{\partial f}{\partial y} = -\sin x \sin y

Differentiate each of those again. In cosxcosy\cos x \cos y the xx derivative turns cosx\cos x into sinx-\sin x, and the yy derivative turns cosy\cos y into siny-\sin y. In sinxsiny-\sin x \sin y the yy derivative turns siny\sin y into cosy\cos y, restoring the original shape with a minus sign.

fxx=sinxcosy,fxy=cosxsiny,fyy=sinxcosyf_{xx} = -\sin x \cos y, \qquad f_{xy} = -\cos x \sin y, \qquad f_{yy} = -\sin x \cos y

Running the mixed partial the other way, starting from fy=sinxsinyf_y = -\sin x \sin y and differentiating in xx, gives cosxsiny-\cos x \sin y again. The two routes agree, exactly as Clairaut's theorem promises for a function this smooth.

The mistake: assuming f_xx and f_yy must look different

Here fxxf_{xx} and fyyf_{yy} come out identical, and students who expect two different answers go back and hunt for an error that is not there. The reason they match is structural: each pure second derivative sends its own trig factor through two steps of the cycle, and two steps always produce the factor back times 1-1.

The genuine error to guard against is a sign. fyf_y already carries a minus sign, so differentiating it in yy means differentiating sinxsiny-\sin x \sin y, not sinxsiny\sin x \sin y. Dropping that leading minus gives fyy=sinxcosyf_{yy} = \sin x \cos y, which has the curvature pointing the wrong way and reverses every conclusion you draw from the Hessian.

Reading the Hessian at a critical point

Both first partials vanish at (π/2,0)(\pi/2, 0), since cos(π/2)=0\cos(\pi/2) = 0 and sin0=0\sin 0 = 0. Evaluate the second partials there: fxx=1f_{xx} = -1, fyy=1f_{yy} = -1, and fxy=0f_{xy} = 0.

D=fxxfyyfxy2=(1)(1)02=1>0D = f_{xx}f_{yy} - f_{xy}^{\,2} = (-1)(-1) - 0^2 = 1 > 0

With D>0D > 0 and fxx<0f_{xx} < 0, the second derivative test calls this a local maximum, and indeed f(π/2,0)=1f(\pi/2, 0) = 1 is the largest value a product of a sine and a cosine can reach.

Adding the pure second partials gives fxx+fyy=2sinxcosy=2ff_{xx} + f_{yy} = -2\sin x \cos y = -2f. A function whose Laplacian is a constant multiple of itself is an eigenfunction of the Laplacian, and this particular one is the shape of a standing wave on a rectangular membrane.

Frequently asked questions

Why do f_xx and f_yy come out equal for this function?

Because each pure second derivative differentiates one trig factor twice, and two derivatives of a sine or a cosine return the same function times 1-1. Both routes therefore rebuild sinxcosy\sin x \cos y with a minus sign in front.

What is the mixed partial of sin x cos y?

It is fxy=cosxsinyf_{xy} = -\cos x \sin y, and you get the same expression whichever order you differentiate in. It vanishes wherever cosx=0\cos x = 0 or siny=0\sin y = 0, which is exactly where the critical points of the surface sit.