61.19.7 problem 7

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

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

Maple. Time used: 0.115 (sec). Leaf size: 30
ode:=x*diff(y(x),x) = f(x)*y(x)^2+n*y(x)+a*x^(2*n)*f(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\tan \left (-\sqrt {a}\, \left (\int f x^{n -1}d x \right )+c_{1} \right ) \sqrt {a}\, x^{n} \]
Mathematica. Time used: 0.39 (sec). Leaf size: 41
ode=x*D[y[x],x]==f[x]*y[x]^2+n*y[x]+a*x^(2*n)*f[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \sqrt {a} x^n \tan \left (\sqrt {a} \int _1^xf(K[1]) K[1]^{n-1}dK[1]+c_1\right ) \]
Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
n = symbols("n") 
y = Function("y") 
f = Function("f") 
ode = Eq(-a*x**(2*n)*f(x) - n*y(x) + x*Derivative(y(x), x) - f(x)*y(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (a*x**(2*n)*f(x) + n*y(x) + f(x)*y(x)**2)/x cannot be solved by the factorable group method