Find a general solution to $xy' = y^2+y$ I'm trying to find the general solution to $xy' = y^2+y$, although I'm unsure as to whether I'm approaching this correctly.
What I have tried:
dividing both sides by x and substituting $u = y/x$ I get:
$$y' = u^2x^2+u$$
Then substituting $y' = u'x + u$ I get the following:
$$u'x+u = u^2x^2+u \implies u' = u^2x \implies \int\frac{du}{u^2}=\int x dx$$
Proceeding on with simplification after integration:
$$\frac{1}{u}=\frac{x^2}{2}+c\implies y = \frac{2x}{x^2+c}$$
However, the answer shows $y=\frac{x}{(c-x)}$
 A: You say that
$$y' = u^2x^2+u$$
but $$y' = \frac{y^2+y}{x} = \bigg(\frac{y}{x}\bigg)^2 x + u = u^2 x +u.$$ So here's a mistake.
The right solution:
$$xdy = (y^2 + y)dx$$
$$\frac{dy}{y^2+y} = \frac{dx}{x}$$
$$\frac{dy}{y} - \frac{dy}{y+1} = \frac{dx}{x}$$
$$ln|y| - ln|y+1| = ln|x| + C_1$$
$$\frac{y}{y+1} = C x$$
$$1-\frac{1}{y+1} = C x$$
$$1-Cx = \frac{1}{y+1}$$
and so on.
A: It can be done in a simpler way:
\begin{equation}
\frac{dy}{y(y+1)} = \frac{dx}{x} \implies \mathrm{ln}\Big|\frac{y}{y+1}\Big| = \mathrm{ln}|x| + \mathrm{ln}(\tilde{c}), \\
\end{equation}
for some constant $\tilde{c}>0$. Hence it follows that:
\begin{equation}
y = \frac{\tilde{c}x}{1-\tilde{c}x} = \frac{x}{(1/\tilde{c})-x}. \\
\end{equation}
Redefine $1/\tilde{c}$ as $c$ to find the desired result.
A: $$u'x+u = u^2x^2+u $$
$$\implies u' = u^2x \implies \int\frac{du}{u^2}=\int x dx$$
$$\color{red}{\frac{1}{u}}=\frac{x^2}{2}+c\implies y = \frac{2x}{x^2+c}$$
You made a sign mistake:
$$I=\int \dfrac {du}{u^2}=\color{red}{-\dfrac 1 u}+C$$

You made another misttake here:
$$y' = u^2x^2+u$$
This should be:
$$y' = \color{red}{u^2x}+u$$
$$u'x=u^2x$$
$$u'=u^2$$
After integration you   should get the correct answer of the book.
