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.313346 (sec), leaf count = 32
\[\left \{\left \{y(x)\to \frac {x^4+x^3+12 c_1 x+3 c_1}{x^3+3 c_1}\right \}\right \}\]
Maple ✓
cpu = 0.303 (sec), leaf count = 24
\[\left [y \left (x \right ) = 1+\frac {x \left (\textit {\_C1} \,x^{3}-4\right )}{\textit {\_C1} \,x^{3}-1}\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))
Maple raw output
[y(x) = 1+x*(_C1*x^3-4)/(_C1*x^3-1)]