72.16.18 problem 18

Internal problem ID [14835]
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.1 page 399
Problem number : 18
Date solved : Thursday, March 13, 2025 at 04:20:55 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y^{\prime \prime }+4 y^{\prime }+20 y&={\mathrm e}^{-4 t} \end{align*}

With initial conditions

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

Maple. Time used: 0.029 (sec). Leaf size: 28
ode:=diff(diff(y(t),t),t)+4*diff(y(t),t)+20*y(t) = exp(-4*t); 
ic:=y(0) = 0, D(y)(0) = 0; 
dsolve([ode,ic],y(t), singsol=all);
 
\[ y = \frac {\left (\sin \left (4 t \right )-2 \cos \left (4 t \right )\right ) {\mathrm e}^{-2 t}}{40}+\frac {{\mathrm e}^{-4 t}}{20} \]
Mathematica. Time used: 0.12 (sec). Leaf size: 119
ode=D[y[t],{t,2}]+4*D[y[t],t]+20*y[t]==Exp[-4*t]; 
ic={y[0]==0,Derivative[1][y][0] ==0}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to e^{-2 t} \left (-\sin (4 t) \int _1^0\frac {1}{4} e^{-2 K[1]} \cos (4 K[1])dK[1]+\sin (4 t) \int _1^t\frac {1}{4} e^{-2 K[1]} \cos (4 K[1])dK[1]+\cos (4 t) \left (\int _1^t-\frac {1}{4} e^{-2 K[2]} \sin (4 K[2])dK[2]-\int _1^0-\frac {1}{4} e^{-2 K[2]} \sin (4 K[2])dK[2]\right )\right ) \]
Sympy. Time used: 0.319 (sec). Leaf size: 29
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(20*y(t) + 4*Derivative(y(t), t) + Derivative(y(t), (t, 2)) - exp(-4*t),0) 
ics = {y(0): 0, Subs(Derivative(y(t), t), t, 0): 0} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = \left (\frac {\sin {\left (4 t \right )}}{40} - \frac {\cos {\left (4 t \right )}}{20} + \frac {e^{- 2 t}}{20}\right ) e^{- 2 t} \]