1. ## First-order ODE.

I am trying to solve the following differential equation but cannot get a method that will work.

dy/dx=(y^2)/(xy-x^2)

I have tried making it exact as well as various substitutions. All to no avail. I am thinking some sort of combination of variables might work, but I am stumped.

2. ## re: First-order ODE.

The equation has an integrating factor that depends on $\displaystyle x$ .

3. ## re: First-order ODE.

Would you mind a little explanation on how you were able to deduce that?

4. ## re: First-order ODE.

Originally Posted by cheme
I am trying to solve the following differential equation but cannot get a method that will work.

dy/dx=(y^2)/(xy-x^2)

I have tried making it exact as well as various substitutions. All to no avail. I am thinking some sort of combination of variables might work, but I am stumped.
\displaystyle \displaystyle \begin{align*} \frac{dy}{dx} &= \frac{y^2}{xy - x^2} \\ \frac{dx}{dy} &= \frac{xy - x^2}{y^2} \\ \frac{dx}{dy} &= \frac{xy}{y^2} - \frac{x^2}{y^2} \\ \frac{dx}{dy} &= \frac{x}{y} - \left(\frac{x}{y}\right)^2 \\ \end{align*}

Now make the substitution $\displaystyle \displaystyle v = \frac{x}{y} \implies x = vy \implies \frac{dx}{dy} = v + y\,\frac{dv}{dy}$ and the DE becomes

\displaystyle \displaystyle \begin{align*} \frac{dx}{dy} &= \frac{x}{y} - \left(\frac{x}{y}\right)^2 \\ v + y\,\frac{dv}{dy} &= v - v^2 \\ y\,\frac{dv}{dy} &= -v^2 \\ v^{-2}\,\frac{dv}{dy} &= -\frac{1}{y} \\ \int{v^{-2}\,\frac{dv}{dy}\,dy} &= \int{-\frac{1}{y}\,dy} \\ \int{v^{-2}\,dv} &= -\ln{|y|} + C_1 \\ \frac{v^{-1}}{-1} + C_2 &= \ln{|y|} + C_1 \\ -\frac{1}{v} &= \ln{|y|} + C\textrm{ where }C = C_1 - C_2\\ -\frac{y}{x} &= \ln{|y|} + C \\ x &= -\left(\frac{y}{\ln{|y|} + C}\right)\end{align*}

5. ## Re: First-order ODE.

Originally Posted by cheme
Would you mind a little explanation on how you were able to deduce that?
If $\displaystyle Pdx+Qdy=0$ has an integrating factor of the form $\displaystyle \mu=\mu(x)$ then $\displaystyle (\mu P)_y=(\mu P)_x$ . Solving you'll obtain $\displaystyle \frac{\mu'}{\mu}=\ldots =\dfrac{1}{Q}(P_y-Q_x)=F(x)$ . In our case , verify that $\displaystyle \dfrac{1}{Q}(P_y-Q_x)=\dfrac{-2}{x}$ .

6. ## Re: First-order ODE.

Originally Posted by FernandoRevilla
If $\displaystyle Pdx+Qdy=0$ has an integrating factor of the form $\displaystyle \mu=\mu(x)$ then $\displaystyle (\mu P)_y=(\mu P)_x$ .
I'm sure FernandoRevilla meant $\displaystyle (\mu P)_{y}=(\mu Q)_{x}.$

Solving you'll obtain $\displaystyle \frac{\mu'}{\mu}=\ldots =\dfrac{1}{Q}(P_y-Q_x)=F(x)$ . In our case , verify that $\displaystyle \dfrac{1}{Q}(P_y-Q_x)=\dfrac{-2}{x}$ .
One way to get an integrating factor is to posit an integrating factor of the form $\displaystyle h(x^{n}y^{m}).$ Multiply through, take your partial derivatives, turn the crank, etc. The nice thing about doing it this way is that it takes care of a lot of situations in one fell swoop. It won't solve every first-order DE, not even all first-order DE's solvable by means of an integrating factor. But it will solve quite a few.

7. ## Re: First-order ODE.

Originally Posted by Ackbeet
I'm sure FernandoRevilla meant $\displaystyle (\mu P)_{y}=(\mu Q)_{x}.$
I'm sure too.