Solving $y' = \sqrt{|y|}$ I would like to solve the differential equation given by
$$ y' = \sqrt{|y|},\qquad y(0) = 0 $$
This is equivalent, if we suppose that $y > 0$, to
$$ \frac{dy}{dt} = y^{1/2} \text{ if and only if } y^{-1/2} dy = dt $$
so it should be:
$$ 2 y^{1/2} = t + c \implies y = \frac{(t+c)^2}{4}  $$
As a test I have checked that
$$ y' = \frac{t+c}{2} = \sqrt{|y|} = \sqrt{y} $$
However, I would like to know how to obtain other solutions, just as:
$$ y_{\alpha,\beta}(t) = \begin{cases}
-(t-\alpha)^2 / 4 & t < \alpha,\\
0                & \alpha \leq t \leq \beta,\\
(t-\beta)^2/4    & t > \beta
\end{cases}
$$
for any $\alpha < 0 < \beta$, real numbers.
I mean, I don't know how would you find out every solution to this differential equation. Thanks in advance.
 A: $\newcommand{\Strut}{\vphantom{(}}$When performing separation of variables, you can't re-write your ODE as $y^{-1/2}\, dy = dt$ in a neighborhood of $t_{0}$ if $y(t_{0}) = 0$.
What you might do instead is:


*

*Observe that $y(t) = 0$ is a solution in an arbitrary interval.

*If $y(t_{0}) = y_{0} > 0$, separate variables in a neighborhood of $t_{0}$ on which $y$ is positive:
$$
t - t_{0}
  = \int_{t_{0}}^{t} y^{-1/2}\, dy
  = 2\left(\sqrt{y(t)} - \sqrt{y_{0}\Strut}\right),
$$
so $y(t) = \frac{1}{4}\bigl(t - t_{0} + 2\sqrt{y_{0}\Strut}\bigr)^{2}$.

*If $y(t_{0}) = y_{0} < 0$, separate variables in a neighborhood of $t_{0}$ on which $y$ is negative:
$$
t - t_{0}
  = \int_{t_{0}}^{t} (-y)^{-1/2}\, dy
  = -2\left(\sqrt{-y(t)} - \sqrt{-y_{0}\Strut}\right),
$$
so $y(t) = -\frac{1}{4}\bigl(t - t_{0} + 2\sqrt{-y_{0}\Strut}\bigr)^{2}$.

*Observe that all three solutions have $y' = 0$ when $y = 0$ (as required by the ODE), so piecing together formulas over abutting intervals gives continuously-differentiable solutions.
A: $$y=0$$ is a trivial solution, and as $\sqrt{|y|}\ge0$, any solution must be growing. More precisely, negative growing, then zero for a while, then positive growing.
If $y>0$, we can write
$$\frac{y'}{2\sqrt y}=\frac12$$ and
$$\sqrt y=\frac{x-x_+}2$$ for $x>x_+$ or $$y=\frac{(x-x_+)^2}4.$$
Similarly, if $y<0$,
$$y=-\frac{(x_--x)^2}4$$ for $x<x_-$.
Note that the negative and positive sections are optional. In case they both exist, we must have $$x_-\le x_+,$$ and with the given initial condition,
$$x_-\le0\le x_+$$
A: You can easily figure out that for Z ≤ y ≤ 2Z, y' is between $\sqrt Z$ and $\sqrt {2Z}$, so for y to change from Z to 2Z, x must increase by some amount from $\sqrt Z / \sqrt 2$ to $\sqrt Z$, that is x roughly changes by $\sqrt y$. This can give us the idea that maybe $y = x^2$, but in this case $y' = 2x = 2 \sqrt y$.
This is close, but not quite right. So we guess that $y = a \cdot x^2$, so $y' = 2ax = \sqrt {ax^2}$ with two solutions, a = 0 and a = 1/4. Since x is not part of the equation, f(x-c) is a solution if and only if f(x) is a solution, so we get the solutions $y = 0$ and $y = (x-c)^2 / 4$ for x ≥ c.
This doesn't take into account the absolute value of y in the square root. So if $y ≤ 0$ then the differential equation is $y' = -\sqrt y$ and we have the solutions $y = 0$ and $y = -(x-d)^2 / 4$ for y ≤ d.
The solution is unique around any point where y ≠ 0. But if y = 0 then y can stay zero up to some point to the right when it becomes positive, and it can be zero for some point to the left when it becomes negative. So to find all solutions:
Pick some d ≤ c, including d = -inf and c = +inf. Then let y = 0 for d ≤ x ≤ c, let $y = -(x-d)^2 / 4$ for x ≤ d, and $ y=(x-c)^2/4$ for x ≥ c. This includes the solutions y = 0 (let d = -inf, c = +inf), or where y is zero for all small x or for all large x.
Now you have the starting condition y(0) = 0, this just implies that you need d ≤ 0 ≤ c.
A: Since you have the initial condition $y(0)=0$, we should now focus on solving the equation $y'=\sqrt{|y|}$ on $\mathbb{R}\setminus\{0\}$. For $y\lt0$, $|y|=-y$, and for $y\gt0$, $|y|=y$. Hence for $y\lt0$, $y=-(-y)=-\sqrt{-y}^2=-\sqrt{|y|}^2$, and for $y\gt0$, $y=|y|=\sqrt{|y|}^2$. Hence $$-2\sqrt{-y}\left[\sqrt{-y}\right]'=\left[-\sqrt{-y}^2\right]'=\sqrt{-y},\,y\lt0$$ $$2\sqrt{y}\left[\sqrt{y}\right]'=\left[\sqrt{y}^2\right]'=\sqrt{y},\,y\gt0,$$ leaving you with $$\left[\sqrt{-y}\right]'=-\frac12,\,y\lt0$$ $$\left[\sqrt{y}\right]'=\frac12,\,y\gt0$$ which implies $$\sqrt{-y(t)}=A-\frac12t,\,y\lt0$$ $$\sqrt{y(t)}=B+\frac12t,\,y\gt0.$$ If we want the equation to be satisfied on $\mathbb{R}$ rather than just $\mathbb{R}\setminus\{0\}$, then the condition $y(0)=0$ forces $A=B=0$. This causes somewhat of a problem. In fact, the two equations that were just derived imply this much: $A\geq\frac12t$ and $B\geq-\frac12t$, which for a choice of constants $A,B$, this constrains the domain of $y$ for any individual case rather significantly. However, what we have is that $\sqrt{-y(t)}=-\frac12t,\,y\leq0$ implies $t\leq0$, and $\sqrt{y(t)}=\frac12t,\,y\geq0$ implies $t\geq0$. In fact, we have that $y(t)=-\frac{t^2}{4},\,t\leq0$, $y(t)=\frac{t^2}{4},\,t\geq0$ is the nontrivial solution of the equation in $\mathbb{R}$. To put it succinctly, $$y(t)=\frac{t|t|}{4}.$$ It is easy now to verify, $$y'(t)=\frac{|t|}{2}=\sqrt{|y|}$$ for every $t\in\mathbb{R}$.
