61.19.6 problem 6

Internal problem ID [12196]
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.8-1. Equations containing arbitrary functions (but not containing their derivatives).
Problem number : 6
Date solved : Wednesday, March 05, 2025 at 05:33:50 PM
CAS classification : [_Riccati]

\begin{align*} y^{\prime }&=-\left (n +1\right ) x^{n} y^{2}+x^{n +1} f \left (x \right ) y-f \left (x \right ) \end{align*}

Maple. Time used: 0.014 (sec). Leaf size: 169
ode:=diff(y(x),x) = -(n+1)*x^n*y(x)^2+x^(n+1)*f(x)*y(x)-f(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {x^{-n -1} \left (x^{n +1} {\mathrm e}^{\int \frac {x^{n +1} f x -2 n -2}{x}d x}+\left (\int x^{n} {\mathrm e}^{\int x^{n +1} fd x +\left (-2 n -2\right ) \left (\int \frac {1}{x}d x \right )}d x \right ) n +\int x^{n} {\mathrm e}^{\int x^{n +1} fd x +\left (-2 n -2\right ) \left (\int \frac {1}{x}d x \right )}d x -c_{1} \right )}{\left (\int x^{n} {\mathrm e}^{\int x^{n +1} fd x +\left (-2 n -2\right ) \left (\int \frac {1}{x}d x \right )}d x \right ) n +\int x^{n} {\mathrm e}^{\int x^{n +1} fd x +\left (-2 n -2\right ) \left (\int \frac {1}{x}d x \right )}d x -c_{1}} \]
Mathematica
ode=D[y[x],x]==-(n+1)*x^n*y[x]^2+x^(n+1)*f[x]*y[x]-f[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 

Not solved

Sympy
from sympy import * 
x = symbols("x") 
n = symbols("n") 
y = Function("y") 
f = Function("f") 
ode = Eq(x**n*(n + 1)*y(x)**2 - x**(n + 1)*f(x)*y(x) + f(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE n*x**n*y(x)**2 + x**n*y(x)**2 - x**(n + 1)*f(x)*y(x) + f(x) + Derivative(y(x), x) cannot be solved by the factorable group method