61.31.12 problem 193

Internal problem ID [12614]
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-6
Problem number : 193
Date solved : Wednesday, March 05, 2025 at 07:27:48 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Maple. Time used: 0.105 (sec). Leaf size: 25
ode:=x^2*(a*x+b)*diff(diff(y(x),x),x)+(a*(2-n-m)*x^2-b*(n+m)*x)*diff(y(x),x)+(a*m*(n-1)*x+b*n*(m+1))*y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {c_{1} x^{n}+c_{2} x^{m +1}}{a x +b} \]
Mathematica. Time used: 0.962 (sec). Leaf size: 107
ode=x^2*(a*x+b)*D[y[x],{x,2}]+(a*(2-n-m)*x^2-b*(n+m)*x)*D[y[x],x]+(a*m*(n-1)*x+b*n*(m+1))*y[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {x^{\frac {1}{2}-\frac {1}{2} \sqrt {(m-n+1)^2}} \left (c_2 x^{\sqrt {(m-n+1)^2}}+c_1 \sqrt {(m-n+1)^2}\right ) \exp \left (-\frac {1}{2} \int _1^x\left (\frac {2 a}{b+a K[1]}-\frac {m+n}{K[1]}\right )dK[1]\right )}{\sqrt {(m-n+1)^2}} \]
Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
m = symbols("m") 
n = symbols("n") 
y = Function("y") 
ode = Eq(x**2*(a*x + b)*Derivative(y(x), (x, 2)) + (a*x**2*(-m - n + 2) - b*x*(m + n))*Derivative(y(x), x) + (a*m*x*(n - 1) + b*n*(m + 1))*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
ValueError : Expected Expr or iterable but got None