55.20.8 problem 41

Internal problem ID [13526]
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 : 41
Date solved : Wednesday, October 01, 2025 at 03:57:35 PM
CAS classification : [_Riccati]

\begin{align*} y^{\prime }&=f \left (x \right ) y^{2}+g^{\prime }\left (x \right ) y+a f \left (x \right ) {\mathrm e}^{2 g \left (x \right )} \end{align*}
Maple. Time used: 0.016 (sec). Leaf size: 28
ode:=diff(y(x),x) = y(x)^2*f(x)+diff(g(x),x)*y(x)+a*f(x)*exp(2*g(x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\tan \left (-\sqrt {a}\, \int f \left (x \right ) {\mathrm e}^{g \left (x \right )}d x +c_1 \right ) \sqrt {a}\, {\mathrm e}^{g \left (x \right )} \]
Mathematica. Time used: 0.259 (sec). Leaf size: 41
ode=D[y[x],x]==f[x]*y[x]^2+D[ g[x],x]*y[x]+a*f[x]*Exp[2*g[x]]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \sqrt {a} e^{g(x)} \tan \left (\sqrt {a} \int _1^xe^{g(K[1])} f(K[1])dK[1]+c_1\right ) \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
y = Function("y") 
f = Function("f") 
g = Function("g") 
ode = Eq(-a*f(x)*exp(2*g(x)) - f(x)*y(x)**2 - y(x)*Derivative(g(x), x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -a*f(x)*exp(2*g(x)) - f(x)*y(x)**2 - y(x)*Derivative(g(x), x) + Derivative(y(x), x) cannot be solved by the lie group method