28.4.40 problem 7.40

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

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

Maple. Time used: 0.185 (sec). Leaf size: 46
ode:=[diff(x__1(t),t) = -x__1(t)+8*x__2(t)+9*t, diff(x__2(t),t) = x__1(t)+x__2(t)+3*exp(-t)]; 
dsolve(ode);
 
\begin{align*} x_{1} \left (t \right ) &= {\mathrm e}^{-3 t} c_2 +{\mathrm e}^{3 t} c_1 -3 \,{\mathrm e}^{-t}+t -1 \\ x_{2} \left (t \right ) &= -\frac {{\mathrm e}^{-3 t} c_2}{4}+\frac {{\mathrm e}^{3 t} c_1}{2}-t \\ \end{align*}
Mathematica. Time used: 1.244 (sec). Leaf size: 89
ode={D[x1[t],t]==-x1[t]+8*x2[t]+9*t,D[x2[t],t]==x1[t]+x2[t]+3*Exp[-t]}; 
ic={}; 
DSolve[{ode,ic},{x1[t],x2[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} \text {x1}(t)\to t-3 e^{-t}+\frac {2}{3} (c_1-2 c_2) e^{-3 t}+\frac {1}{3} (c_1+4 c_2) e^{3 t}-1 \\ \text {x2}(t)\to \frac {1}{6} e^{-3 t} \left (-6 e^{3 t} t+(c_1+4 c_2) e^{6 t}-c_1+2 c_2\right ) \\ \end{align*}
Sympy. Time used: 0.220 (sec). Leaf size: 44
from sympy import * 
t = symbols("t") 
x__1 = Function("x__1") 
x__2 = Function("x__2") 
ode=[Eq(-9*t + x__1(t) - 8*x__2(t) + Derivative(x__1(t), t),0),Eq(-x__1(t) - x__2(t) + Derivative(x__2(t), t) - 3*exp(-t),0)] 
ics = {} 
dsolve(ode,func=[x__1(t),x__2(t)],ics=ics)
 
\[ \left [ x^{1}{\left (t \right )} = - 4 C_{1} e^{- 3 t} + 2 C_{2} e^{3 t} + t - 1 - 3 e^{- t}, \ x^{2}{\left (t \right )} = C_{1} e^{- 3 t} + C_{2} e^{3 t} - t\right ] \]