58.2.31 problem 31

Internal problem ID [9154]
Book : Second order enumerated odes
Section : section 2
Problem number : 31
Date solved : Sunday, March 30, 2025 at 02:24:08 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-2 b x y^{\prime }+b^{2} x^{2} y&=x \end{align*}

Maple. Time used: 0.008 (sec). Leaf size: 123
ode:=diff(diff(y(x),x),x)-2*b*x*diff(y(x),x)+b^2*x^2*y(x) = x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {-\frac {\sqrt {2}\, \sqrt {\pi }\, \left (\operatorname {erf}\left (\frac {\sqrt {2}\, \left (b x +\sqrt {-b}\right )}{2 \sqrt {b}}\right ) {\mathrm e}^{2 x \sqrt {-b}}-\operatorname {erf}\left (\frac {\sqrt {2}\, \left (-b x +\sqrt {-b}\right )}{2 \sqrt {b}}\right )\right ) {\mathrm e}^{-\frac {1}{2}+\frac {b \,x^{2}}{2}-x \sqrt {-b}}}{4}+\left ({\mathrm e}^{\frac {x \left (b x -2 \sqrt {-b}\right )}{2}} c_1 +{\mathrm e}^{\frac {x \left (b x +2 \sqrt {-b}\right )}{2}} c_2 \right ) b^{{3}/{2}}}{b^{{3}/{2}}} \]
Mathematica. Time used: 0.461 (sec). Leaf size: 162
ode=D[y[x],{x,2}]-2*b*x*D[y[x],x]+b^2*x^2*y[x]==x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {e^{\frac {b x^2}{2}-i \sqrt {b} x} \left (2 \sqrt {b} \int _1^x\frac {i e^{i \sqrt {b} K[1]-\frac {1}{2} b K[1]^2} K[1]}{2 \sqrt {b}}dK[1]-i e^{2 i \sqrt {b} x} \int _1^xe^{-\frac {1}{2} b K[2]^2-i \sqrt {b} K[2]} K[2]dK[2]-i c_2 e^{2 i \sqrt {b} x}+2 \sqrt {b} c_1\right )}{2 \sqrt {b}} \]
Sympy
from sympy import * 
x = symbols("x") 
b = symbols("b") 
y = Function("y") 
ode = Eq(b**2*x**2*y(x) - 2*b*x*Derivative(y(x), x) - x + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (b**2*x**2*y(x) - x + Derivative(y(x), (x, 2)))/(2*b*x) cannot be solved by the factorable group method