solving the following diff eq:

ydx+xdy=0

a simple one indeed, i saw it as y being a partial derivative of a function U(x,y) in order to x and x being the partial derivative of the same function now in order to y, integrated found the constants and everything nice till i found the solution y=C/x which substituting back in the equation makes ydx+xdy equal to zero so its indeed a solution.

my problem is that in the prosses of solving the equation I said that the integral of ydx is yx but if i substitute y for C/x before the integral I get a different result from the one I get if i substitute after the integral, whats the explanation for that? what's wrong here?

Can somebody help me plz?