4.1.45 \(y'(x)=(x-y(x))^2+3 (y(x)-x+1)\)

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.256476 (sec), leaf count = 18

\[\left \{\left \{y(x)\to x+\frac {1}{1+c_1 e^x}-2\right \}\right \}\]

Maple
cpu = 0.139 (sec), leaf count = 34

\[\left [y \left (x \right ) = \frac {x \,{\mathrm e}^{-x} \textit {\_C1} -{\mathrm e}^{-x} \textit {\_C1} -x +2}{{\mathrm e}^{-x} \textit {\_C1} -1}\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))

Maple raw output

[y(x) = (x/exp(x)*_C1-1/exp(x)*_C1-x+2)/(1/exp(x)*_C1-1)]