4.10.17 \((x-2 y(x)) y'(x)+y(x)+2 x=0\)

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

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

Book solution method
Exact equation

Mathematica
cpu = 0.023377 (sec), leaf count = 55

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

Maple
cpu = 0.011 (sec), leaf count = 33

\[ \left \{ -{\frac {1}{2}\ln \left ( {\frac {-{x}^{2}-xy \left ( x \right ) + \left ( y \left ( x \right ) \right ) ^{2}}{{x}^{2}}} \right ) }-\ln \left ( x \right ) -{\it \_C1}=0 \right \} \] Mathematica raw input

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

Mathematica raw output

{{y[x] -> (x - Sqrt[-4*E^C[1] + 5*x^2])/2}, {y[x] -> (x + Sqrt[-4*E^C[1] + 5*x^2
])/2}}

Maple raw input

dsolve((x-2*y(x))*diff(y(x),x)+2*x+y(x) = 0, y(x),'implicit')

Maple raw output

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