72.16.36 problem 38

Internal problem ID [14853]
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 : 38
Date solved : Thursday, March 13, 2025 at 05:13:24 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

With initial conditions

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

Maple. Time used: 0.031 (sec). Leaf size: 30
ode:=diff(diff(y(t),t),t)+3*diff(y(t),t)+2*y(t) = exp(-t)-4; 
ic:=y(0) = 0, D(y)(0) = 0; 
dsolve([ode,ic],y(t), singsol=all);
 
\[ y = -\left (2 \,{\mathrm e}^{2 t}+\ln \left ({\mathrm e}^{-t}\right ) {\mathrm e}^{t}-3 \,{\mathrm e}^{t}+1\right ) {\mathrm e}^{-2 t} \]
Mathematica. Time used: 0.053 (sec). Leaf size: 23
ode=D[y[t],{t,2}]+3*D[y[t],t]+2*y[t]==Exp[-t]-4; 
ic={y[0]==0,Derivative[1][y][0] ==0}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to e^{-t} (t+3)-e^{-2 t}-2 \]
Sympy. Time used: 0.270 (sec). Leaf size: 17
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(2*y(t) + 3*Derivative(y(t), t) + Derivative(y(t), (t, 2)) + 4 - exp(-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 (t + 3\right ) e^{- t} - 2 - e^{- 2 t} \]