Firstly, let's apply the derivative operator to both sides, I'll try my best to colour code the use of the product rule:

#d/dx [color(red)(ycos(x^2)) color(teal)(- y^2)] = d/dx[color(purple)(x)color(orange)y]#

#color(red)(dy/dx * cos(x^2) + y * (-sin(x^2) * 2x)) color(teal)(- 2y * dy/dx) = color(purple)(1) * color(orange)(y) + color(purple)(x) * color(orange)(dy/dx)#

#dy/dx * cos(x^2) - 2y * dy/dx - x * dy/dx = 2xy * sin(x^2) + y #

#dy/dx (cos(x^2) - 2y - x) = 2xy * sin(x^2) + y#

#dy/dx = (2xy * sin(x^2) + y)/(cos(x^2) - 2y - x)#

#dy/dx = (y(2xsin(x^2 + 1)))/(cos(x^2) - x - 2y)#.