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

Theorem
The first order ODE:
 * $(1): \quad \paren {y - \dfrac 1 x} \rd x + \paren {x - y} \rd 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:


 * $\map M {x, y} = y - \dfrac 1 x$


 * $\map N {x, y} = 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:
 * $\map f {x, y} = C$

where:

Hence:

and:

Thus:
 * $\map f {x, y} = 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$