55.2.7 problem 7

Internal problem ID [13233]
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 : 7
Date solved : Wednesday, October 01, 2025 at 03:44:33 AM
CAS classification : [[_homogeneous, `class G`], _Riccati]

\begin{align*} y^{\prime }&=a \,x^{n} y^{2}+b \,x^{-n -2} \end{align*}
Maple. Time used: 0.008 (sec). Leaf size: 62
ode:=diff(y(x),x) = a*x^n*y(x)^2+b*x^(-n-2); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {x^{-n -1} \left (n +1-\tan \left (\frac {\sqrt {4 b a -n^{2}-2 n -1}\, \left (\ln \left (x \right )-c_1 \right )}{2}\right ) \sqrt {4 b a -n^{2}-2 n -1}\right )}{2 a} \]
Mathematica. Time used: 0.272 (sec). Leaf size: 135
ode=D[y[x],x]==a*x^n*y[x]^2+b*x^(-n-2); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {x^{-n-1} \left (-\left (\sqrt {(n+1)^2-4 a b}+n+1\right ) x^{\sqrt {(n+1)^2-4 a b}}+c_1 \left (\sqrt {(n+1)^2-4 a b}-n-1\right )\right )}{2 a \left (x^{\sqrt {(n+1)^2-4 a b}}+c_1\right )}\\ y(x)&\to \frac {x^{-n-1} \left (\sqrt {(n+1)^2-4 a b}-n-1\right )}{2 a} \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
n = symbols("n") 
y = Function("y") 
ode = Eq(-a*x**n*y(x)**2 - b*x**(-n - 2) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : Cannot solve the partial differential equation due to inability of constantsim