61.29.23 problem 132

Internal problem ID [12553]
Book : Handbook of exact solutions for ordinary differential equations. By Polyanin and Zaitsev. Second edition
Section : Chapter 2, Second-Order Differential Equations. section 2.1.2-4
Problem number : 132
Date solved : Monday, March 31, 2025 at 05:38:47 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Maple. Time used: 0.014 (sec). Leaf size: 80
ode:=x^2*diff(diff(y(x),x),x)+a*x*diff(y(x),x)+(b*x^n+c)*y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = x^{-\frac {a}{2}} \sqrt {x}\, \left (\operatorname {BesselY}\left (\frac {\sqrt {a^{2}-2 a -4 c +1}}{n}, \frac {2 \sqrt {b}\, x^{\frac {n}{2}}}{n}\right ) c_2 +\operatorname {BesselJ}\left (\frac {\sqrt {a^{2}-2 a -4 c +1}}{n}, \frac {2 \sqrt {b}\, x^{\frac {n}{2}}}{n}\right ) c_1 \right ) \]
Mathematica. Time used: 0.183 (sec). Leaf size: 168
ode=x^2*D[y[x],{x,2}]+a*x*D[y[x],x]+(b*x^n+c)*y[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to n^{\frac {a-1}{n}} b^{-\frac {a-1}{2 n}} \left (x^n\right )^{-\frac {a-1}{2 n}} \left (c_1 \operatorname {Gamma}\left (1-\frac {\sqrt {a^2-2 a-4 c+1}}{n}\right ) \operatorname {BesselJ}\left (-\frac {\sqrt {a^2-2 a-4 c+1}}{n},\frac {2 \sqrt {b} \sqrt {x^n}}{n}\right )+c_2 \operatorname {Gamma}\left (\frac {n+\sqrt {a^2-2 a-4 c+1}}{n}\right ) \operatorname {BesselJ}\left (\frac {\sqrt {a^2-2 a-4 c+1}}{n},\frac {2 \sqrt {b} \sqrt {x^n}}{n}\right )\right ) \]
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*Derivative(y(x), x) + x**2*Derivative(y(x), (x, 2)) + (b*x**n + c)*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
TypeError : invalid input: 1 - a