4.1.42 \(y'(x)-x+1=y(x) (y(x)+x)\)

ODE
\[ y'(x)-x+1=y(x) (y(x)+x) \] ODE Classification

[_Riccati]

Book solution method
Riccati ODE, Generalized ODE

Mathematica
cpu = 0.0236493 (sec), leaf count = 49

\[\left \{\left \{y(x)\to \frac {2 e^{\frac {1}{2} (x-2)^2}}{2 e^2 c_1-\sqrt {2 \pi } \text {erfi}\left (\frac {x-2}{\sqrt {2}}\right )}-1\right \}\right \}\]

Maple
cpu = 0.092 (sec), leaf count = 39

\[ \left \{ y \left ( x \right ) =-1+{\frac {1}{{\it \_C1}+{\frac {i}{2}}\sqrt {\pi }{{\rm e}^{-2}}\sqrt {2}{\it Erf} \left ( {\frac {i}{2}}\sqrt {2} \left ( x-2 \right ) \right ) }{{\rm e}^{{\frac {x \left ( x-4 \right ) }{2}}}}} \right \} \] Mathematica raw input

DSolve[1 - x + y'[x] == y[x]*(x + y[x]),y[x],x]

Mathematica raw output

{{y[x] -> -1 + (2*E^((-2 + x)^2/2))/(2*E^2*C[1] - Sqrt[2*Pi]*Erfi[(-2 + x)/Sqrt[
2]])}}

Maple raw input

dsolve(diff(y(x),x)+1-x = (x+y(x))*y(x), y(x),'implicit')

Maple raw output

y(x) = -1+exp(1/2*x*(x-4))/(_C1+1/2*I*Pi^(1/2)*exp(-2)*2^(1/2)*erf(1/2*I*2^(1/2)
*(x-2)))