78.14.19 problem 6 (d)

Internal problem ID [18284]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 3. Second order linear equations. Section 19. The Method of Variation of Parameters. Problems at page 135
Problem number : 6 (d)
Date solved : Monday, March 31, 2025 at 05:24:49 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.043 (sec). Leaf size: 31
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]
 
\[ y(x)\to \frac {1}{2} e^{2 x} (x-1)+c_1 e^x-c_2 (x+1) \]
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