4.2.1 \(y'(x)=x f(x) y(x)+f(x)+y(x)^2\)

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

[_Riccati]

Book solution method
Riccati ODE, Generalized ODE

Mathematica
cpu = 20.7448 (sec), leaf count = 0 , could not solve

DSolve[Derivative[1][y][x] == f[x] + x*f[x]*y[x] + y[x]^2, y[x], x]

Maple
cpu = 0.131 (sec), leaf count = 48

\[ \left \{ y \left ( x \right ) +{1{{\rm e}^{\int \!{\frac {f \left ( x \right ) {x}^{2}-2}{x}}\,{\rm d}x}} \left ( -{\it \_C1}+\int \!{{\rm e}^{\int \!{\frac {f \left ( x \right ) {x}^{2}-2}{x}}\,{\rm d}x}}\,{\rm d}x \right ) ^{-1}}+{x}^{-1}=0 \right \} \] Mathematica raw input

DSolve[y'[x] == f[x] + x*f[x]*y[x] + y[x]^2,y[x],x]

Mathematica raw output

DSolve[Derivative[1][y][x] == f[x] + x*f[x]*y[x] + y[x]^2, y[x], x]

Maple raw input

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

Maple raw output

y(x)+exp(Int(1/x*(f(x)*x^2-2),x))/(-_C1+Int(exp(Int(1/x*(f(x)*x^2-2),x)),x))+1/x
 = 0