29.2.25 problem 50

Internal problem ID [4658]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 2
Problem number : 50
Date solved : Tuesday, March 04, 2025 at 07:00:49 PM
CAS classification : [_Riccati]

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

Maple. Time used: 0.008 (sec). Leaf size: 69
ode:=diff(y(x),x) = f(x)+x*f(x)*y(x)+y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \frac {{\mathrm e}^{\int \frac {f \left (x \right ) x^{2}-2}{x}d x} x +\int {\mathrm e}^{\int \frac {f \left (x \right ) x^{2}-2}{x}d x}d x -c_{1}}{\left (c_{1} -\int {\mathrm e}^{\int \frac {f \left (x \right ) x^{2}-2}{x}d x}d x \right ) x} \]
Mathematica. Time used: 0.742 (sec). Leaf size: 111
ode=D[y[x],x]==f[x]+x f[x] y[x]+y[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\frac {\exp \left (-\int _1^x-f(K[1]) K[1]dK[1]\right )+x \int _1^x\frac {\exp \left (-\int _1^{K[2]}-f(K[1]) K[1]dK[1]\right )}{K[2]^2}dK[2]+c_1 x}{x^2 \left (\int _1^x\frac {\exp \left (-\int _1^{K[2]}-f(K[1]) K[1]dK[1]\right )}{K[2]^2}dK[2]+c_1\right )} \\ y(x)\to -\frac {1}{x} \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
f = Function("f") 
ode = Eq(-x*f(x)*y(x) - 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 lie group method