Differential equation $y'(x)=\frac{-\sqrt{y(x)}}{1+x}$ with two branches, are these both valid? I have the following differential equation:
$$\frac{dy}{dx} = \frac{-\sqrt{y}}{1+x} $$
by simple integration we end up with:
$$y(x) = (C-\frac{\ln{1+x}}{2})^2 $$
where C is a constant.
Now we do also have the condition $y(0) = 1$, which leads to $C=\pm 1$. My question is: are both branches (constants) valid? $C_1 = 1$ does obviously lead to a valid solution, but how about $C_2=-1$? 
$C=-1$ gives $$y_2(x) = (-1-\frac{\ln{1+x}}{2})^2 $$ which when substituted back in the differenial equation gives the correct result. However, we also have: $$y_2(x) = (-1)^2(1+\frac{\ln{1+x}}{2})^2 = (1+\frac{\ln{1+x}}{2})^2$$ which when substituted back doesn't give the right result, as the minus sign is missing. What solves this apparent contradiction?
 A: In fact, when you try to verify if $y_2$ is a solution, on an interval contained in $]-1,+\infty[$, and containing $0$, you get that
$$1+\frac{\log(1+x)}{2}=-|1+\frac{\log(1+x)}{2}|$$
this imply that $1+\frac{\log(1+x)}{2}\leq 0$, ie $x\leq -1+e^{-2}$. But $0\not\in ]-1,-1+e^{-2}]$. So your second "solution" is not a real solution. 
A: Solving a problem in the $\ {\rm givens}\Rightarrow\ldots\Rightarrow\ldots\Rightarrow{\rm solution}\ $ fashion produces a set of solution candidates, meaning that every solution of the original problem has to be one of these. One then has to check which of these candidates are indeed solutions of the original problem. There is no contradiction here.
The recipe for the solution of IVPs by means of separation of variables produces only the correct solution: Given your data you have to solve
$$\int_1^y{1\over-\sqrt{\bar y}}\>d\bar y=\int_0^x{1\over 1+\bar x}\>d\bar x$$
for $y$ as a function of $x$. Computing the integrals gives
$$-2\sqrt{\bar y}\biggr|_1^y=\log(1+\bar x)\biggr|_0^x\ ,$$
hence
$$\sqrt{y}=1-{1\over2}\log(1+x)\ ,$$
valid in some neighborhood of $x=0$. Solving for $y$ we then obtain
$$y(x)=\left(1-{1\over2}\log(1+x)\right)^2\ .$$
