28.4.20 problem 7.20

Internal problem ID [4552]
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.20
Date solved : Sunday, March 30, 2025 at 03:26:07 AM
CAS classification : system_of_ODEs

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

With initial conditions

\begin{align*} x \left (0\right ) = 4\\ y \left (0\right ) = 0 \end{align*}

Maple. Time used: 0.177 (sec). Leaf size: 49
ode:=[diff(x(t),t)-x(t)-2*y(t) = 16*t*exp(t), 2*x(t)-diff(y(t),t)-2*y(t) = 0]; 
ic:=x(0) = 4y(0) = 0; 
dsolve([ode,ic]);
 
\begin{align*} x \left (t \right ) &= {\mathrm e}^{-3 t}+16 \,{\mathrm e}^{2 t}-12 t \,{\mathrm e}^{t}-13 \,{\mathrm e}^{t} \\ y \left (t \right ) &= -2 \,{\mathrm e}^{-3 t}+8 \,{\mathrm e}^{2 t}-8 t \,{\mathrm e}^{t}-6 \,{\mathrm e}^{t} \\ \end{align*}
Mathematica. Time used: 0.195 (sec). Leaf size: 56
ode={D[x[t],t]-x[t]-2*y[t]==16*t*Exp[t],2*x[t]-D[y[t],t]-2*y[t]==0}; 
ic={x[0]==4,y[0]==0}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)\to -e^t (12 t+13)+e^{-3 t}+16 e^{2 t} \\ y(t)\to -2 e^t (4 t+3)-2 e^{-3 t}+8 e^{2 t} \\ \end{align*}
Sympy. Time used: 0.184 (sec). Leaf size: 58
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(-16*t*exp(t) - x(t) - 2*y(t) + Derivative(x(t), t),0),Eq(2*x(t) - 2*y(t) - Derivative(y(t), t),0)] 
ics = {} 
dsolve(ode,func=[x(t),y(t)],ics=ics)
 
\[ \left [ x{\left (t \right )} = - \frac {C_{1} e^{- 3 t}}{2} + 2 C_{2} e^{2 t} - 12 t e^{t} - 13 e^{t}, \ y{\left (t \right )} = C_{1} e^{- 3 t} + C_{2} e^{2 t} - 8 t e^{t} - 6 e^{t}\right ] \]