23.3.318 problem 320

Internal problem ID [6032]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 3. THE DIFFERENTIAL EQUATION IS LINEAR AND OF SECOND ORDER, page 311
Problem number : 320
Date solved : Tuesday, September 30, 2025 at 02:20:12 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} a \left (1+a \right ) y-2 a x y^{\prime }+x^{2} y^{\prime \prime }&={\mathrm e}^{x} x^{2+a} \end{align*}
Maple. Time used: 0.005 (sec). Leaf size: 15
ode:=a*(a+1)*y(x)-2*a*x*diff(y(x),x)+x^2*diff(diff(y(x),x),x) = exp(x)*x^(2+a); 
dsolve(ode,y(x), singsol=all);
 
\[ y = x^{a} \left (c_2 x +c_1 +{\mathrm e}^{x}\right ) \]
Mathematica. Time used: 0.353 (sec). Leaf size: 303
ode=a*(1 + a)*y[x] - 2*a*x*D[y[x],x] + x^2*D[y[x],{x,2}] == E^x*x^(2 + a); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to (-x)^{\frac {1}{2} \left (-\sqrt {a} \sqrt {a+1} \sqrt {\frac {1}{a^2+a}}-1\right )} x^a \left (c_1 x^{\frac {1}{2} \left (1-\sqrt {a} \sqrt {a+1} \sqrt {\frac {1}{a^2+a}}\right )} (-x)^{\frac {1}{2} \left (\sqrt {a} \sqrt {a+1} \sqrt {\frac {1}{a^2+a}}+1\right )}+c_2 \left (-x^2\right )^{\frac {1}{2} \left (\sqrt {a} \sqrt {a+1} \sqrt {\frac {1}{a^2+a}}+1\right )}+\sqrt {a} \sqrt {a+1} \sqrt {\frac {1}{a^2+a}} x (-x)^{\sqrt {a} \sqrt {a+1} \sqrt {\frac {1}{a^2+a}}} \Gamma \left (\frac {3}{2}-\frac {1}{2} \sqrt {a} \sqrt {a+1} \sqrt {\frac {1}{a^2+a}},-x\right )-\sqrt {a} \sqrt {a+1} \sqrt {\frac {1}{a^2+a}} x \Gamma \left (\frac {1}{2} \sqrt {a} \sqrt {a+1} \sqrt {\frac {1}{a^2+a}}+\frac {3}{2},-x\right )\right ) \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
y = Function("y") 
ode = Eq(-2*a*x*Derivative(y(x), x) + a*(a + 1)*y(x) + x**2*Derivative(y(x), (x, 2)) - x**(a + 2)*exp(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
Timed Out