55.20.4 problem 37

Internal problem ID [13522]
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 : 37
Date solved : Wednesday, October 01, 2025 at 03:56:43 PM
CAS classification : [[_1st_order, `_with_symmetry_[F(x),G(x)]`], _Riccati]

\begin{align*} y^{\prime }&=g \left (x \right ) \left (y-f \left (x \right )\right )^{2}+f^{\prime }\left (x \right ) \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 17
ode:=diff(y(x),x) = g(x)*(y(x)-f(x))^2+diff(f(x),x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = f \left (x \right )+\frac {1}{c_1 -\int g \left (x \right )d x} \]
Mathematica. Time used: 0.138 (sec). Leaf size: 31
ode=D[y[x],x]==g[x]*(y[x]-f[x])^2+D[ f[x],x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to f(x)+\frac {1}{-\int _1^xg(K[2])dK[2]+c_1}\\ y(x)&\to f(x) \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
f = Function("f") 
g = Function("g") 
ode = Eq(-(-f(x) + y(x))**2*g(x) - Derivative(f(x), x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
IndexError : Index out of range: a[1]