60.1.16 problem 16

Internal problem ID [10030]
Book : Differential Gleichungen, E. Kamke, 3rd ed. Chelsea Pub. NY, 1948
Section : Chapter 1, linear first order
Problem number : 16
Date solved : Wednesday, March 05, 2025 at 08:04:49 AM
CAS classification : [_Riccati]

\begin{align*} y^{\prime }+y^{2}+\left (x y-1\right ) f \left (x \right )&=0 \end{align*}

Maple. Time used: 0.007 (sec). Leaf size: 75
ode:=diff(y(x),x)+y(x)^2+(x*y(x)-1)*f(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {{\mathrm e}^{-\int \frac {f x^{2}+2}{x}d x} x +\int {\mathrm e}^{-\int \frac {f x^{2}+2}{x}d x}d x -c_{1}}{\left (-c_{1} +\int {\mathrm e}^{-\int \frac {f x^{2}+2}{x}d x}d x \right ) x} \]
Mathematica. Time used: 0.125 (sec). Leaf size: 114
ode=D[y[x],x] + y[x]^2 +(x*y[x]-1)*f[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {x \exp \left (-\int _1^x\left (f(K[1]) K[1]+\frac {2}{K[1]}\right )dK[1]\right )+\int _1^x\exp \left (-\int _1^{K[2]}\left (f(K[1]) K[1]+\frac {2}{K[1]}\right )dK[1]\right )dK[2]+c_1}{x \left (\int _1^x\exp \left (-\int _1^{K[2]}\left (f(K[1]) K[1]+\frac {2}{K[1]}\right )dK[1]\right )dK[2]+c_1\right )} \\ y(x)\to \frac {1}{x} \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x*y(x) - 1)*f(x) + y(x)**2 + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE x*f(x)*y(x) - f(x) + y(x)**2 + Derivative(y(x), x) cannot be solved by the factorable group method