76.22.6 problem 19

Internal problem ID [17716]
Book : Differential equations. An introduction to modern methods and applications. James Brannan, William E. Boyce. Third edition. Wiley 2015
Section : Chapter 5. The Laplace transform. Section 5.8 (Convolution Integrals and Their Applications). Problems at page 359
Problem number : 19
Date solved : Monday, March 31, 2025 at 04:25:50 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Using Laplace method With initial conditions

\begin{align*} y \left (0\right )&=1\\ y^{\prime }\left (0\right )&=0 \end{align*}

Maple. Time used: 0.191 (sec). Leaf size: 76
ode:=diff(diff(y(t),t),t)+3*diff(y(t),t)+2*y(t) = cos(alpha*t); 
ic:=y(0) = 1, D(y)(0) = 0; 
dsolve([ode,ic],y(t),method='laplace');
 
\[ y = \frac {\left (-\alpha ^{4}-3 \alpha ^{2}-2\right ) {\mathrm e}^{-2 t}+\left (2 \alpha ^{4}+9 \alpha ^{2}+4\right ) {\mathrm e}^{-t}-\cos \left (\alpha t \right ) \alpha ^{2}+3 \alpha \sin \left (\alpha t \right )+2 \cos \left (\alpha t \right )}{\left (\alpha ^{2}+1\right ) \left (\alpha ^{2}+4\right )} \]
Mathematica. Time used: 0.094 (sec). Leaf size: 84
ode=D[y[t],{t,2}]+3*D[y[t],t]+2*y[t]==Cos[a*t]; 
ic={y[0]==1,Derivative[1][y][0] ==0}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to \frac {e^{-2 t} \left (2 a^4 e^t-a^4+9 a^2 e^t-\left (a^2-2\right ) e^{2 t} \cos (a t)-3 a^2+3 a e^{2 t} \sin (a t)+4 e^t-2\right )}{a^4+5 a^2+4} \]
Sympy. Time used: 0.320 (sec). Leaf size: 88
from sympy import * 
t = symbols("t") 
Alpha = symbols("Alpha") 
y = Function("y") 
ode = Eq(2*y(t) - cos(Alpha*t) + 3*Derivative(y(t), t) + Derivative(y(t), (t, 2)),0) 
ics = {y(0): 1, Subs(Derivative(y(t), t), t, 0): 0} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = - \frac {\mathrm {A}^{2} \cos {\left (\mathrm {A} t \right )}}{\mathrm {A}^{4} + 5 \mathrm {A}^{2} + 4} + \frac {3 \mathrm {A} \sin {\left (\mathrm {A} t \right )}}{\mathrm {A}^{4} + 5 \mathrm {A}^{2} + 4} + \frac {\left (- \mathrm {A}^{2} - 2\right ) e^{- 2 t}}{\mathrm {A}^{2} + 4} + \frac {2 \cos {\left (\mathrm {A} t \right )}}{\mathrm {A}^{4} + 5 \mathrm {A}^{2} + 4} + \frac {\left (2 \mathrm {A}^{2} + 1\right ) e^{- t}}{\mathrm {A}^{2} + 1} \]