76.19.23 problem 23

Internal problem ID [17668]
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.4 (Solving differential equations with Laplace transform). Problems at page 327
Problem number : 23
Date solved : Thursday, March 13, 2025 at 10:46:14 AM
CAS classification : system_of_ODEs

\begin{align*} \frac {d}{d t}y_{1} \left (t \right )&=-2 y_{1} \left (t \right )+y_{2} \left (t \right )\\ \frac {d}{d t}y_{2} \left (t \right )&=y_{1} \left (t \right )-2 y_{2} \left (t \right )+\sin \left (t \right ) \end{align*}

With initial conditions

\begin{align*} y_{1} \left (0\right ) = 0\\ y_{2} \left (0\right ) = 0 \end{align*}

Maple. Time used: 0.097 (sec). Leaf size: 49
ode:=[diff(y__1(t),t) = -2*y__1(t)+y__2(t), diff(y__2(t),t) = y__1(t)-2*y__2(t)+sin(t)]; 
ic:=y__1(0) = 0y__2(0) = 0; 
dsolve([ode,ic]);
 
\begin{align*} y_{1} \left (t \right ) &= -\frac {{\mathrm e}^{-3 t}}{20}+\frac {{\mathrm e}^{-t}}{4}-\frac {\cos \left (t \right )}{5}+\frac {\sin \left (t \right )}{10} \\ y_{2} \left (t \right ) &= \frac {{\mathrm e}^{-3 t}}{20}+\frac {{\mathrm e}^{-t}}{4}+\frac {2 \sin \left (t \right )}{5}-\frac {3 \cos \left (t \right )}{10} \\ \end{align*}
Mathematica. Time used: 0.096 (sec). Leaf size: 60
ode={D[y1[t],t]==-2*y1[t]+1*y2[t]+0,D[y2[t],t]==1*y1[t]-2*y2[t]+Sin[t]}; 
ic={y1[0]==0,y2[0]==0}; 
DSolve[{ode,ic},{y1[t],y2[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} \text {y1}(t)\to \frac {1}{20} \left (-e^{-3 t}+5 e^{-t}+2 \sin (t)-4 \cos (t)\right ) \\ \text {y2}(t)\to \frac {1}{20} \left (e^{-3 t}+5 e^{-t}+8 \sin (t)-6 \cos (t)\right ) \\ \end{align*}
Sympy. Time used: 0.216 (sec). Leaf size: 51
from sympy import * 
t = symbols("t") 
y__1 = Function("y__1") 
y__2 = Function("y__2") 
ode=[Eq(2*y__1(t) - y__2(t) + Derivative(y__1(t), t),0),Eq(-y__1(t) + 2*y__2(t) - sin(t) + Derivative(y__2(t), t),0)] 
ics = {} 
dsolve(ode,func=[y__1(t),y__2(t)],ics=ics)
 
\[ \left [ y^{1}{\left (t \right )} = C_{1} e^{- t} - C_{2} e^{- 3 t} + \frac {\sin {\left (t \right )}}{10} - \frac {\cos {\left (t \right )}}{5}, \ y^{2}{\left (t \right )} = C_{1} e^{- t} + C_{2} e^{- 3 t} + \frac {2 \sin {\left (t \right )}}{5} - \frac {3 \cos {\left (t \right )}}{10}\right ] \]