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

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

Maple
cpu = 0.02 (sec), leaf count = 50

\[ \left \{ -{\frac {1}{2}\ln \left ( {\frac {9\, \left ( y \left ( x \right ) \right ) ^{2}+ \left ( -9\,x-9 \right ) y \left ( x \right ) +9\,{x}^{2}+9\,x+3}{ \left ( 1+3\,x \right ) ^{2}}} \right ) }-\ln \left ( 1+3\,x \right ) -{\it \_C1}=0 \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),'implicit')

Maple raw output

-1/2*ln((9*y(x)^2+(-9*x-9)*y(x)+9*x^2+9*x+3)/(1+3*x)^2)-ln(1+3*x)-_C1 = 0