72.19.3 problem 29

Internal problem ID [14882]
Book : DIFFERENTIAL EQUATIONS by Paul Blanchard, Robert L. Devaney, Glen R. Hall. 4th edition. Brooks/Cole. Boston, USA. 2012
Section : Chapter 6. Laplace transform. Section 6.3 page 600
Problem number : 29
Date solved : Thursday, March 13, 2025 at 05:18:19 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Using Laplace method With initial conditions

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

Maple. Time used: 10.185 (sec). Leaf size: 21
ode:=diff(diff(y(t),t),t)-4*diff(y(t),t)+5*y(t) = 2*exp(t); 
ic:=y(0) = 3, D(y)(0) = 1; 
dsolve([ode,ic],y(t),method='laplace');
 
\[ y = {\mathrm e}^{t}+\left (2 \cos \left (t \right )-4 \sin \left (t \right )\right ) {\mathrm e}^{2 t} \]
Mathematica. Time used: 0.019 (sec). Leaf size: 25
ode=D[y[t],{t,2}]-4*D[y[t],t]+5*y[t]==2*Exp[t]; 
ic={y[0]==3,Derivative[1][y][0] ==1}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to e^t \left (-4 e^t \sin (t)+2 e^t \cos (t)+1\right ) \]
Sympy. Time used: 0.216 (sec). Leaf size: 20
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(5*y(t) - 2*exp(t) - 4*Derivative(y(t), t) + Derivative(y(t), (t, 2)),0) 
ics = {y(0): 3, Subs(Derivative(y(t), t), t, 0): 1} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = \left (\left (- 4 \sin {\left (t \right )} + 2 \cos {\left (t \right )}\right ) e^{t} + 1\right ) e^{t} \]