TITLE: Find the solution to the following differential equation: $ \frac{dy}{dx} = \frac{x - y}{xy} $
QUESTION [14 upvotes]: The instructor in our Differential Equations class gave us the following to solve:
$$ \frac{dy}{dx} = \frac{x - y}{xy} $$
It was an item under separable differential equations. I have gotten as far as $ \frac{dy}{dx} = \frac{1}{y} - \frac{1}{x} $ which to me doesn't really seem much. I don't even know if it really is a separable equation.
I tried treating it as a homogeneous equation, multiplying both sides with $y$ to get (Do note that I just did the following for what it's worth)...
$$ y\frac{dy}{dx} = 1 - \frac{y}{x} $$
$$ vx (v + x \frac{dv}{dx}) = 1 - v $$
$$ v^2x + vx^2 \frac{dv}{dx} = 1 - v $$
$$ vx^2 \frac{dv}{dx} = 1 - v - v^2x$$
I am unsure how to proceed at this point.
What should I first do to solve the given differential equation?

REPLY [3 votes]: We write the differential equation as
\begin{align*}
xyy^\prime=x-y\tag{1}
\end{align*}
and follow the receipt I.237 in the german book Differentialgleichungen, Lösungsmethoden und Lösungen I by E. Kamke.

We consider $y=y(x)$ as the independent variable and use the substitution
\begin{align*}
v=v(y)=\frac{1}{y-x(y)}=\left(y-x(y)\right)^{-1}\tag{2}
\end{align*}
We obtain from (2)
\begin{align*}
v&=\frac{1}{y-x}\qquad\to\qquad  x=y-\frac{1}{v}\\
v^{\prime}&=(-1)(y-x)^{-2}\left(1-x^{\prime}\right)=\left(\frac{1}{y^{\prime}}-1\right)v^2
\end{align*}
From (1) we  get by taking $v$:
\begin{align*}
\frac{1}{y^{\prime}}=\frac{xy}{x-y}=\left(y-\frac{1}{v}\right)y(-v)=y-y^2v\tag{3}
\end{align*}

Putting (2) and (3) together we get
  \begin{align*}
v^{\prime}=\left(y-y^2v-1\right)v^2
\end{align*}
  respectively
  \begin{align*}
\color{blue}{v^{\prime}+y^2v^3-(y-1)v^2=0}\tag{4}
\end{align*}
and observe (4) is an instance of an Abel equation of the first kind.