TITLE: Solve the ODE $yy'' + (y')^2 = 0$
QUESTION [5 upvotes]: I am asked in a book to solve the following ODE:
$$y\dfrac{d^2y}{dt^2} + \left(\dfrac{dy}{dt}\right)^2 = 0$$
One solution for the ODE above is $y = 0$.
I will use the following substitution:
$$v = \dfrac{dy}{dt}$$
Therefore, $y''$ will become, in terms of $v$:
$$\dfrac{d^2y}{dt^2} = \dfrac{dv}{dt} = \left( \dfrac{dv}{dy} \right)\left( \dfrac{dy}{dt} \right) = v\dfrac{dv}{dy}$$
(Explanation for the substitution: in the original equation, that has the form $y''=f(y,y')$, the independent variable $t$ doesn't appear explicitly, only through the dependent variable $y$. Therefore, if we let $v=\dfrac{dy}{dt}$, we can obtain a differential equation in terms of $y$ and $v$ only. Thus, $v$ can be treated as a function of $y$ only, $y$ being treated as the independent variable.)
Substituting $v$ for $\dfrac{dy}{dt}$ and $v\dfrac{dv}{dy}$ for $\dfrac{d^2y}{dt^2}$ in the original equation gives the following ODE:
$$yv\dfrac{dv}{dy} + v^2 = 0$$
One solution to the ODE above is $v(y) = 0$, which gives $y = k$ (where $k$ is a constant).
For $v \neq 0$, I will solve the ODE above for $v$ (by separating variables):
$$\dfrac{dv}{v}=-\dfrac{dy}{y}$$
Integrating both sides:
$$\ln|v| = -\ln|y| + c$$
$$|v| = e^{-\ln|y| + c}$$
$$v = \pm e^{-\ln|y| + c} = \pm \dfrac{e^{c}}{e^{ln|y|}}$$
$$v = \frac{c_1}{|y|} \ \ \ \ \text{where } c_1 = \pm e^{c}$$
Substituting back $\dfrac{dy}{dt}$ for $v$:
$$\dfrac{dy}{dt} = \dfrac{c_1}{|y|}$$
$$|y|dy = c_1dt$$
Integrating both sides (remembering that $\int |y| dy = \dfrac{y|y|}{2}$) gives the solution to the original ODE:
$$\dfrac{y|y|}{2} = c_1t + c_2$$
But the answer given by the book in the answer section is slightly different: $y^2 = c_1t + c_2$, which would be equal to my answer if $y$ if I removed the absolute value bars.
Is my solution correct?
Update: In the step of solving $\dfrac{dv}{v}=-\dfrac{dy}{y}$, if I integrated it like this: $\ln v = -\ln y + c$ (instead of $\ln|v| = -\ln|y| + c$), I would obtain the same answer as the book ($y^2 = c_1t + c_2$, without the absolute value signs). But it seems there is no justification for removing the absolute value signs in $\ln|v| = -\ln|y| + c$ (there would be if $y$ were always non-negative). Is my reasoning wrong?

REPLY [7 votes]: $$
yy''+y'^{\,2}=0\tag{1}
$$
$$
\frac{y'}{y}+\frac{y''}{y'}=0\tag{2}
$$
$$
\log|y|+\log|y'|=\log(a)\tag{3}
$$
$$
|yy'|=a\tag{4}
$$
$$
\frac12y|y|=ax+b\tag{5}
$$

If $y'=0$ and $y=b\ne0$, then $(1)$ says that $y''=0$ so that $y'\equiv0$ and 
$$
y\equiv b\tag{6}
$$
If $y=y'=0$, then $(1)$ gives no information about $y''$. As in $(6)$, $y\equiv0$ is a solution. However, if $a\ne0$, as $ax+b$ tends to $0$ in $(5)$, $y'$ grows unbounded, so there is no solution for all of $\mathbb{R}$. Thus, the only solutions for all $\mathbb{R}$ are given by $(6)$.