Given: xsin(y) + cos (xy) = x^2
Differentiate all of the terms with respect to x:
(d(xsin(y)))/dx + (d(cos (xy)))/dx = (d(x^2))/dx" [1]"
For the first term, we must use the product rule,
(d(gh))/dx = (dg)/dx(h)+(g)(dh)/dx,
where g = x, h=sin(y), (dg)/dx = 1, and (dh)/dx = cos(y)dy/dx:
(d(xsin(y)))/dx = (1)sin(y)+(x)cos(y)dy/dx
Substitute the above into equation [1]:
sin(y)+(x)cos(y)dy/dx + (d(cos (xy)))/dx = (d(x^2))/dx" [1.1]"
For the second term, we must use the chain rule:
(d(cos (xy)))/dx = -sin(xy)(d(xy))/dx
Then the product rule:
(d(cos (xy)))/dx = -sin(xy)(y+xdy/dx)
Substitute the above equation into equation [1.1]:
sin(y)+(x)cos(y)dy/dx - sin(xy)(y+xdy/dx) = (d(x^2))/dx" [1.1]"
Use the power rule for the last term:
sin(y)+(x)cos(y)dy/dx - sin(xy)(y+xdy/dx) = 2x
Move all of the terms that do not contain dy/dx to the right side:
xcos(y)dy/dx - xsin(xy)dy/dx = 2x-sin(y)+ysin(xy)
Factor out dy/dx from the left side:
(xcos(y) - xsin(xy))dy/dx = 2x-sin(y)+ysin(xy)
Divide both sides by the leading coefficient:
dy/dx = (2x-sin(y)+ysin(xy))/(xcos(y) - xsin(xy))