Multivariable calculus

Partial Derivatives of sin(xy)

For f(x, y) = sin(xy), the partial derivative with respect to x is y cos(xy), and the partial derivative with respect to y is x cos(xy). The chain rule gives cosine of the inside, then multiplies by the derivative of the inside product xy, which is y when x moves and x when y moves.

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

Outside first, then the inside

Name the inside u=xyu = xy, so f=sinuf = \sin u. The chain rule for partials says differentiate the outside at the inside, then multiply by the partial derivative of the inside.

fx=cos(u)ux=cos(xy)y\frac{\partial f}{\partial x} = \cos(u)\,\frac{\partial u}{\partial x} = \cos(xy)\cdot y

With yy held fixed, u=xyu = xy is a straight line in xx with slope yy, so ux=y\frac{\partial u}{\partial x} = y. Symmetrically uy=x\frac{\partial u}{\partial y} = x, which gives the second partial.

fy=cos(xy)x\frac{\partial f}{\partial y} = \cos(xy)\cdot x

At (2,3)(2,3) the inside is 66, so fx=3cos62.881\frac{\partial f}{\partial x} = 3\cos 6 \approx 2.881 and fy=2cos61.920\frac{\partial f}{\partial y} = 2\cos 6 \approx 1.920. Same cosine, different multipliers.

The mistake: forgetting the inside factor

Students write fx=cos(xy)\frac{\partial f}{\partial x} = \cos(xy) and stop. That answer would be correct if the inside were just xx. Here the inside changes yy times as fast as xx does, so the rate of change of ff is scaled by yy. Drop that factor and your answer is wrong by a whole variable.

  • Write the inside function down explicitly before you differentiate.
  • Check units of variation: if y=0y = 0 then f=sin0=0f = \sin 0 = 0 for every xx, so fx\frac{\partial f}{\partial x} must be zero along that line, and ycos(xy)y\cos(xy) is.
  • The bare answer cos(xy)\cos(xy) fails that test, since it equals 11 when y=0y = 0.

A symmetry you can use as a check

Multiply the first partial by xx and the second by yy and you get the same expression, xycos(xy)xy\cos(xy). So the two partials satisfy a single relation at every point.

xfx=yfyx\,\frac{\partial f}{\partial x} = y\,\frac{\partial f}{\partial y}

That is exactly what you expect for a function that depends on xx and yy only through the product xyxy. Any such function is constant along the hyperbolas xy=cxy = c, and the relation above is the algebraic fingerprint of that.

Frequently asked questions

Is sin(xy) the same as sin(x)sin(y)?

No. sin(xy)\sin(xy) has a product inside one sine, while sinxsiny\sin x \sin y is a product of two sines. Test at x=y=π2x = y = \frac{\pi}{2}: the first is sin(π24)0.624\sin\left(\frac{\pi^2}{4}\right) \approx 0.624, the second is 11.

What is the gradient of sin(xy)?

It is f=cos(xy)(y,x)\nabla f = \cos(xy)\,(y, x). The cosine sets the size and sign, and the vector (y,x)(y, x) sets the direction, which is perpendicular to the level hyperbola through the point.