55.19.31 problem 31

Internal problem ID [13516]
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-1. Equations containing arbitrary functions (but not containing their derivatives).
Problem number : 31
Date solved : Wednesday, October 01, 2025 at 03:51:16 PM
CAS classification : [_Riccati]

\begin{align*} y^{\prime }&=f \left (x \right ) y^{2}-a^{2} f \left (x \right )+a \lambda \cos \left (\lambda x \right )+a^{2} f \left (x \right ) \cos \left (\lambda x \right )^{2} \end{align*}
Maple
ode:=diff(y(x),x) = y(x)^2*f(x)-a^2*f(x)+a*lambda*cos(lambda*x)+a^2*f(x)*cos(lambda*x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ \text {No solution found} \]
Mathematica
ode=D[y[x],x]==f[x]*y[x]^2-a^2*f[x]+a*\[Lambda]*cos[\[Lambda]*x]+a^2*f[x]*Cos[\[Lambda]*x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 

Not solved

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