ODE
\[ -2 a x y'(x)+a (a+1) y(x)+x^2 y''(x)=e^x x^{a+2} \] ODE Classification
[[_2nd_order, _linear, _nonhomogeneous]]
Book solution method
TO DO
Mathematica ✓
cpu = 0.270628 (sec), leaf count = 302
\[\left \{\left \{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 {1}{2} \left (3-\sqrt {a} \sqrt {a+1} \sqrt {\frac {1}{a^2+a}}\right ),-x\right )-\sqrt {a} \sqrt {a+1} \sqrt {\frac {1}{a^2+a}} x \Gamma \left (\frac {1}{2} \left (\sqrt {a} \sqrt {a+1} \sqrt {\frac {1}{a^2+a}}+3\right ),-x\right )\right )\right \}\right \}\]
Maple ✓
cpu = 0.023 (sec), leaf count = 20
\[ \left \{ y \left ( x \right ) ={x}^{1+a}{\it \_C2}+{x}^{a} \left ( {\it \_C1}+{{\rm e}^{x}} \right ) \right \} \] Mathematica raw input
DSolve[a*(1 + a)*y[x] - 2*a*x*y'[x] + x^2*y''[x] == E^x*x^(2 + a),y[x],x]
Mathematica raw output
{{y[x] -> (-x)^((-1 - Sqrt[a]*Sqrt[1 + a]*Sqrt[(a + a^2)^(-1)])/2)*x^a*((-x)^((1
+ Sqrt[a]*Sqrt[1 + a]*Sqrt[(a + a^2)^(-1)])/2)*x^((1 - Sqrt[a]*Sqrt[1 + a]*Sqrt
[(a + a^2)^(-1)])/2)*C[1] + (-x^2)^((1 + Sqrt[a]*Sqrt[1 + a]*Sqrt[(a + a^2)^(-1)
])/2)*C[2] + Sqrt[a]*Sqrt[1 + a]*Sqrt[(a + a^2)^(-1)]*(-x)^(Sqrt[a]*Sqrt[1 + a]*
Sqrt[(a + a^2)^(-1)])*x*Gamma[(3 - Sqrt[a]*Sqrt[1 + a]*Sqrt[(a + a^2)^(-1)])/2,
-x] - Sqrt[a]*Sqrt[1 + a]*Sqrt[(a + a^2)^(-1)]*x*Gamma[(3 + Sqrt[a]*Sqrt[1 + a]*
Sqrt[(a + a^2)^(-1)])/2, -x])}}
Maple raw input
dsolve(x^2*diff(diff(y(x),x),x)-2*a*x*diff(y(x),x)+a*(1+a)*y(x) = exp(x)*x^(a+2), y(x),'implicit')
Maple raw output
y(x) = x^(1+a)*_C2+x^a*(_C1+exp(x))