# $y'[x] = \frac{y}{x-y}$ Non-linear differential equation or not?

$\displaystyle \qquad y'[x] = \frac{y}{x-y}=\frac{ \frac{y}{x} }{ 1-\frac{y}{x} }=\frac{u}{1-u}$

so

$\displaystyle \qquad u = \frac{y}{x} \rightarrow y=ux,\qquad y'[x] = u$

$\displaystyle \qquad u = \frac{u}{1-u} \rightarrow u^{2}=0$

But wolframalpha states that it a first order non-linear ODE here and its solution: $$y(x) = - \frac{x} {W(-e^{-C_{1} x})}$$ where $W(z)$ is a product log function(?!).

Could someone explain which way is the right and which is really the solution. My friend just said that he solved it by integrating, separating $x$'s and $y$'s to different sides but I cannot get it that way.

[update] thanks to joriki: $$\frac{d u}{d x} = \frac{u}{1-u}-u=\frac{u^{2}}{1-u}$$ and after integrating $$\frac{-1}{u}-\ln(u)-x+C=0$$ but not yet the solution, thinking...but how to get to the solution suggested by WA now? I cannot see a way to solve it now just for x or just for y. Ideas?

-
The step from $y=ux$ to $y'=u$ is wrong; it should be $y'=u+u'x$ instead, since $u$ may depend on $x$. –  joriki May 25 '11 at 19:10
note that, in the update, you used $y'=u+u'$ instead of $y'=u+u'x$. –  Shai Covo May 25 '11 at 20:56
If you are interested in telling if it's linear, then use the linear operator format L[y] to describe the equation, and check whether L[$y_1+y_2$]= L[$y_1]+L[y_2$], and L[cy]=cL[y] –  gary Jun 9 '11 at 14:10

As Shai pointed out in the comments, the factor $x$ is missing in your update. It should be

$$xu'=\frac{u^2}{1-u}\,$$

and thus

$$\begin{eqnarray} u'\frac{1-u}{u^2} &=& \frac{1}{x}\;, \\ -\frac{1}{u}-\log u &=& \log x + c\;, \end{eqnarray}$$

which leads to Shai's result if you plug in $u=y/x$ and cancel $\log x$. To get to the WolframAlpha result, you can switch to $v=-1/u=-x/y$ to get

$$\begin{eqnarray} v+\log(-v) &=& \log x + c\;, \\ v\mathrm e^v &=& -\mathrm e^c x\;, \\ v &=& W(-\mathrm e^c x)\;, \\ -\frac{x}{y} &=& W(-\mathrm e^c x)\;, \\ y &=& -\frac{x}{W(-\mathrm e^c x)}\;. \end{eqnarray}$$

Note that there's a typo in your rendition of WolframAlpha's result; the $x$ shouldn't be in the exponent.

-

You may prefer the following approach.

First rewrite the equation as $- y'y = y - y'x$, leading to $$- \frac{{y'}}{y} = \frac{{y - y'x}}{{y^2 }},$$ and in turn $$- \frac{d}{{dx}}\log y = \frac{d}{{dx}}\frac{x}{y}.$$ Integrating both sides then gives $$- \log y = \frac{x}{y} + C.$$

-
...but it is not anything that Wolframalpha gives but the form is similar to mine. What is the solution of this function then? You don't have $y$ as a function of just $x$ but you have $y$ there as parameter -- so what is the conclusion? How does WA solves the solution? –  hhh May 25 '11 at 22:52
As stated, this is only an alternative approach, which you may prefer. To continue, you may consider the ProductLog function; see mathworld.wolfram.com/LambertW-Function.html –  Shai Covo May 25 '11 at 23:09