4.10.18 \((-2 y(x)+x+1) y'(x)=-y(x)+2 x+1\)

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

[[_homogeneous, `class C`], _exact, _rational, [_Abel, `2nd type`, `class A`]]

Book solution method
Exact equation

Mathematica
cpu = 0.171541 (sec), leaf count = 67

\[\left \{\left \{y(x)\to \frac {1}{2} \left (-i \sqrt {3 x^2+2 x-1-4 c_1}+x+1\right )\right \},\left \{y(x)\to \frac {1}{2} \left (i \sqrt {3 x^2+2 x-1-4 c_1}+x+1\right )\right \}\right \}\]

Maple
cpu = 0.184 (sec), leaf count = 38

\[\left [y \left (x \right ) = \frac {1}{3}-\frac {-\frac {\left (1+3 x \right ) \textit {\_C1}}{2}+\frac {\sqrt {-3 \left (1+3 x \right )^{2} \textit {\_C1}^{2}+4}}{2}}{3 \textit {\_C1}}\right ]\] Mathematica raw input

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

Mathematica raw output

{{y[x] -> (1 + x - I*Sqrt[-1 + 2*x + 3*x^2 - 4*C[1]])/2}, {y[x] -> (1 + x + I*Sq
rt[-1 + 2*x + 3*x^2 - 4*C[1]])/2}}

Maple raw input

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

Maple raw output

[y(x) = 1/3-1/3*(-1/2*(1+3*x)*_C1+1/2*(-3*(1+3*x)^2*_C1^2+4)^(1/2))/_C1]