28.4.17 problem 7.17

Internal problem ID [4549]
Book : Differential equations for engineers by Wei-Chau XIE, Cambridge Press 2010
Section : Chapter 7. Systems of linear differential equations. Problems at page 351
Problem number : 7.17
Date solved : Tuesday, March 04, 2025 at 06:52:15 PM
CAS classification : system_of_ODEs

\begin{align*} \frac {d}{d t}x \left (t \right )-2 x \left (t \right )+y \left (t \right )&=0\\ x \left (t \right )+\frac {d}{d t}y \left (t \right )-2 y \left (t \right )&=-5 \,{\mathrm e}^{t} \sin \left (t \right ) \end{align*}

Maple. Time used: 0.059 (sec). Leaf size: 53
ode:=[diff(x(t),t)-2*x(t)+y(t) = 0, x(t)+diff(y(t),t)-2*y(t) = -5*exp(t)*sin(t)]; 
dsolve(ode);
 
\begin{align*} x &= 2 \,{\mathrm e}^{t} \cos \left (t \right )+c_{1} {\mathrm e}^{3 t}-\sin \left (t \right ) {\mathrm e}^{t}+c_{2} {\mathrm e}^{t} \\ y &= 3 \,{\mathrm e}^{t} \cos \left (t \right )-c_{1} {\mathrm e}^{3 t}+\sin \left (t \right ) {\mathrm e}^{t}+c_{2} {\mathrm e}^{t} \\ \end{align*}
Mathematica. Time used: 0.111 (sec). Leaf size: 82
ode={D[x[t],t]-2*x[t]+y[t]==0,x[t]+D[y[t],t]-2*y[t]==-5*Exp[t]*Sin[t]}; 
ic={}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)\to \frac {1}{2} e^t \left (-2 \sin (t)+4 \cos (t)+c_1 e^{2 t}-c_2 e^{2 t}+c_1+c_2\right ) \\ y(t)\to \frac {1}{2} e^t \left (2 \sin (t)+6 \cos (t)+c_1 \left (-e^{2 t}\right )+c_2 e^{2 t}+c_1+c_2\right ) \\ \end{align*}
Sympy. Time used: 0.290 (sec). Leaf size: 58
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(-2*x(t) + y(t) + Derivative(x(t), t),0),Eq(x(t) - 2*y(t) + 5*exp(t)*sin(t) + Derivative(y(t), t),0)] 
ics = {} 
dsolve(ode,func=[x(t),y(t)],ics=ics)
 
\[ \left [ x{\left (t \right )} = - C_{1} e^{3 t} + C_{2} e^{t} - e^{t} \sin {\left (t \right )} + 2 e^{t} \cos {\left (t \right )}, \ y{\left (t \right )} = C_{1} e^{3 t} + C_{2} e^{t} + e^{t} \sin {\left (t \right )} + 3 e^{t} \cos {\left (t \right )}\right ] \]