55.3.4 problem 4

Internal problem ID [13308]
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.3. Equations Containing Exponential Functions
Problem number : 4
Date solved : Wednesday, October 01, 2025 at 06:41:58 AM
CAS classification : [_Riccati]

\begin{align*} y^{\prime }&=\sigma y^{2}+a y+b \,{\mathrm e}^{x}+c \end{align*}
Maple. Time used: 0.016 (sec). Leaf size: 200
ode:=diff(y(x),x) = sigma*y(x)^2+a*y(x)+b*exp(x)+c; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {-2 \,{\mathrm e}^{\frac {x}{2}} \operatorname {BesselJ}\left (\sqrt {a^{2}-4 \sigma c}+1, 2 \sqrt {\sigma }\, \sqrt {b}\, {\mathrm e}^{\frac {x}{2}}\right ) \sqrt {b}\, \sigma -2 \,{\mathrm e}^{\frac {x}{2}} \operatorname {BesselY}\left (\sqrt {a^{2}-4 \sigma c}+1, 2 \sqrt {\sigma }\, \sqrt {b}\, {\mathrm e}^{\frac {x}{2}}\right ) \sqrt {b}\, c_1 \sigma +\sqrt {\sigma }\, \left (\operatorname {BesselY}\left (\sqrt {a^{2}-4 \sigma c}, 2 \sqrt {\sigma }\, \sqrt {b}\, {\mathrm e}^{\frac {x}{2}}\right ) c_1 +\operatorname {BesselJ}\left (\sqrt {a^{2}-4 \sigma c}, 2 \sqrt {\sigma }\, \sqrt {b}\, {\mathrm e}^{\frac {x}{2}}\right )\right ) \left (\sqrt {a^{2}-4 \sigma c}+a \right )}{\sigma ^{{3}/{2}} \left (2 \operatorname {BesselY}\left (\sqrt {a^{2}-4 \sigma c}, 2 \sqrt {\sigma }\, \sqrt {b}\, {\mathrm e}^{\frac {x}{2}}\right ) c_1 +2 \operatorname {BesselJ}\left (\sqrt {a^{2}-4 \sigma c}, 2 \sqrt {\sigma }\, \sqrt {b}\, {\mathrm e}^{\frac {x}{2}}\right )\right )} \]
Mathematica. Time used: 0.337 (sec). Leaf size: 546
ode=D[y[x],x]==sigma*y[x]^2+a*y[x]+b*Exp[x]+c; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {a \sqrt {b \sigma e^x} \operatorname {Gamma}\left (\sqrt {a^2-4 c \sigma }+1\right ) \operatorname {BesselJ}\left (\sqrt {a^2-4 c \sigma },2 \sqrt {b e^x \sigma }\right )+b \sigma e^x \operatorname {Gamma}\left (\sqrt {a^2-4 c \sigma }+1\right ) \operatorname {BesselJ}\left (\sqrt {a^2-4 c \sigma }-1,2 \sqrt {b e^x \sigma }\right )-b \sigma e^x \operatorname {Gamma}\left (\sqrt {a^2-4 c \sigma }+1\right ) \operatorname {BesselJ}\left (\sqrt {a^2-4 c \sigma }+1,2 \sqrt {b e^x \sigma }\right )+a c_1 \sqrt {b \sigma e^x} \operatorname {Gamma}\left (1-\sqrt {a^2-4 c \sigma }\right ) \operatorname {BesselJ}\left (-\sqrt {a^2-4 c \sigma },2 \sqrt {b e^x \sigma }\right )+b c_1 \sigma e^x \operatorname {Gamma}\left (1-\sqrt {a^2-4 c \sigma }\right ) \operatorname {BesselJ}\left (-\sqrt {a^2-4 c \sigma }-1,2 \sqrt {b e^x \sigma }\right )-b c_1 \sigma e^x \operatorname {Gamma}\left (1-\sqrt {a^2-4 c \sigma }\right ) \operatorname {BesselJ}\left (1-\sqrt {a^2-4 c \sigma },2 \sqrt {b e^x \sigma }\right )}{2 \sigma \sqrt {b \sigma e^x} \left (\operatorname {Gamma}\left (\sqrt {a^2-4 c \sigma }+1\right ) \operatorname {BesselJ}\left (\sqrt {a^2-4 c \sigma },2 \sqrt {b e^x \sigma }\right )+c_1 \operatorname {Gamma}\left (1-\sqrt {a^2-4 c \sigma }\right ) \operatorname {BesselJ}\left (-\sqrt {a^2-4 c \sigma },2 \sqrt {b e^x \sigma }\right )\right )}\\ y(x)&\to \frac {\frac {\sqrt {b \sigma e^x} \left (\operatorname {BesselJ}\left (1-\sqrt {a^2-4 c \sigma },2 \sqrt {b e^x \sigma }\right )-\operatorname {BesselJ}\left (-\sqrt {a^2-4 c \sigma }-1,2 \sqrt {b e^x \sigma }\right )\right )}{\operatorname {BesselJ}\left (-\sqrt {a^2-4 c \sigma },2 \sqrt {b e^x \sigma }\right )}-a}{2 \sigma } \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
c = symbols("c") 
sigma = symbols("sigma") 
y = Function("y") 
ode = Eq(-a*y(x) - b*exp(x) - c - sigma*y(x)**2 + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -a*y(x) - b*exp(x) - c - sigma*y(x)**2 + Derivative(y(x), x) cannot be solved by the lie group method