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

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

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

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

Mathematica
cpu = 0.0672451 (sec), leaf count = 32

\[\left \{\left \{y(x)\to \frac {12 c_1 x+3 c_1+x^4+x^3}{3 c_1+x^3}\right \}\right \}\]

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

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

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

Mathematica raw output

{{y[x] -> (x^3 + x^4 + 3*C[1] + 12*x*C[1])/(x^3 + 3*C[1])}}

Maple raw input

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

Maple raw output

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