28.4.23 problem 7.23

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

With initial conditions

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

Maple. Time used: 0.059 (sec). Leaf size: 87
ode:=[diff(x(t),t)-2*x(t)-y(t) = 2*exp(t), x(t)-diff(y(t),t)+2*y(t) = 3*exp(4*t)]; 
ic:=x(0) = x__0y(0) = y__0; 
dsolve([ode,ic]);
 
\begin{align*} x &= \left (-\frac {3}{2}+\frac {x_{0}}{2}-\frac {y_{0}}{2}\right ) {\mathrm e}^{t}+\left (2+\frac {x_{0}}{2}+\frac {y_{0}}{2}\right ) {\mathrm e}^{3 t}-{\mathrm e}^{4 t}+t \,{\mathrm e}^{t}+\frac {{\mathrm e}^{t}}{2} \\ y &= -\left (-\frac {3}{2}+\frac {x_{0}}{2}-\frac {y_{0}}{2}\right ) {\mathrm e}^{t}+\left (2+\frac {x_{0}}{2}+\frac {y_{0}}{2}\right ) {\mathrm e}^{3 t}-2 \,{\mathrm e}^{4 t}-\frac {3 \,{\mathrm e}^{t}}{2}-t \,{\mathrm e}^{t} \\ \end{align*}
Mathematica. Time used: 0.097 (sec). Leaf size: 73
ode={D[x[t],t]-2*x[t]-y[t]==2*Exp[t],x[t]-D[y[t],t]+2*y[t]==3*Exp[4*t]}; 
ic={x[0]==x0,y[0]==y0}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)\to \frac {1}{2} e^t \left (e^{2 t} (\text {x0}+\text {y0}+4)+2 t-2 e^{3 t}+\text {x0}-\text {y0}-2\right ) \\ y(t)\to \frac {1}{2} e^t \left (e^{2 t} (\text {x0}+\text {y0}+4)-2 t-4 e^{3 t}-\text {x0}+\text {y0}\right ) \\ \end{align*}
Sympy. Time used: 0.171 (sec). Leaf size: 56
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(-2*x(t) - y(t) - 2*exp(t) + Derivative(x(t), t),0),Eq(x(t) + 2*y(t) - 3*exp(4*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} + t e^{t} - \left (C_{2} + \frac {1}{2}\right ) e^{t} - e^{4 t}, \ y{\left (t \right )} = C_{1} e^{3 t} - t e^{t} + \left (C_{2} - \frac {1}{2}\right ) e^{t} - 2 e^{4 t}\right ] \]