Multivariable calculus

Partial Derivatives of sin(xy)cos(z)

For f(x,y,z) = sin(xy)cos(z), the partial derivative with respect to x is y cos(xy)cos(z), with respect to y is x cos(xy)cos(z), and with respect to z is negative sin(xy)sin(z). The cos(z) factor is a constant for the x and y partials, and the minus sign appears only in the z partial.

f(x,y,z)=sin(xy)cos(z)f(x,y,z) = \sin(xy)\cos(z)
fx=ycos(xy)cos(z)\frac{\partial f}{\partial x} = y\cos(xy)\cos(z)
fy=xcos(xy)cos(z)\frac{\partial f}{\partial y} = x\cos(xy)\cos(z)
fz=sin(xy)sin(z)\frac{\partial f}{\partial z} = -\sin(xy)\sin(z)

Split the function before you differentiate

This function factors into a part that depends only on xx and yy and a part that depends only on zz. Whenever a function splits like that, each partial derivative differentiates one factor and copies the other down unchanged. No product rule is needed, because one of the two factors is constant for the variable in question.

For fx\frac{\partial f}{\partial x}, the factor cos(z)\cos(z) is a constant. Differentiate sin(xy)\sin(xy) with respect to xx: the outside derivative is cos(xy)\cos(xy) and the inside derivative of xyxy with respect to xx is yy.

fx=cos(xy)ycos(z)=ycos(xy)cos(z)\frac{\partial f}{\partial x} = \cos(xy)\cdot y \cdot \cos(z) = y\cos(xy)\cos(z)

The yy partial is identical with the roles of xx and yy swapped, giving xcos(xy)cos(z)x\cos(xy)\cos(z). For fz\frac{\partial f}{\partial z} the factor sin(xy)\sin(xy) is the constant, and the derivative of cos(z)\cos(z) is sin(z)-\sin(z).

fz=sin(xy)sin(z)\frac{\partial f}{\partial z} = -\sin(xy)\sin(z)

The mistake: losing the inside derivative or the minus sign

The single most common error is writing cos(xy)cos(z)\cos(xy)\cos(z) for the xx partial and forgetting the factor yy. The argument of the sine is xyxy, not xx, so the chain rule owes you the inside derivative. A quick way to notice is dimensional: differentiating with respect to xx should leave yy present, and it does.

The second error is a sign. Only the zz partial picks up a minus, because only there do you differentiate a cosine. The xx and yy partials differentiate a sine, which gives a plain cosine with no sign change.

  • Differentiating sin\sin gives +cos+\cos, with the inside derivative attached.
  • Differentiating cos\cos gives sin-\sin, with the inside derivative attached.
  • The inside derivative of xyxy is yy in the xx direction and xx in the yy direction.

A quick numerical spot check

Pick a point where the trigonometry is easy and test all three at once. At (1,0,0)(1,0,0) the argument xyxy is 00 and zz is 00, so cos(xy)=1\cos(xy) = 1, sin(xy)=0\sin(xy) = 0, cosz=1\cos z = 1 and sinz=0\sin z = 0.

That gives fx=0f_x = 0, fy=1f_y = 1 and fz=0f_z = 0. The middle value makes sense: near that point, holding x=1x = 1 and z=0z = 0, the function behaves like sin(y)\sin(y), whose slope at y=0y = 0 is exactly 11. The other two vanish because moving in xx or zz from there does not change the value to first order.

Frequently asked questions

Why is there no product rule for the x partial?

The product rule is needed when both factors depend on the differentiating variable. Here cos(z)\cos(z) does not depend on xx at all, so it is a constant multiplier and rides along untouched. You would need the product rule for 2fyx\frac{\partial^2 f}{\partial y\,\partial x}, since ycos(xy)y\cos(xy) has two yy dependent factors.

Are the mixed partials equal here?

Yes. Sines, cosines and products of them are smooth everywhere, so Clairaut's theorem applies and the order of differentiation does not matter for any pair of variables.