61.20.3 problem 36

Internal problem ID [12226]
Book : Handbook of exact solutions for ordinary differential equations. By Polyanin and Zaitsev. Second edition
Section : Chapter 1, section 1.2. Riccati Equation. subsection 1.2.8-2. Equations containing arbitrary functions and their derivatives.
Problem number : 36
Date solved : Monday, March 31, 2025 at 04:39:44 AM
CAS classification : [_Riccati]

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

Maple. Time used: 0.012 (sec). Leaf size: 105
ode:=diff(y(x),x) = -diff(f(x),x)*y(x)^2+f(x)*g(x)*y(x)-g(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {f \left (x \right ) {\mathrm e}^{-\int \frac {-f \left (x \right )^{2} g \left (x \right )+2 f^{\prime }\left (x \right )}{f \left (x \right )}d x}+\int f^{\prime }\left (x \right ) {\mathrm e}^{\int g \left (x \right ) f \left (x \right )d x -2 \int \frac {f^{\prime }\left (x \right )}{f \left (x \right )}d x}d x -c_1}{f \left (x \right ) \left (\int f^{\prime }\left (x \right ) {\mathrm e}^{\int g \left (x \right ) f \left (x \right )d x -2 \int \frac {f^{\prime }\left (x \right )}{f \left (x \right )}d x}d x -c_1 \right )} \]
Mathematica
ode=D[y[x],x]==-D[ f[x],x]*y[x]^2+f[x]*g[x]*y[x]-g[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 

Not solved

Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
f = Function("f") 
g = Function("g") 
ode = Eq(-f(x)*g(x)*y(x) + g(x) + y(x)**2*Derivative(f(x), x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -f(x)*g(x)*y(x) + g(x) + y(x)**2*Derivative(f(x), x) + Derivative(y(x), x) cannot be solved by the lie group method