# 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.

• What are $\alpha$ and $\beta$? Do you have boundary conditions for this problem?
Jun 9, 2015 at 21:21
• @Vlad I've edited the question
– user55268
Jun 9, 2015 at 21:26
• @AlbertT. What Vlad asked you is the role of $\alpha$ and $\beta$ in your problem. The fact that $\alpha < \beta$ is just an hypotesis you had, not the "meaning" of $\alpha$ and $\beta$. Jun 9, 2015 at 21:28
• @the_candyman For every two $\alpha,\beta \in \mathbb R$, such that $\alpha < \beta$, $y$ defined as above satisfies the equation, so there are infinite solutions
– user55268
Jun 9, 2015 at 21:29

$\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:

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

2. 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}$.

3. 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}$.

4. 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.

• Incidentally, every solution $y$ is non-decreasing (obvious from the ODE, or can be read off the integrated equations in 2 and 3). The quadratics as given come with implicit "fine print": The solutions are the "right half" ($t > t_{0} - 2\sqrt{y_{0}\Strut}$) of the quadratic in 2, or the "left half" ($t < t_{0} - 2\sqrt{-y_{0}\Strut}$) in 3. Particularly, the function $y_{\alpha,\beta}$ in the question appears not to be a solution; you'd need a minus sign in the portion where $t < \alpha$. Jun 10, 2015 at 1:53

$$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.

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_+$$

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}$$.

• Why the downvote? Jan 14 at 17:24