28.4.25 problem 7.25

Internal problem ID [4557]
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.25
Date solved : Tuesday, March 04, 2025 at 06:52:22 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 )&=2 \,{\mathrm e}^{t}\\ \frac {d}{d t}y \left (t \right )-2 y \left (t \right )-4 z \left (t \right )&=4 \,{\mathrm e}^{2 t}\\ x \left (t \right )-\frac {d}{d t}z \left (t \right )-z \left (t \right )&=0 \end{align*}

With initial conditions

\begin{align*} x \left (0\right ) = 9\\ y \left (0\right ) = 3\\ z \left (0\right ) = 1 \end{align*}

Maple. Time used: 0.089 (sec). Leaf size: 65
ode:=[diff(x(t),t)-2*x(t)-y(t) = 2*exp(t), diff(y(t),t)-2*y(t)-4*z(t) = 4*exp(2*t), x(t)-diff(z(t),t)-z(t) = 0]; 
ic:=x(0) = 9y(0) = 3z(0) = 1; 
dsolve([ode,ic]);
 
\begin{align*} x &= 8 \,{\mathrm e}^{3 t}+2 \,{\mathrm e}^{t}-3 \,{\mathrm e}^{2 t}+2+3 t \\ y &= 8 \,{\mathrm e}^{3 t}-4 \,{\mathrm e}^{t}-1-6 t \\ z &= 2 \,{\mathrm e}^{3 t}+{\mathrm e}^{t}-{\mathrm e}^{2 t}+3 t -1 \\ \end{align*}
Mathematica. Time used: 1.024 (sec). Leaf size: 74
ode={D[x[t],t]-2*x[t]-y[t]==2*Exp[t],D[y[t],t]-2*y[t]-4*z[t]==4*Exp[2*t],x[t]-D[z[t],t]-z[t]==0}; 
ic={x[0]==9,y[0]==3,z[0]== 1}; 
DSolve[{ode,ic},{x[t],y[t],z[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)\to 3 t+2 e^t-3 e^{2 t}+8 e^{3 t}+2 \\ y(t)\to -6 t-4 e^t+8 e^{3 t}-1 \\ z(t)\to 3 t+e^t-e^{2 t}+2 e^{3 t}-1 \\ \end{align*}
Sympy. Time used: 0.289 (sec). Leaf size: 76
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
z = Function("z") 
ode=[Eq(-2*x(t) - y(t) - 2*exp(t) + Derivative(x(t), t),0),Eq(-2*y(t) - 4*z(t) - 4*exp(2*t) + Derivative(y(t), t),0),Eq(x(t) - z(t) - Derivative(z(t), t),0)] 
ics = {} 
dsolve(ode,func=[x(t),y(t),z(t)],ics=ics)
 
\[ \left [ x{\left (t \right )} = - C_{1} - C_{2} t - C_{2} + 4 C_{3} e^{3 t} - 3 e^{2 t} + 2 e^{t}, \ y{\left (t \right )} = 2 C_{1} + 2 C_{2} t + C_{2} + 4 C_{3} e^{3 t} - 4 e^{t}, \ z{\left (t \right )} = - C_{1} - C_{2} t + C_{3} e^{3 t} - e^{2 t} + e^{t}\right ] \]