86.11.11 problem 10 (b)

Internal problem ID [23205]
Book : An introduction to Differential Equations. By Howard Frederick Cleaves. 1969. Oliver and Boyd publisher. ISBN 0050015044
Section : Chapter 9. The operational method. Exercise 9c at page 137
Problem number : 10 (b)
Date solved : Thursday, October 02, 2025 at 09:24:22 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y+2 y^{\prime }+y^{\prime \prime }&=x^{2} {\mathrm e}^{x} \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 27
ode:=diff(diff(y(x),x),x)+2*diff(y(x),x)+y(x) = x^2*exp(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (c_1 x +c_2 \right ) {\mathrm e}^{-x}+\frac {\left (x^{2}-2 x +\frac {3}{2}\right ) {\mathrm e}^{x}}{4} \]
Mathematica. Time used: 0.014 (sec). Leaf size: 36
ode=D[y[x],{x,2}]+2*D[y[x],x]+y[x]==x^2*Exp[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{8} e^x \left (2 x^2-4 x+3\right )+e^{-x} (c_2 x+c_1) \end{align*}
Sympy. Time used: 0.151 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2*exp(x) + y(x) + 2*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + C_{2} x\right ) e^{- x} + \frac {\left (2 x^{2} - 4 x + 3\right ) e^{x}}{8} \]