58.11.43 problem 43

Internal problem ID [14774]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 4, Section 4.3. The method of undetermined coefficients. Exercises page 151
Problem number : 43
Date solved : Thursday, October 02, 2025 at 09:51:03 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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