Multivariable calculus

Partial Derivatives of sin(x)cos(y)

For f(x, y) = sin(x)cos(y), the partial derivative with respect to x is cos(x)cos(y), and the partial derivative with respect to y is negative sin(x)sin(y). When you differentiate with respect to one variable, the factor built from the other variable is a constant and rides along untouched.

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

Freeze one variable, differentiate the other

This function is a product of two pieces that never mix: sinx\sin x depends only on xx, and cosy\cos y depends only on yy. To find fx\frac{\partial f}{\partial x}, treat cosy\cos y as a fixed number, say cc. Then you are differentiating csinxc\sin x, which gives ccosxc\cos x. Put cosy\cos y back in place of cc.

fx=cosyddxsinx=cosxcosy\frac{\partial f}{\partial x} = \cos y \cdot \frac{d}{dx}\sin x = \cos x \cos y

Now swap roles. Holding xx fixed makes sinx\sin x the constant, and the derivative of cosy\cos y is siny-\sin y, so the minus sign appears only in the yy partial.

fy=sinxddycosy=sinxsiny\frac{\partial f}{\partial y} = \sin x \cdot \frac{d}{dy}\cos y = -\sin x \sin y

The mistake: differentiating both factors at once

The most common error is to apply the single variable product rule and write cosxcosysinxsiny\cos x \cos y - \sin x \sin y for fx\frac{\partial f}{\partial x}. That is the derivative you would get if yy moved along with xx, which is not what a partial derivative asks. In fx\frac{\partial f}{\partial x} the variable yy is frozen, so cosy\cos y has derivative zero with respect to xx and the product rule collapses to a constant multiple.

  • Ask which letter is moving before you write a single symbol.
  • The factor with no moving letter in it is a constant multiplier, not a term to differentiate.
  • You only need the product rule when both factors contain the moving variable, as in xsinxx\sin x.

A quick sanity check at the origin: fx(0,0)=cos0cos0=1\frac{\partial f}{\partial x}(0,0) = \cos 0\cos 0 = 1 and fy(0,0)=sin0sin0=0\frac{\partial f}{\partial y}(0,0) = -\sin 0 \sin 0 = 0. That matches the surface. The whole line x=0x = 0 sits at height zero, since f(0,y)=sin0cosy=0f(0,y) = \sin 0\cos y = 0 for every yy, so walking along it changes nothing, while stepping off it in xx lifts you at unit slope.

Why physicists like this surface

Differentiate twice in each variable and you get 2fx2=sinxcosy\frac{\partial^2 f}{\partial x^2} = -\sin x \cos y and 2fy2=sinxcosy\frac{\partial^2 f}{\partial y^2} = -\sin x \cos y. Adding them gives a clean relation.

2fx2+2fy2=2f\frac{\partial^2 f}{\partial x^2} + \frac{\partial^2 f}{\partial y^2} = -2f

So ff is an eigenfunction of the Laplacian with eigenvalue 2-2. On the square 0xπ0 \le x \le \pi, 0yπ0 \le y \le \pi it is pinned to zero along the edges x=0x = 0 and x=πx = \pi, and fy=sinxsiny\frac{\partial f}{\partial y} = -\sin x\sin y vanishes along the other two edges, so it is a genuine standing wave mode. Products like this are what separation of variables hands you when you solve a partial differential equation on a rectangle.

Frequently asked questions

Why is there a minus sign in the y partial but not the x partial?

Because ddycosy=siny\frac{d}{dy}\cos y = -\sin y while ddxsinx=cosx\frac{d}{dx}\sin x = \cos x. The minus comes from the cosine factor, and cosine is the factor carrying yy.

Are the mixed partials equal here?

Yes. Differentiating cosxcosy\cos x \cos y by yy gives cosxsiny-\cos x \sin y, and differentiating sinxsiny-\sin x \sin y by xx gives the same thing. The function is smooth everywhere, so Clairaut's theorem guarantees it.