89.23.7 problem 7

Internal problem ID [24811]
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. Miscellaneous Exercises at page 162
Problem number : 7
Date solved : Thursday, October 02, 2025 at 10:48:13 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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