dy/dx - y/x = 0

I got 1/x, but I am not sure if this is right or not.

well, did you try it?

d/dx (y/x) = 1/x y' - y/x^2

so, now you have an exact differential, which is what you wanted.