61.20.8 problem 41

Internal problem ID [12231]
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 : Monday, March 31, 2025 at 04:40:02 AM
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) = f(x)*y(x)^2+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.998 (sec). Leaf size: 35
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 -i \sqrt {a} e^{g(x)} \\ y(x)\to -i \sqrt {a} e^{g(x)} \\ \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