First Order ODE/(y - 1 over x) dx + (x - y) dy = 0

Theorem
The first order ODE:
 * $(1): \quad \left({y - \dfrac 1 x}\right) \, \mathrm d x + \left({x - y}\right) \mathrm d y = 0$

is an exact differential equation with solution:
 * $x y - \ln x - \dfrac {y^2} 2 + C$

Proof
Let $M$ and $N$ be defined as:


 * $M \left({x, y}\right) = y - \dfrac 1 x$


 * $N \left({x, y}\right) = x - y$

Then:

Thus $\dfrac {\partial M} {\partial y} = \dfrac {\partial N} {\partial x}$ and $(1)$ is seen by definition to be exact.

By Solution to Exact Differential Equation, the solution to $(1)$ is:
 * $f \left({x, y}\right) = C$

where:

Hence:

and:

Thus:
 * $f \left({x, y}\right) = x y - \ln x - \dfrac {y^2} 2$

and by Solution to Exact Differential Equation, the solution to $(1)$ is:


 * $x y - \ln x - \dfrac {y^2} 2 + C$