Ordinary DE with different initial values Consider the DE $$y'=2\sqrt{|y-1|}$$ To which of the following conditions do we have solutions?


*

*$y(0)=0$ and $y(1)=2$

*$y(0)=0$ and $y(2)=2$

*$y(0)=0$ and $y(3)=2$
Now, everywhere but on $y=1$ the function $f(y)=2\sqrt{|y-1|}$ is continuous and differentiable, so the solution to any IVP outside of $y=1$ must be unique. However, all of the listed conditions do cross the $1$ and I'm not sure what this means now. By separation of variables I found a general solution $$y(x)=\begin{cases}1-(x+\frac{C}{2})^2,& y\leq 1\\(x+\frac{D}{2})^2+1, & y\geq 1\end{cases}$$with constants $C,D$. This confuses me for two reasons:


*

*The function $y(x)$ consists of two cases for different $y$ (instead of $x$ as it usually is).

*Can't I now just plugin the initial values? For the first condition that would mean $C=\pm 2$ and $D=0$. For the second one $C=\pm 2,D=-2$ and for the last one $C=\pm 2, D=-4$.
This doesn't seem right. My initial guess was that only one of those is solvable. But does it even matter where the solution $y$ takes the value $2$ in terms of solving the DE? I'm a little lost here.
 A: $y'=2\sqrt{|y-1|}\implies y'(x)=\begin{cases}2\sqrt{1-y},& y<1\\2\sqrt{y-1}, & y>1\end{cases} \\\implies \frac{dy}{\sqrt{|y-1|}}=2\ dx\\\implies 2\ dx=\begin{cases}\frac{dy}{\sqrt{1-y}},& y<1\\\frac{dy}{\sqrt{y-1}},& y>1\end{cases}$
Integrate both sides to obtain,
$x+c=\begin{cases}\sqrt{y-1},& y\geq1\\-\sqrt{1-y},& y<1\end{cases}$
$y(0)=0\implies 0+c=-\sqrt{1-0}=-1$
Now you can check the second set of initial conditions in the function:
$x-1=\begin{cases}\sqrt{y-1},& y\geq1\\-\sqrt{1-y},& y<1\end{cases}$
It is easy to see that the solution exists only in the second case. I will now try to address your queries:


*

*The function $y(x)$ has different definitions for different values of $y$. Why not? You may generally not come across such cases, therefore the novelty of such questions might be confusing. But one way to interpret this is to treat $x$ as a function of $y$, or $y$ as the independent variable. Then $\frac{dy}{dx}=(\frac{dx}{dy})^{-1}$ or $\frac{dx}{dy}=\frac{1}{2\sqrt{|y-1|}}, y\neq1,$ so that now the solution admits different definitions for different values of the independent variable.

*You got the answer $y(x)=\begin{cases}1-(x+\frac{C}{2})^2,& y\leq 1\\(x+\frac{D}{2})^2+1, & y\geq 1\end{cases}$ by squaring both sides of my solution. In general, it is recommended to avoid squaring both sides as the squared expression admits extraneous solutions. Since $1-(x+\frac{C}{2})^2\leq 1$ and $(x+\frac{D}{2})^2+1\geq 1$ always, the conditions $y\geq1, y\leq1$ are redundant. Is $y$ any longer a function? Or does it now represent $2$ functions of $x$? See for yourself:
$$y(x)=\begin{cases}1-(x-1)^2\\(x-1)^2+1\end{cases}$$
$$x=1+\begin{cases}\sqrt{y-1},& y\geq1\\-\sqrt{1-y},& y<1\end{cases}$$
This happens because, say, when $y<1$,
$y(x)=1-(x+\frac{C}{2})^2\\\implies x+\frac{C}{2}=x-1=\pm\sqrt{1-y}\\\implies x=1\pm\sqrt{1-y}$
where $x=1+\sqrt{1-y}$ is the extraneous solution not satisfying the ODE.
A: Let the general first order ODE initial value problem, be :
$$y' = F(x,y), \quad y(x_0) = y_0$$
Then, the existence of a solution to it, is elaborated by the following theorem :

Theorem : If $F(x,y)$ is a continuous function defined in the region 
  $$D = \{(x,y) : x_0-\delta<x<x_0+\delta, \quad y_0-\varepsilon < y_0 < y_0+\varepsilon\}$$
  containing the point $(x_0,y_0)$ then there exists a number $\delta_1$ (possibly smaller than $\delta$) so that the solution $y=f(x)$ to the initial value problem stated is defined for $x_0 - \delta_1 < x_0 < x_0 + \delta_1$.

Now, for the first case,  your ODE IVP is :
$$y'=2\sqrt{y-1}, \quad y(0)=0, \quad y(1)=2$$
Then, the region $D$ would be derived from two regions (that must exist so the ODE has a solution for each initial value and thus both together) :
$$D_1 = \{(x,y) : -\delta<x<\delta, \quad -\varepsilon < y_0 < \varepsilon$$
$$D_2 = \{(x,y) : 1-\delta' < x<1+\delta', \quad 2-\varepsilon < y<2+\varepsilon\}$$
Now, if it's possible to define $F(x,y)$ in $D_1 \cap D_2$ then your initial value problem would have a solution.
You can carry on to make conclusions and derive similar results for the rest.
For a slope field generator for the ODE $y' = 2\sqrt{|y-1|}$, one can see a lot of stuff :
$\qquad \qquad \qquad \quad$
Below is a samplings plot for the given ivp for different initial values of $y(0)$ :
$\qquad \qquad \qquad \qquad$
Important note : Check your solution elaboration, because it's mistaken. There is no closed form solution to the given problem and that's why it's important to make conclusions about ODE IVPs without having to explicitly solve them.
