61.19.15 problem 15

Internal problem ID [12205]
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 : 15
Date solved : Monday, March 31, 2025 at 04:33:24 AM
CAS classification : [_Riccati]

\begin{align*} y^{\prime }&=f \left (x \right ) y^{2}+\lambda y+a^{2} {\mathrm e}^{2 \lambda x} f \left (x \right ) \end{align*}

Maple. Time used: 0.014 (sec). Leaf size: 26
ode:=diff(y(x),x) = f(x)*y(x)^2+lambda*y(x)+a^2*exp(2*lambda*x)*f(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\tan \left (-a \int f \left (x \right ) {\mathrm e}^{\lambda x}d x +c_1 \right ) a \,{\mathrm e}^{\lambda x} \]
Mathematica. Time used: 0.393 (sec). Leaf size: 47
ode=D[y[x],x]==f[x]*y[x]^2+\[Lambda]*y[x]+a^2*Exp[2*\[Lambda]*x]*f[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \sqrt {a^2} e^{\lambda x} \tan \left (\sqrt {a^2} \int _1^xe^{\lambda K[1]} f(K[1])dK[1]+c_1\right ) \]
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)*exp(2*lambda_*x) - lambda_*y(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)*exp(2*lambda_*x) - lambda_*y(x) - f(x)*y(x)**2 + Derivative(y(x), x) cannot be solved by the lie group method