72.17.3 problem 3

Internal problem ID [14860]
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 : 3
Date solved : Thursday, March 13, 2025 at 05:13:44 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+3 y^{\prime }+2 y&=\sin \left (t \right ) \end{align*}

Maple. Time used: 0.003 (sec). Leaf size: 26
ode:=diff(diff(y(t),t),t)+3*diff(y(t),t)+2*y(t) = sin(t); 
dsolve(ode,y(t), singsol=all);
 
\[ y = -c_{1} {\mathrm e}^{-2 t}-\frac {3 \cos \left (t \right )}{10}+\frac {\sin \left (t \right )}{10}+c_{2} {\mathrm e}^{-t} \]
Mathematica. Time used: 0.055 (sec). Leaf size: 57
ode=D[y[t],{t,2}]+3*D[y[t],t]+2*y[t]==Sin[t]; 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to e^{-2 t} \left (\int _1^t-e^{2 K[1]} \sin (K[1])dK[1]+e^t \int _1^te^{K[2]} \sin (K[2])dK[2]+c_2 e^t+c_1\right ) \]
Sympy. Time used: 0.205 (sec). Leaf size: 26
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(2*y(t) - sin(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 {\sin {\left (t \right )}}{10} - \frac {3 \cos {\left (t \right )}}{10} \]