2.28.27 Problem 37

2.28.27.1 Maple
2.28.27.2 Mathematica
2.28.27.3 Sympy

Internal problem ID [13698]
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-2
Problem number : 37
Date solved : Friday, December 19, 2025 at 10:46:26 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y^{\prime \prime }+\left (a \,x^{2}+b x \right ) y^{\prime }+\left (\alpha \,x^{2}+\beta x +\gamma \right ) y&=0 \\ \end{align*}
2.28.27.1 Maple. Time used: 0.040 (sec). Leaf size: 255
ode:=diff(diff(y(x),x),x)+(a*x^2+b*x)*diff(y(x),x)+(alpha*x^2+beta*x+gamma)*y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-\frac {x \left (2 a^{2} x^{2} \operatorname {csgn}\left (a \right )+3 a b x \,\operatorname {csgn}\left (a \right )+2 a^{2} x^{2}+3 a b x -12 \,\operatorname {csgn}\left (a \right ) \alpha \right )}{12 a}} \left (c_2 \,{\mathrm e}^{\frac {\operatorname {csgn}\left (a \right ) x \left (2 a^{2} x^{2}+3 a b x -12 \alpha \right )}{6 a}} \operatorname {HeunT}\left (\frac {3^{{2}/{3}} \left (2 a^{2} \gamma -b a \beta +\alpha \,b^{2}+2 \alpha ^{2}\right )}{2 a^{2} \left (a^{2}\right )^{{1}/{3}}}, \frac {3 \left (a^{2}-\beta a +b \alpha \right ) \operatorname {csgn}\left (a \right )}{a^{2}}, -\frac {3^{{1}/{3}} \left (b^{2}+8 \alpha \right )}{4 \left (a^{2}\right )^{{2}/{3}}}, -\frac {3^{{2}/{3}} a \left (2 a x +b \right )}{6 \left (a^{2}\right )^{{5}/{6}}}\right )+\operatorname {HeunT}\left (\frac {3^{{2}/{3}} \left (2 a^{2} \gamma -b a \beta +\alpha \,b^{2}+2 \alpha ^{2}\right )}{2 a^{2} \left (a^{2}\right )^{{1}/{3}}}, -\frac {3 \left (a^{2}-\beta a +b \alpha \right ) \operatorname {csgn}\left (a \right )}{a^{2}}, -\frac {3^{{1}/{3}} \left (b^{2}+8 \alpha \right )}{4 \left (a^{2}\right )^{{2}/{3}}}, \frac {3^{{2}/{3}} a \left (2 a x +b \right )}{6 \left (a^{2}\right )^{{5}/{6}}}\right ) c_1 \right ) \]

Maple trace

Methods for second order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
checking if the LODE has constant coefficients 
checking if the LODE is of Euler type 
trying a symmetry of the form [xi=0, eta=F(x)] 
checking if the LODE is missing y 
-> Trying a Liouvillian solution using Kovacics algorithm 
<- No Liouvillian solutions exists 
-> Trying a solution in terms of special functions: 
   -> Bessel 
   -> elliptic 
   -> Legendre 
   -> Kummer 
      -> hyper3: Equivalence to 1F1 under a power @ Moebius 
   -> hypergeometric 
      -> heuristic approach 
      -> hyper3: Equivalence to 2F1, 1F1 or 0F1 under a power @ Moebius 
   -> Mathieu 
      -> Equivalence to the rational form of Mathieu ODE under a power @ Moebi\ 
us 
trying a solution in terms of MeijerG functions 
-> Heun: Equivalence to the GHE or one of its 4 confluent cases under a power \ 
@ Moebius 
<- Heun successful: received ODE is equivalent to the  HeunT  ODE, case  c = 0
 

Maple step by step

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \frac {d^{2}}{d x^{2}}y \left (x \right )+\left (a \,x^{2}+b x \right ) \left (\frac {d}{d x}y \left (x \right )\right )+\left (\alpha \,x^{2}+\beta x +\gamma \right ) y \left (x \right )=0 \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 2 \\ {} & {} & \frac {d^{2}}{d x^{2}}y \left (x \right ) \\ \bullet & {} & \textrm {Assume series solution for}\hspace {3pt} y \left (x \right ) \\ {} & {} & y \left (x \right )=\moverset {\infty }{\munderset {k =0}{\sum }}a_{k} x^{k} \\ \square & {} & \textrm {Rewrite ODE with series expansions}\hspace {3pt} \\ {} & \circ & \textrm {Convert}\hspace {3pt} x^{m}\cdot y \left (x \right )\hspace {3pt}\textrm {to series expansion for}\hspace {3pt} m =0..2 \\ {} & {} & x^{m}\cdot y \left (x \right )=\moverset {\infty }{\munderset {k =\max \left (0, -m \right )}{\sum }}a_{k} x^{k +m} \\ {} & \circ & \textrm {Shift index using}\hspace {3pt} k \mathrm {->}k -m \\ {} & {} & x^{m}\cdot y \left (x \right )=\moverset {\infty }{\munderset {k =\max \left (0, -m \right )+m}{\sum }}a_{k -m} x^{k} \\ {} & \circ & \textrm {Convert}\hspace {3pt} x^{m}\cdot \left (\frac {d}{d x}y \left (x \right )\right )\hspace {3pt}\textrm {to series expansion for}\hspace {3pt} m =1..2 \\ {} & {} & x^{m}\cdot \left (\frac {d}{d x}y \left (x \right )\right )=\moverset {\infty }{\munderset {k =\max \left (0, 1-m \right )}{\sum }}a_{k} k \,x^{k -1+m} \\ {} & \circ & \textrm {Shift index using}\hspace {3pt} k \mathrm {->}k +1-m \\ {} & {} & x^{m}\cdot \left (\frac {d}{d x}y \left (x \right )\right )=\moverset {\infty }{\munderset {k =\max \left (0, 1-m \right )+m -1}{\sum }}a_{k +1-m} \left (k +1-m \right ) x^{k} \\ {} & \circ & \textrm {Convert}\hspace {3pt} \frac {d^{2}}{d x^{2}}y \left (x \right )\hspace {3pt}\textrm {to series expansion}\hspace {3pt} \\ {} & {} & \frac {d^{2}}{d x^{2}}y \left (x \right )=\moverset {\infty }{\munderset {k =2}{\sum }}a_{k} k \left (k -1\right ) x^{k -2} \\ {} & \circ & \textrm {Shift index using}\hspace {3pt} k \mathrm {->}k +2 \\ {} & {} & \frac {d^{2}}{d x^{2}}y \left (x \right )=\moverset {\infty }{\munderset {k =0}{\sum }}a_{k +2} \left (k +2\right ) \left (k +1\right ) x^{k} \\ & {} & \textrm {Rewrite ODE with series expansions}\hspace {3pt} \\ {} & {} & a_{0} \gamma +2 a_{2}+\left (6 a_{3}+a_{1} \left (b +\gamma \right )+a_{0} \beta \right ) x +\left (\moverset {\infty }{\munderset {k =2}{\sum }}\left (a_{k +2} \left (k +2\right ) \left (k +1\right )+a_{k} \left (b k +\gamma \right )+a_{k -1} \left (a \left (k -1\right )+\beta \right )+a_{k -2} \alpha \right ) x^{k}\right )=0 \\ \bullet & {} & \textrm {The coefficients of each power of}\hspace {3pt} x \hspace {3pt}\textrm {must be 0}\hspace {3pt} \\ {} & {} & \left [2 a_{2}+a_{0} \gamma =0, 6 a_{3}+a_{1} \left (b +\gamma \right )+a_{0} \beta =0\right ] \\ \bullet & {} & \textrm {Solve for the dependent coefficient(s)}\hspace {3pt} \\ {} & {} & \left \{a_{2}=-\frac {a_{0} \gamma }{2}, a_{3}=-\frac {1}{6} a_{1} b -\frac {1}{6} a_{0} \beta -\frac {1}{6} a_{1} \gamma \right \} \\ \bullet & {} & \textrm {Each term in the series must be 0, giving the recursion relation}\hspace {3pt} \\ {} & {} & k^{2} a_{k +2}+\left (a a_{k -1}+b a_{k}+3 a_{k +2}\right ) k +\left (-a +\beta \right ) a_{k -1}+a_{k -2} \alpha +a_{k} \gamma +2 a_{k +2}=0 \\ \bullet & {} & \textrm {Shift index using}\hspace {3pt} k \mathrm {->}k +2 \\ {} & {} & \left (k +2\right )^{2} a_{k +4}+\left (a a_{k +1}+b a_{k +2}+3 a_{k +4}\right ) \left (k +2\right )+\left (-a +\beta \right ) a_{k +1}+a_{k} \alpha +a_{k +2} \gamma +2 a_{k +4}=0 \\ \bullet & {} & \textrm {Recursion relation that defines the series solution to the ODE}\hspace {3pt} \\ {} & {} & \left [y \left (x \right )=\moverset {\infty }{\munderset {k =0}{\sum }}a_{k} x^{k}, a_{k +4}=-\frac {a k a_{k +1}+b k a_{k +2}+a a_{k +1}+a_{k} \alpha +2 b a_{k +2}+\beta a_{k +1}+a_{k +2} \gamma }{k^{2}+7 k +12}, a_{2}=-\frac {a_{0} \gamma }{2}, a_{3}=-\frac {1}{6} a_{1} b -\frac {1}{6} a_{0} \beta -\frac {1}{6} a_{1} \gamma \right ] \end {array} \]
2.28.27.2 Mathematica
ode=D[y[x],{x,2}]+(a*x^2+b*x)*D[y[x],x]+(\[Alpha]*x^2+\[Beta]*x+\[Gamma])*y[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 

Not solved

2.28.27.3 Sympy
from sympy import * 
x = symbols("x") 
Alpha = symbols("Alpha") 
BETA = symbols("BETA") 
Gamma = symbols("Gamma") 
a = symbols("a") 
b = symbols("b") 
y = Function("y") 
ode = Eq((a*x**2 + b*x)*Derivative(y(x), x) + (Alpha*x**2 + BETA*x + Gamma)*y(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
False