89.19.16 problem 16

Internal problem ID [24744]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 10. Nonhomogeneous Equations: Operational methods. Exercises at page 151
Problem number : 16
Date solved : Thursday, October 02, 2025 at 10:47:37 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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