61.19.17 problem 17

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

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

Maple. Time used: 0.018 (sec). Leaf size: 59
ode:=diff(y(x),x) = exp(lambda*x)*f(x)*y(x)^2+(a*f(x)-lambda)*y(x)+b*exp(-lambda*x)*f(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {{\mathrm e}^{-\lambda x} \left (a^{2}+\tanh \left (\frac {\sqrt {a^{2} \left (a^{2}-4 b \right )}\, \left (a \int f \left (x \right )d x +c_1 \right )}{2 a^{2}}\right ) \sqrt {a^{2} \left (a^{2}-4 b \right )}\right )}{2 a} \]
Mathematica. Time used: 0.669 (sec). Leaf size: 87
ode=D[y[x],x]==Exp[\[Lambda]*x]*f[x]*y[x]^2+(a*f[x]-\[Lambda])*y[x]+b*Exp[-\[Lambda]*x]*f[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\int _1^{\sqrt {\frac {e^{2 x \lambda }}{b}} y(x)}\frac {1}{K[1]^2-\sqrt {\frac {a^2}{b}} K[1]+1}dK[1]=\int _1^xb e^{-\lambda K[2]} \sqrt {\frac {e^{2 \lambda K[2]}}{b}} f(K[2])dK[2]+c_1,y(x)\right ] \]
Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
lambda_ = symbols("lambda_") 
y = Function("y") 
f = Function("f") 
ode = Eq(-b*f(x)*exp(-lambda_*x) - (a*f(x) - lambda_)*y(x) - f(x)*y(x)**2*exp(lambda_*x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -(b*f(x) + (a*f(x) - lambda_ + f(x)*y(x)*exp(lambda_*x))*y(x)*exp(lambda_*x))*exp(-lambda_*x) + Derivative(y(x), x) cannot be solved by the factorable group method