4.13.20 \((x-y(x))^2 y'(x)=(-y(x)+x+1)^2\)

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

[[_homogeneous, `class C`], _rational, _dAlembert]

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

Mathematica
cpu = 0.785482 (sec), leaf count = 45

\[\text {Solve}\left [16 c_1+4 x^2+4 y(x)^2+4 y(x)+2 \log (-2 y(x)+2 x+1)+12 x+5=8 x y(x),y(x)\right ]\]

Maple
cpu = 0.026 (sec), leaf count = 42

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

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

Mathematica raw output

Solve[5 + 12*x + 4*x^2 + 16*C[1] + 2*Log[1 + 2*x - 2*y[x]] + 4*y[x] + 4*y[x]^2 =
= 8*x*y[x], y[x]]

Maple raw input

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

Maple raw output

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