Given the differential equation,
$y'=|x|$, $y(-1)=2$
I believe I understand how to solve the implicit solution but have questions about using the initial condition to solve the explicit solution. I have outlined my solution below in case there is a mistake I have overseen.
I rewrite the differential equation piecewise and solve each piece independently.
$y'=x$ for $x\ge0$
$y'=-x$ for $x<0$
This yields,
$y_1=\frac{1}{2}x^2+c_1$ for $x\ge0$
$y_2=-\frac{1}{2}x^2+c_2$ for $x<0$
I use the initial condition to solve for $c_2$ and get,
$y_2=-\frac{1}{2}x^2+\frac{5}{2}$ for $x<0$
Does this mean that the solution is only $y_2$? I am thinking that if possible we want to find $c_1$ such that the solution is continuous and differentiable for the largest possible interval of definition. If $c_1=c_2$ then the piecewise solution is continuous and differentiable for all reals and satisfies the initial condition.
Thank you in advance for your time and assistance.