# How to solve the homogeneous differential equation?

Solve the following differential equation: $$y' = \frac{2xy}{x^2-y^2}$$

Someone please help me to finish this problem. My solution so far: $$\frac{dy}{dx} = \frac{\frac{1}{x^2}(2xy)}{\frac{1}{x^2}(x^2-y^2)}$$ $$\frac{dy}{dx}= 2\frac{y}{x} * \frac{1}{1-{\frac{y^2}{x^2}}}$$ Let $v = \frac{y}{x}$, $y=vx$ then $\frac{dy}{dx} = v+x\frac{dv}{dx}$ $$\frac{dy}{dx} = \frac{2v}{1-v^2}$$ Setting the two equations equal to one another: $$v+x\frac{dv}{dx} = \frac{2v}{1-v^2}$$ $$x\frac{dv}{dx} = \frac{2v}{1-v^2} - \frac{v-v^3}{1-v^2}$$ $$x\frac{dv}{dx} = \frac{v+v^3}{1-v^2}$$ $$xdv = \frac{v+v^3}{1-v^2}dx$$ $$\frac{1-v^2}{v+v^3}dv = \frac{1}{x}dx$$ $$\int\frac{1-v^2}{v+v^3}dv = \int\frac{1}{x}dx$$ $$\ln \left|v\right|-\ln \left|v^2+1\right| = ln|x| + c$$ Substituting $\frac{y}{x}$ back for $v$: $$\ln \left|\frac{y}{x}\right|-\ln \left|\frac{y^2}{x^2}+1\right| = ln|x| + c$$ $$\ln \left|{y}\right|-\ln|x|-\ln \left|\frac{y^2}{x^2}+1\right| = ln|x| + c$$ Taking $e$ to everything we obtain: $$y - x - (\frac{y^2}{x^2}+1) = x + e^c$$ $$y - (\frac{y^2}{x^2}+1) = 2x + e^c$$ $$y - \frac{y^2}{x^2} - 1= 2x + e^c$$ $$y - \frac{y^2}{x^2} = 2x + e^c + 1$$ $$\frac{x^2y-y^2}{x^2} = 2x + e^c + 1$$ $$x^2y-y^2 = 2x^3 + x^2e^c + x^2$$ $$0 = y^2 - x^2y + 2x^3 + x^2e^c + x^2$$

Using the quadratic formula we obtain $$y = \frac{x^2±\sqrt{x^4-8x^3-4x^2e^c-4x^2}}{2}$$ $$y = \frac{x^2±\sqrt{x^2(x^2-8x-4e^c-4)}}{2}$$ $$y = \frac{x^2±x\sqrt{x^2-8x-4e^c-4}}{2}$$

• I think you would like to review you step before $\ln|v|=\ln|v^2-1|=\ln|x| +C$ Apr 21, 2017 at 0:05
• @UddeshyaSingh integration is wrong? Apr 21, 2017 at 0:07
• NO. False alarm. Your answer is fine. Apr 21, 2017 at 0:09

From $\ln |v| - \ln |v^2 + 1| = \ln x + c$ we get $\ln \left|\frac{v}{v^2 + 1}\right| = \ln x + c \Rightarrow \frac{v}{1+v^2}= Ax$. So $$v = Ax + Axv^2 \Rightarrow\frac{y}{x} = Ax + A\frac{y^2}{x} \Rightarrow y = Ax^2 + Ay^2$$
And now solve for $y$ since $Ay^2 - y + Ax^2= 0$ is a quadratic in $y$.
• @socrates I thought I replied to this, but my comment seems to be missing... anyway it's just for neatness: I let $c=\ln A$ for convenience, which I can do since it's an arbitrary constant. If you're uncomfortable with this, then note that exponentiating both sides in the first line gives $\frac{v}{1+v^2}=e^c x$ so your quadratic is $e^c y^2 - y + e^c x^2 = 0$ which you're entitled to do if you wish, but just makes the writing/algebra slightly more tedious. Apr 21, 2017 at 0:27
In such problems it pays to describe the solution curves in polar coordinates. If $$\phi\mapsto\bigl(r(\phi)\cos\phi,\> r(\phi)\sin\phi\bigr)$$ is a solution curve then $y'={\displaystyle{\dot y\over\dot x}}$, where the dot denotes differentiation with respect to $\phi$. It follows that $$y'={2xy\over x^2-y^2}$$ translates into $${\dot r\sin\phi+r\cos\phi\over\dot r\cos\phi-r\sin\phi}={\sin(2\phi)\over\cos(2\phi)}\ .$$ This is equivalent to $${\dot r\over r}={\cos\phi\over\sin\phi}\ ,$$ so that the solution curves turn out to have the polar description $$r(\phi)=C\>\sin\phi\ .$$ It is easy to verify that these curves are circles through the origin.