4.9.40 \((y(x)+x) y'(x)=x-y(x)\)

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

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

Book solution method
Homogeneous equation

Mathematica
cpu = 0.166177 (sec), leaf count = 51

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

Maple
cpu = 0.178 (sec), leaf count = 51

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

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

Mathematica raw output

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

Maple raw input

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

Maple raw output

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