4.4.39 \(x y'(x)=f(x) \left (x^2-y(x)^2\right )+y(x)\)

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

[[_homogeneous, `class D`], _Riccati]

Book solution method
Riccati ODE, Generalized ODE

Mathematica
cpu = 0.309347 (sec), leaf count = 53

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

Maple
cpu = 0.04 (sec), leaf count = 13

\[[y \left (x \right ) = \tanh \left (\int f \left (x \right )d x +\textit {\_C1} \right ) x]\] Mathematica raw input

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

Mathematica raw output

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

Maple raw input

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

Maple raw output

[y(x) = tanh(Int(f(x),x)+_C1)*x]