Skip to main content

differential equations - Why does DSolve return two solutions for my ODE?


I wanted to solve the differential equation: $y’ = (1+2x)\sqrt{y}$ with $y(0) = 1$. It can be done by hand, and to check my answer I typed the following in Mathematica


DSolve[{y'[x] == (1 + 2 x)Sqrt[y[x]], y[0] == 1}, y[x] ,x]// FullSimplify

Surprisingly Mathematica gave me two solutions:



{{y[x] -> 1/4 (-2 + x + x^2)^2}, {y[x] -> 1/4 (2 + x + x^2)^2}}

The second solution is what I got by hand. However, I don’t see how Mathematica got the first solution.



If I use it, I get y’(0) = -1, but according to the differential equation $y’(0)= (1+2*0)\sqrt{y(0)} = 1$.


I can see that it is a solution of $y'(x)^2 = ((1+2x)\sqrt{y})^2$, but that ODE is not equivalent to $y’ = (1+2x)\sqrt{y}$.


And when I run the following Mathematica code:


s1[x_] = 1/4 (-2 + x + x^2)^2; 
s2[x_] = 1/4 (2 + x + x^2)^2;
check1[x_] = s1'[x] - (1 + 2 x) Sqrt[s1[x]];
check2[x_] = s2'[x] - (1 + 2 x) Sqrt[s2[x]];
Plot[{check1[x]}, {x, -3, 1.5}]
Plot[{check2[x]}, {x, -3, 1.5}]


I can see that check2[x] is identically zero, but not check1[x]. What am I missing here?




Comments