44.11.19 problem 5(d)

Internal problem ID [9289]
Book : Differential Equations: Theory, Technique, and Practice by George Simmons, Steven Krantz. McGraw-Hill NY. 2007. 1st Edition.
Section : Chapter 2. Second-Order Linear Equations. Section 2.3. THE METHOD OF VARIATION OF PARAMETERS. Page 71
Problem number : 5(d)
Date solved : Tuesday, September 30, 2025 at 06:16:10 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} x y^{\prime \prime }-\left (1+x \right ) y^{\prime }+y&=x^{2} {\mathrm e}^{2 x} \end{align*}
Maple. Time used: 0.005 (sec). Leaf size: 23
ode:=x*diff(diff(y(x),x),x)-(1+x)*diff(y(x),x)+y(x) = x^2*exp(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (1+x \right ) c_2 +{\mathrm e}^{x} c_1 +\frac {\left (-1+x \right ) {\mathrm e}^{2 x}}{2} \]
Mathematica. Time used: 0.357 (sec). Leaf size: 204
ode=x*D[y[x],{x,2}]-(1+x)*D[y[x],x]+y[x]==x^2*Exp[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \sqrt {x} \exp \left (\frac {1}{2} \left (2 \int _1^x\frac {K[1]-1}{2 K[1]}dK[1]+x+1\right )\right ) \left (\int _1^x-\exp \left (\frac {3 K[3]}{2}+\int _1^{K[3]}\frac {K[1]-1}{2 K[1]}dK[1]-\frac {1}{2}\right ) \sqrt {K[3]} \int _1^{K[3]}\exp \left (-2 \int _1^{K[2]}\frac {K[1]-1}{2 K[1]}dK[1]\right )dK[2]dK[3]+\int _1^x\exp \left (-2 \int _1^{K[2]}\frac {K[1]-1}{2 K[1]}dK[1]\right )dK[2] \left (\int _1^x\exp \left (\frac {3 K[4]}{2}+\int _1^{K[4]}\frac {K[1]-1}{2 K[1]}dK[1]-\frac {1}{2}\right ) \sqrt {K[4]}dK[4]+c_2\right )+c_1\right ) \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2*exp(2*x) + x*Derivative(y(x), (x, 2)) - (x + 1)*Derivative(y(x), x) + y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (-x**2*exp(2*x) + x*Derivative(y(x), (x, 2)) + y(x))/(x + 1) cannot be solved by the factorable group method