61.4.18 problem 39

Internal problem ID [12044]
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 : 39
Date solved : Wednesday, March 05, 2025 at 03:55:16 PM
CAS classification : [_Riccati]

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

Maple. Time used: 0.033 (sec). Leaf size: 90
ode:=diff(y(x),x) = a*x^n*y(x)^2+lambda*x*y(x)+a*b^2*x^n*exp(lambda*x^2); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\tan \left (-a b 2^{\frac {n}{2}-\frac {1}{2}} x^{n +1} \Gamma \left (\frac {n}{2}+\frac {1}{2}\right ) \left (-\lambda \,x^{2}\right )^{-\frac {n}{2}-\frac {1}{2}}+a b 2^{\frac {n}{2}-\frac {1}{2}} x^{n +1} \left (-\lambda \,x^{2}\right )^{-\frac {n}{2}-\frac {1}{2}} \Gamma \left (\frac {n}{2}+\frac {1}{2}, -\frac {\lambda \,x^{2}}{2}\right )+c_{1} \right ) b \,{\mathrm e}^{\frac {\lambda \,x^{2}}{2}} \]
Mathematica. Time used: 1.468 (sec). Leaf size: 83
ode=D[y[x],x]==a*x^n*y[x]^2+\[Lambda]*x*y[x]+a*b^2*x^n*Exp[\[Lambda]*x^2]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \sqrt {b^2} e^{\frac {\lambda x^2}{2}} \tan \left (a \sqrt {b^2} \lambda 2^{\frac {n-1}{2}} x^{n+3} \left (\lambda \left (-x^2\right )\right )^{-\frac {n}{2}-\frac {3}{2}} \Gamma \left (\frac {n+1}{2},-\frac {x^2 \lambda }{2}\right )+c_1\right ) \]
Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
cg = symbols("cg") 
n = symbols("n") 
y = Function("y") 
ode = Eq(-a*b**2*x**n*exp(cg*x**2) - a*x**n*y(x)**2 - cg*x*y(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -a*b**2*x**n*exp(cg*x**2) - a*x**n*y(x)**2 - cg*x*y(x) + Derivative(y(x), x) cannot be solved by the lie group method