67.15.9 problem 22.3 (d)

Internal problem ID [16727]
Book : Ordinary Differential Equations. An introduction to the fundamentals. Kenneth B. Howell. second edition. CRC Press. FL, USA. 2020
Section : Chapter 22. Method of undetermined coefficients. Additional exercises page 412
Problem number : 22.3 (d)
Date solved : Thursday, October 02, 2025 at 01:38:14 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+4 y^{\prime }-5 y&=\cos \left (x \right ) \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 23
ode:=diff(diff(y(x),x),x)+4*diff(y(x),x)-5*y(x) = cos(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-5 x} c_2 +{\mathrm e}^{x} c_1 -\frac {3 \cos \left (x \right )}{26}+\frac {\sin \left (x \right )}{13} \]
Mathematica. Time used: 0.077 (sec). Leaf size: 68
ode=D[y[x],{x,2}]+4*D[y[x],x]-5*y[x]==Cos[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{-5 x} \left (\int _1^x-\frac {1}{6} e^{5 K[1]} \cos (K[1])dK[1]+e^{6 x} \int _1^x\frac {1}{6} e^{-K[2]} \cos (K[2])dK[2]+c_2 e^{6 x}+c_1\right ) \end{align*}
Sympy. Time used: 0.123 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-5*y(x) - cos(x) + 4*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- 5 x} + C_{2} e^{x} + \frac {\sin {\left (x \right )}}{13} - \frac {3 \cos {\left (x \right )}}{26} \]