29.6.24 problem 170

Internal problem ID [4770]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 6
Problem number : 170
Date solved : Sunday, March 30, 2025 at 03:53:43 AM
CAS classification : [_rational, _Riccati]

\begin{align*} x y^{\prime }&=k +a \,x^{n}+b y+c y^{2} \end{align*}

Maple. Time used: 0.003 (sec). Leaf size: 231
ode:=x*diff(y(x),x) = k+a*x^n+b*y(x)+c*y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {2 \left (\operatorname {BesselY}\left (\frac {\sqrt {b^{2}-4 c k}}{n}+1, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right ) c_1 +\operatorname {BesselJ}\left (\frac {\sqrt {b^{2}-4 c k}}{n}+1, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )\right ) \sqrt {a c}\, x^{\frac {n}{2}}-\left (\operatorname {BesselY}\left (\frac {\sqrt {b^{2}-4 c k}}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right ) c_1 +\operatorname {BesselJ}\left (\frac {\sqrt {b^{2}-4 c k}}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )\right ) \left (\sqrt {b^{2}-4 c k}+b \right )}{2 c \left (\operatorname {BesselY}\left (\frac {\sqrt {b^{2}-4 c k}}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right ) c_1 +\operatorname {BesselJ}\left (\frac {\sqrt {b^{2}-4 c k}}{n}, \frac {2 \sqrt {a c}\, x^{\frac {n}{2}}}{n}\right )\right )} \]
Mathematica. Time used: 0.68 (sec). Leaf size: 806
ode=x D[y[x],x]==k +a x^n+b y[x]+c y[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} \text {Solution too large to show}\end{align*}

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