28.4.9 problem 7.9

Internal problem ID [4541]
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.9
Date solved : Sunday, March 30, 2025 at 03:25:49 AM
CAS classification : system_of_ODEs

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

Maple. Time used: 0.170 (sec). Leaf size: 51
ode:=[diff(x(t),t) = 2*x(t)-3*y(t)+t*exp(-t), diff(y(t),t) = 2*x(t)-3*y(t)+exp(-t)]; 
dsolve(ode);
 
\begin{align*} x \left (t \right ) &= -{\mathrm e}^{-t} t^{2}-{\mathrm e}^{-t} c_1 +c_2 \\ y \left (t \right ) &= t \,{\mathrm e}^{-t}-{\mathrm e}^{-t} t^{2}-{\mathrm e}^{-t} c_1 +\frac {2 c_2}{3} \\ \end{align*}
Mathematica. Time used: 0.025 (sec). Leaf size: 71
ode={D[x[t],t]==2*x[t]-3*y[t]+t*Exp[-t],D[y[t],t]==2*x[t]-3*y[t]+Exp[-t]}; 
ic={}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)\to e^{-t} \left (-t^2+c_1 \left (3 e^t-2\right )-3 c_2 \left (e^t-1\right )\right ) \\ y(t)\to e^{-t} \left (-t^2+t+2 c_1 \left (e^t-1\right )+c_2 \left (3-2 e^t\right )\right ) \\ \end{align*}
Sympy. Time used: 0.143 (sec). Leaf size: 39
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(-t*exp(-t) - 2*x(t) + 3*y(t) + Derivative(x(t), t),0),Eq(-2*x(t) + 3*y(t) + Derivative(y(t), t) - exp(-t),0)] 
ics = {} 
dsolve(ode,func=[x(t),y(t)],ics=ics)
 
\[ \left [ x{\left (t \right )} = \frac {3 C_{1}}{2} + C_{2} e^{- t} - t^{2} e^{- t}, \ y{\left (t \right )} = C_{1} + C_{2} e^{- t} - t^{2} e^{- t} + t e^{- t}\right ] \]