61.4.8 problem 29

Internal problem ID [12034]
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 : 29
Date solved : Wednesday, March 05, 2025 at 03:54:21 PM
CAS classification : [_Riccati]

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

Maple. Time used: 0.031 (sec). Leaf size: 61
ode:=diff(y(x),x) = a*x^n*y(x)^2+lambda*y(x)-a*b^2*x^n*exp(2*lambda*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \tanh \left (\frac {-x^{n} a b \left (\Gamma \left (n , -\lambda x \right ) n -\Gamma \left (n +1\right )\right ) \left (-\lambda x \right )^{-n}-b a \,x^{n} {\mathrm e}^{\lambda x}+i \lambda c_{1}}{\lambda }\right ) b \,{\mathrm e}^{\lambda x} \]
Mathematica. Time used: 0.998 (sec). Leaf size: 57
ode=D[y[x],x]==a*x^n*y[x]^2+\[Lambda]*y[x]-a*b^2*x^n*Exp[2*\[Lambda]*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \sqrt {-b^2} e^{\lambda x} \tan \left (\frac {a \sqrt {-b^2} x^n (\lambda (-x))^{-n} \Gamma (n+1,-x \lambda )}{\lambda }+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(2*cg*x) - a*x**n*y(x)**2 - cg*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(2*cg*x) - a*x**n*y(x)**2 - cg*y(x) + Derivative(y(x), x) cannot be solved by the lie group method