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

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

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

\[\left [\frac {3 x}{4}+\frac {y \left (x \right )}{4}+\frac {y \left (x \right )^{2}}{4}-\frac {x y \left (x \right )}{2}+\frac {x^{2}}{4}+\frac {\ln \left (-2 x +2 y \left (x \right )-1\right )}{8}-\textit {\_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))

Maple raw output

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