61.4.1 problem 22

Internal problem ID [12027]
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-2. Equations with power and exponential functions
Problem number : 22
Date solved : Sunday, March 30, 2025 at 10:19:19 PM
CAS classification : [_Riccati]

\begin{align*} y^{\prime }&=y^{2}+a x \,{\mathrm e}^{\lambda x} y+a \,{\mathrm e}^{\lambda x} \end{align*}

Maple. Time used: 0.009 (sec). Leaf size: 85
ode:=diff(y(x),x) = y(x)^2+a*x*exp(lambda*x)*y(x)+exp(lambda*x)*a; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {-c_1 \,\lambda ^{2} x +\int \frac {{\mathrm e}^{\frac {a \,{\mathrm e}^{\lambda x} \left (\lambda x -1\right )}{\lambda ^{2}}}}{x^{2}}d x x +{\mathrm e}^{\frac {a \,{\mathrm e}^{\lambda x} \left (\lambda x -1\right )}{\lambda ^{2}}}}{\left (c_1 \,\lambda ^{2}-\int \frac {{\mathrm e}^{\frac {a \,{\mathrm e}^{\lambda x} \left (\lambda x -1\right )}{\lambda ^{2}}}}{x^{2}}d x \right ) x^{2}} \]
Mathematica. Time used: 1.034 (sec). Leaf size: 123
ode=D[y[x],x]==y[x]^2+a*x*Exp[\[Lambda]*x]*y[x]+a*Exp[\[Lambda]*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\frac {\exp \left (-\int _1^x-a e^{\lambda K[1]} K[1]dK[1]\right )+x \int _1^x\frac {\exp \left (-\int _1^{K[2]}-a e^{\lambda K[1]} K[1]dK[1]\right )}{K[2]^2}dK[2]+c_1 x}{x^2 \left (\int _1^x\frac {\exp \left (-\int _1^{K[2]}-a e^{\lambda K[1]} K[1]dK[1]\right )}{K[2]^2}dK[2]+c_1\right )} \\ y(x)\to -\frac {1}{x} \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
lambda_ = symbols("lambda_") 
y = Function("y") 
ode = Eq(-a*x*y(x)*exp(lambda_*x) - a*exp(lambda_*x) - y(x)**2 + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -a*x*y(x)*exp(lambda_*x) - a*exp(lambda_*x) - y(x)**2 + Derivative(y(x), x) cannot be solved by the lie group method