ODE
\[ y'(x)=(x-y(x))^2+3 (y(x)-x+1) \] ODE Classification
[[_homogeneous, `class C`], _Riccati]
Book solution method
Equation linear in the variables, \(y'(x)=f(a+b x+ c y(x))\)
Mathematica ✓
cpu = 0.0180019 (sec), leaf count = 18
\[\left \{\left \{y(x)\to \frac {1}{c_1 e^x+1}+x-2\right \}\right \}\]
Maple ✓
cpu = 0.028 (sec), leaf count = 26
\[ \left \{ \ln \left ( -x+y \left ( x \right ) +2 \right ) -\ln \left ( y \left ( x \right ) -x+1 \right ) +x-{\it \_C1}=0 \right \} \] Mathematica raw input
DSolve[y'[x] == (x - y[x])^2 + 3*(1 - x + y[x]),y[x],x]
Mathematica raw output
{{y[x] -> -2 + x + (1 + E^x*C[1])^(-1)}}
Maple raw input
dsolve(diff(y(x),x) = 3-3*x+3*y(x)+(x-y(x))^2, y(x),'implicit')
Maple raw output
ln(-x+y(x)+2)-ln(y(x)-x+1)+x-_C1 = 0