Solve the ODE $yy'' + (y')^2 = 0$ 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?
 A: $$
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)$.
A: An identity which might or might not jump at the reader's face when reading this is 
$$yy''+(y')^2=(yy')'.
$$
Supplemented by the identity $yy'=\frac12(y^2)'$, this yields $y^2(t)=at+b$ for some $(a,b)$, for every $t$ in an interval where $at+b\gt0$. At the boundary of the interval, $y$ is not differentiable hence this cannot be extended to $at+b\geqslant0$. 
Equivalently, either $y(t)=c\cdot\sqrt{t-t_0}$ for every $t\gt t_0$, for some nonzero $c$, or $y(t)=c\cdot\sqrt{t_0-t}$ for every $t\lt t_0$, for some nonzero $c$, or $y(t)=0$ for every $t$.
Edit: (About some absolute values which seem to annoy the OP...)
Note that if $y|y|=at+b$, then, around any $t_1$ such that $at_1+b\ne0$, either $y^2(t)=at+b$ or $y(t)^2=-at-b$. Possibly changing $(a,b)$, this means that $y(t)^2=at+b$ around every $t_1$ such that $y(t_1)\ne0$. Now, it happens that every such solution is either $y(t)=c\cdot\sqrt{t-t_0}$ or $y(t)=c\cdot\sqrt{t_0-t}$ for some $c$ and $t_0$ that are easy to guess, and that, the degenerate case $c=0$ excepted, these solutions are valid in the maximal interval $(t_0,+\infty)$ or $(-\infty,t_0)$. Finally, they are not valid at $t_0$ itself because the square root function is not differentiable at $0$. This completes the picture.
