4.2.17 \(y'(x)=-\left ((1-x) y(x)^2\right )+(1-2 x) y(x)+x\)

ODE
\[ y'(x)=-\left ((1-x) y(x)^2\right )+(1-2 x) y(x)+x \] ODE Classification

[_Riccati]

Book solution method
Riccati ODE, Generalized ODE

Mathematica
cpu = 0.264645 (sec), leaf count = 25

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

Maple
cpu = 0.08 (sec), leaf count = 23

\[\left [y \left (x \right ) = 1-\frac {2 \,{\mathrm e}^{-x}}{\textit {\_C1} -2 x \,{\mathrm e}^{-x}}\right ]\] Mathematica raw input

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

Mathematica raw output

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

Maple raw input

dsolve(diff(y(x),x) = x+(1-2*x)*y(x)-(1-x)*y(x)^2, y(x))

Maple raw output

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