55.2.39 problem 39

Internal problem ID [13265]
Book : Handbook of exact solutions for ordinary differential equations. By Polyanin and Zaitsev. Second edition
Section : Chapter 1, section 1.2. Riccati Equation. 1.2.2. Equations Containing Power Functions
Problem number : 39
Date solved : Wednesday, October 01, 2025 at 04:54:30 AM
CAS classification : [[_homogeneous, `class G`], _rational, _Riccati]

\begin{align*} x y^{\prime }&=a \,x^{n} y^{2}+b y+c \,x^{-n} \end{align*}
Maple. Time used: 0.006 (sec). Leaf size: 73
ode:=x*diff(y(x),x) = a*x^n*y(x)^2+b*y(x)+c*x^(-n); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {x^{-n} \left (\tan \left (\frac {\sqrt {4 c a -b^{2}-2 b n -n^{2}}\, \left (\ln \left (x \right )-c_1 \right )}{2}\right ) \sqrt {4 c a -b^{2}-2 b n -n^{2}}-b -n \right )}{2 a} \]
Mathematica. Time used: 0.344 (sec). Leaf size: 138
ode=x*D[y[x],x]==a*x^n*y[x]^2+b*y[x]+c*x^(-n); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {x^{-n} \left (\frac {\sqrt {-4 a c+b^2+2 b n+n^2} \left (-x^{\sqrt {-4 a c+b^2+2 b n+n^2}}+c_1\right )}{x^{\sqrt {-4 a c+b^2+2 b n+n^2}}+c_1}-b-n\right )}{2 a}\\ y(x)&\to \frac {x^{-n} \left (\sqrt {-4 a c+b^2+2 b n+n^2}-b-n\right )}{2 a} \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
c = symbols("c") 
n = symbols("n") 
y = Function("y") 
ode = Eq(-a*x**n*y(x)**2 - b*y(x) - c/x**n + x*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -x**(-n - 2)*(c*x + x**(n + 1)*(a*x**n*y(x) + b)*y(x)) + Derivat