The initial value problem: $dy/dx=x\sqrt{y},\;y(0)=1$ has the unique solution$$y=\frac 1{16}(x^4+8x^2+16)$$Mathematica's DSolve returns two solutions; the above and$$y=\frac 1{16}(x^4-8x^2+16)$$This second "solution" is erroneous.
1 Answer
eqns = {y'[x] == x Sqrt[y[x]], y[0] == 1};
sol = DSolve[eqns, y, x]
(* {{y -> Function[{x}, 1/16 (16 - 8 x^2 + x^4)]}, {y ->
Function[{x}, 1/16 (16 + 8 x^2 + x^4)]}} *)
The second solution is valid for all real x
eqns /. sol // FullSimplify[#, Element[x, Reals]] &
(* {{x^3 == x (4 + Abs[-4 + x^2]), True}, {True, True}} *)
Reduce[x^3 == x (4 + Abs[-4 + x^2]), x, Reals]
(* x <= -2 || x == 0 || x >= 2 *)
The first solutions is valid on the domain x <= -2 || x == 0 || x >= 2
eqns /. sol // FullSimplify[#, x <= -2 || x == 0 || x >= 2] &
(* {{True, True}, {True, True}} *)
DSolve[{y'[x] == x Sqrt[y[x]], y[0] == 1}, y, x]
. I believe this is a known long-standing bug inDSolve[]
(but I'll let someone else add the bugs tag). Here is a more striking example. $\endgroup$