I have this easy ODE: EDIT: $$y'(x)=2\sqrt{y(x)}, \\y(0)=1$$ (OLD: $y' = (x - 2)/2;$ $y(0) = 1$)
The general integral/solution is
$\sqrt{y} = x + c$, so $y= (x + c)^2$
Substituting the initial conditions I get $1 = c^2$
Now, the question is: should I use $c=+1$ or $c=-1$, or both? And why?
Thanks!
You have the IVP:
$$\begin{cases} y'(x)=\frac{x-2}{2} \\ y(0)=1 \end{cases} $$
Solving it via the method separation of variables we get
$$\begin{align} \int \text{d}y &=\int \frac{x-2}{2} \text{d}x \\ \Rightarrow y(x)&=\frac{x^2}{4}-x+c \end{align} $$
Now solving for the constant $c$ we get $$1=y(0)=c$$ and therefore $c=1$. The solution of the IVP is finally
$$y(x)=\frac{x^2}{4}-x+1.$$
You didn't compute the integral correctly. Generally there should be no quadratic constant $c$ since we just add a single $c$ as the integral constant. Therefore we can determine $c$ uniquely by the initial value if Picard-Lindelöf/Cauchy-Lipschitz is applicable to our IVP. There can't be two different solutions of such an IVP.