85.59.5 problem 5

Internal problem ID [22846]
Book : Applied Differential Equations. By Murray R. Spiegel. 3rd edition. 1980. Pearson. ISBN 978-0130400970
Section : Chapter 4. Linear differential equations. A Exercises at page 203
Problem number : 5
Date solved : Thursday, October 02, 2025 at 09:15:42 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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