66.17.2 problem 2

Internal problem ID [16225]
Book : DIFFERENTIAL EQUATIONS by Paul Blanchard, Robert L. Devaney, Glen R. Hall. 4th edition. Brooks/Cole. Boston, USA. 2012
Section : Chapter 4. Forcing and Resonance. Section 4.2 page 412
Problem number : 2
Date solved : Thursday, October 02, 2025 at 10:43:50 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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