2.28.11 Problem 21

2.28.11.1 Maple
2.28.11.2 Mathematica
2.28.11.3 Sympy

Internal problem ID [13682]
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 : 21
Date solved : Friday, December 19, 2025 at 10:31:13 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y^{\prime \prime }+a y^{\prime } x +b x y&=0 \\ \end{align*}
2.28.11.1 Maple. Time used: 0.005 (sec). Leaf size: 70
ode:=diff(diff(y(x),x),x)+a*x*diff(y(x),x)+b*x*y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-\frac {b x}{a}} \left (\operatorname {KummerU}\left (\frac {b^{2}}{2 a^{3}}, \frac {1}{2}, -\frac {\left (x \,a^{2}-2 b \right )^{2}}{2 a^{3}}\right ) c_2 +\operatorname {KummerM}\left (\frac {b^{2}}{2 a^{3}}, \frac {1}{2}, -\frac {\left (x \,a^{2}-2 b \right )^{2}}{2 a^{3}}\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 
      <- heuristic approach successful 
   <- hypergeometric successful 
<- special function solution successful
 

Maple step by step

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \frac {d^{2}}{d x^{2}}y \left (x \right )+a x \left (\frac {d}{d x}y \left (x \right )\right )+b x 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 \cdot y \left (x \right )\hspace {3pt}\textrm {to series expansion}\hspace {3pt} \\ {} & {} & x \cdot y \left (x \right )=\moverset {\infty }{\munderset {k =0}{\sum }}a_{k} x^{k +1} \\ {} & \circ & \textrm {Shift index using}\hspace {3pt} k \mathrm {->}k -1 \\ {} & {} & x \cdot y \left (x \right )=\moverset {\infty }{\munderset {k =1}{\sum }}a_{k -1} x^{k} \\ {} & \circ & \textrm {Convert}\hspace {3pt} x \cdot \left (\frac {d}{d x}y \left (x \right )\right )\hspace {3pt}\textrm {to series expansion}\hspace {3pt} \\ {} & {} & x \cdot \left (\frac {d}{d x}y \left (x \right )\right )=\moverset {\infty }{\munderset {k =0}{\sum }}a_{k} k \,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} \\ {} & {} & 2 a_{2}+\left (\moverset {\infty }{\munderset {k =1}{\sum }}\left (a_{k +2} \left (k +2\right ) \left (k +1\right )+a a_{k} k +b a_{k -1}\right ) x^{k}\right )=0 \\ \bullet & {} & \textrm {Each term must be 0}\hspace {3pt} \\ {} & {} & 2 a_{2}=0 \\ \bullet & {} & \textrm {Each term in the series must be 0, giving the recursion relation}\hspace {3pt} \\ {} & {} & \left (k^{2}+3 k +2\right ) a_{k +2}+a a_{k} k +b a_{k -1}=0 \\ \bullet & {} & \textrm {Shift index using}\hspace {3pt} k \mathrm {->}k +1 \\ {} & {} & \left (\left (k +1\right )^{2}+3 k +5\right ) a_{k +3}+a a_{k +1} \left (k +1\right )+b a_{k}=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 +3}=-\frac {a k a_{k +1}+a a_{k +1}+b a_{k}}{k^{2}+5 k +6}, 2 a_{2}=0\right ] \end {array} \]
2.28.11.2 Mathematica. Time used: 0.034 (sec). Leaf size: 96
ode=D[y[x],{x,2}]+a*x*D[y[x],x]+b*x*y[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{\frac {b x}{a}-\frac {a x^2}{2}} \left (c_2 \operatorname {Hypergeometric1F1}\left (\frac {1}{2}-\frac {b^2}{2 a^3},\frac {1}{2},\frac {\left (a^2 x-2 b\right )^2}{2 a^3}\right )+c_1 \operatorname {HermiteH}\left (\frac {b^2}{a^3}-1,\frac {a^2 x-2 b}{\sqrt {2} a^{3/2}}\right )\right ) \end{align*}
2.28.11.3 Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
y = Function("y") 
ode = Eq(a*x*Derivative(y(x), x) + b*x*y(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
False