83.12.4 problem 4

Internal problem ID [22005]
Book : Differential Equations By Kaj L. Nielsen. Second edition 1966. Barnes and nobel. 66-28306
Section : Chapter VII. Operational method. Ex. XV at page 121
Problem number : 4
Date solved : Thursday, October 02, 2025 at 08:21:36 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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