# Solving $\frac{dy}{dx}=\frac{y^2}{x}$

The following differential equation is given: $$\frac{dy}{dx}=\frac{y^2}{x}$$

Separating variables and integrating: $$\int y^{-2} dy = \int x^{-1} dx$$ $$-y^{-1}=\ln|x|+c$$ $$y=\frac{1}{-c-\ln |x|}$$

But the solution is given as: $$y=\frac{1}{-c-\ln x}$$

How can this omission of the modulus be explained?

• The absolute value is sometimes skipped for convenience, if the domain is assumed to be $(0,\infty)$. – Dylan Jul 19 '18 at 16:22

The solution given is for $x>0$ only. There is also the solution $$y=\frac{1}{-c-\ln(-x)}$$ for $x<0$ only. No solution may cross $x=0$.