The derivation would be: 2x + cos (xy) [ 1 + x dy/dx ] + 2y dy/dx = 0
that is: 2x + cos ( xy ) + x cos(xy) dy/dx + 2y dy/dx = 0
now you can find dy/dx
However yes, the derivative of sin(u) with respect to x is cos(u)(du/dx). And the derivative of u= xy, with respect to x, is (dx/dx)y+ x(dy/dx)= y+ xdy/dx so that the derivative of sin(xy), with respect to x, is cos(xy)(y+ x dy/dx).