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 = 0.378779 (sec), leaf count = 102

\[\left \{\left \{y(x)\to -\frac {\exp \left (-\int _1^x-f(K[5]) K[5]dK[5]\right )+x \int _1^x\frac {\exp \left (-\int _1^{K[6]}-f(K[5]) K[5]dK[5]\right )}{K[6]^2}dK[6]+c_1 x}{x^2 \left (\int _1^x\frac {\exp \left (-\int _1^{K[6]}-f(K[5]) K[5]dK[5]\right )}{K[6]^2}dK[6]+c_1\right )}\right \}\right \}\]

Maple
cpu = 0.106 (sec), leaf count = 49

\[\left [y \left (x \right ) = \frac {{\mathrm e}^{\int \frac {f \left (x \right ) x^{2}-2}{x}d x}}{\textit {\_C1} -\left (\int {\mathrm e}^{\int \frac {f \left (x \right ) x^{2}-2}{x}d x}d x \right )}-\frac {1}{x}\right ]\] Mathematica raw input

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

Mathematica raw output

{{y[x] -> -((E^(-Inactive[Integrate][-(f[K[5]]*K[5]), {K[5], 1, x}]) + x*C[1] + 
x*Inactive[Integrate][1/(E^Inactive[Integrate][-(f[K[5]]*K[5]), {K[5], 1, K[6]}]
*K[6]^2), {K[6], 1, x}])/(x^2*(C[1] + Inactive[Integrate][1/(E^Inactive[Integrat
e][-(f[K[5]]*K[5]), {K[5], 1, K[6]}]*K[6]^2), {K[6], 1, x}])))}}

Maple raw input

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

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]