Constant when integrating both sides So I have an equation:
$$x \frac{dy}{dx} + (x-1)  y^2 = 0.$$ 
Can't use the integrating factor, so I simplify it to:
$$\frac{dy}{dx} + \left(y-\frac{y}{x}\right)y = 0 $$
$$\frac{dy}{dx} = \frac{y^2}{x} - y^2$$
Integrating both sides with respect to $x$ should give:
$$y = y^2 \ln(|x|) - y^2 x.$$
However, if I add a constant on RHS or LHS I won't be able to solve for y. I feel like it would also be wrong to solve for $y$ first and then just add $c$ like so: 
$$y = \frac{1}{\ln(|x|) - x}+c$$
Might be a bit of a stupid question, but I would appreciate some clarification. 
 A: The issue is that you integrated $y$ with respect to $x,$ and concluded that it was equal to $y.$ This is only viable if $y=ae^x$ for some constant $a,$ which we have no reason to suspect ahead of time. Instead, we should proceed by separating the variables, to get $$\frac1{y^2}\frac{dy}{dx}=1-\frac1{x}.$$ Now we can integrate both sides with respect to $x.$ I leave the right-hand side to you. (Don't forget the constant of integration.) The left-hand side is then $$\int\frac{1}{y^2}\frac{dy}{dx}\,dx=\int\frac1{y^2}\,dy=-\frac1{y}.$$ (Here, we don't need the constant of integration, so long as we include it on the right-hand side.) What we just did here is use the integration analogue of the chain rule for derivatives, since $$\frac{d}{dx}\left[-\frac1y\right]=\frac{d}{dy}\left[-\frac1y\right]\cdot\frac{dy}{dx}=\frac1{y^2}\frac{dy}{dx}.$$ Effectively, this lets us treat $\frac{dy}{dx}$ like a fraction, so we can instead abuse notation slightly, and separate variables instead as $$\frac1{y^2}\,dy=\left(1-\frac1x\right)\,dx,$$ then "integrate both sides" (without respect to a specific variable). It's a handy shortcut, but we need to make sure we don't try to treat $dx$ and $dy$ like normal quantities in all contexts.
Welcome to Math.SE!
A: Hint: rewrite this as $\large{\frac{dy}{y^2}=(\frac{1}{x}-1)dx}$ and integrate both sides.
