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

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

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

Book solution method
Equation linear in the variables, \(y'(x)=f\left ( \frac {X_1}{X_2} \right ) \)

Mathematica
cpu = 0.00913103 (sec), leaf count = 43

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

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

\[ \left \{ {\frac {x}{3}}-{\frac {2\,y \left ( x \right ) }{3}}-{\frac { \left ( x+y \left ( x \right ) \right ) ^{2}}{6}}-{\it \_C1}=0 \right \} \] Mathematica raw input

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

Mathematica raw output

{{y[x] -> -2 - x - Sqrt[4 + 6*x + C[1]]}, {y[x] -> -2 - x + Sqrt[4 + 6*x + C[1]]
}}

Maple raw input

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

Maple raw output

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