Multivariable calculus

Partial Derivatives of x sin(xy)

For f(x,y) = x sin(xy), the partial with respect to x is sin(xy) + xy cos(xy), and the partial with respect to y is x^2 cos(xy). The x-partial needs the product rule on x times sin(xy) plus the chain rule inside the sine. The y-partial needs only the chain rule.

f(x,y)=xsin(xy)f(x,y) = x \sin(xy)
fx=sin(xy)+xycos(xy)\frac{\partial f}{\partial x} = \sin(xy) + xy\cos(xy)
fy=x2cos(xy)\frac{\partial f}{\partial y} = x^{2}\cos(xy)

Product rule outside, chain rule inside

Differentiating in xx means two rules stacked. The outer structure is a product, xx times sin(xy)\sin(xy), and the second factor is itself a composition whose inside is xyxy. Do the product rule first, then handle the sine.

fx=1sin(xy)+xx[sin(xy)]\frac{\partial f}{\partial x} = 1 \cdot \sin(xy) + x \cdot \frac{\partial}{\partial x}\bigl[\sin(xy)\bigr]

With yy frozen, the inside xyxy has xx-derivative yy, so the chain rule gives ycos(xy)y\cos(xy). Substituting that back in and simplifying gives the answer.

fx=sin(xy)+xycos(xy)\frac{\partial f}{\partial x} = \sin(xy) + xy\cos(xy)

In yy the picture is simpler. The leading xx is now a constant multiplier, so there is no product to differentiate; only the chain rule acts, and the inside xyxy has yy-derivative xx. That second xx is where the square comes from.

fy=xxcos(xy)=x2cos(xy)\frac{\partial f}{\partial y} = x \cdot x\cos(xy) = x^{2}\cos(xy)

The mistake: losing the inner derivative

The most common wrong answer for the yy-partial is xcos(xy)x\cos(xy). That drops the inner derivative and leaves you one factor of xx short. Every time the inside of a trig function is a product of variables, the chain rule contributes the other variable.

  • Differentiating sin(xy)\sin(xy) in xx contributes yy, not 1.
  • Differentiating sin(xy)\sin(xy) in yy contributes xx, not 1.
  • The outer xx in ff is differentiated only in the xx-partial, never in the yy-partial.

A second slip is writing the xx-partial as sin(xy)+xcos(xy)\sin(xy) + x\cos(xy), which forgets the inner yy on the chain rule term. Check the shape of that term: it must carry both an xx from the product rule and a yy from the inside.

Reading the answer at a point

Take x=1x = 1 and y=π2y = \frac{\pi}{2}. Then xy=π2xy = \frac{\pi}{2}, so sin(xy)=1\sin(xy) = 1 and cos(xy)=0\cos(xy) = 0. The cosine term switches off entirely.

fx(1,π2)=1,fy(1,π2)=0\frac{\partial f}{\partial x}\left(1, \tfrac{\pi}{2}\right) = 1, \qquad \frac{\partial f}{\partial y}\left(1, \tfrac{\pi}{2}\right) = 0

The zero in the yy direction is honest information: at that point the sine has hit its peak, so nudging yy changes nothing to first order. Moving in xx still changes ff, because the leading factor of xx is growing.

Frequently asked questions

Do I need the product rule for the y-partial as well?

No. With xx held fixed, ff is a constant xx times sin(xy)\sin(xy), and a constant multiple does not trigger the product rule. Only the chain rule is needed, which brings down the inner derivative xx and gives x2cos(xy)x^{2}\cos(xy).

Are the mixed second partials equal here?

Yes. Differentiating fx=sin(xy)+xycos(xy)\frac{\partial f}{\partial x} = \sin(xy) + xy\cos(xy) with respect to yy gives 2xcos(xy)x2ysin(xy)2x\cos(xy) - x^{2}y\sin(xy), and differentiating fy=x2cos(xy)\frac{\partial f}{\partial y} = x^{2}\cos(xy) with respect to xx gives the same thing. Clairaut's theorem guarantees this, since ff is smooth everywhere.