28.4.11 problem 7.11

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

\begin{align*} \frac {d}{d t}x \left (t \right )-4 x \left (t \right )+3 y \left (t \right )&=\sin \left (t \right )\\ -2 x \left (t \right )+\frac {d}{d t}y \left (t \right )+y \left (t \right )&=-2 \cos \left (t \right ) \end{align*}

Maple. Time used: 0.263 (sec). Leaf size: 44
ode:=[diff(x(t),t)-4*x(t)+3*y(t) = sin(t), -2*x(t)+diff(y(t),t)+y(t) = -2*cos(t)]; 
dsolve(ode);
 
\begin{align*} x \left (t \right ) &= \cos \left (t \right )-2 \sin \left (t \right )+{\mathrm e}^{2 t} c_1 +{\mathrm e}^{t} c_2 \\ y \left (t \right ) &= -2 \sin \left (t \right )+2 \cos \left (t \right )+\frac {2 \,{\mathrm e}^{2 t} c_1}{3}+{\mathrm e}^{t} c_2 \\ \end{align*}
Mathematica. Time used: 0.274 (sec). Leaf size: 72
ode={D[x[t],t]-4*x[t]+3*y[t]==Sin[t],-2*x[t]+D[y[t],t]+y[t]==-2*Cos[t]}; 
ic={}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)\to -2 \sin (t)+\cos (t)+e^t \left (c_1 \left (3 e^t-2\right )-3 c_2 \left (e^t-1\right )\right ) \\ y(t)\to -2 \sin (t)+2 \cos (t)+e^t \left (2 c_1 \left (e^t-1\right )+c_2 \left (3-2 e^t\right )\right ) \\ \end{align*}
Sympy. Time used: 0.292 (sec). Leaf size: 49
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(-4*x(t) + 3*y(t) - sin(t) + Derivative(x(t), t),0),Eq(-2*x(t) + y(t) + 2*cos(t) + Derivative(y(t), t),0)] 
ics = {} 
dsolve(ode,func=[x(t),y(t)],ics=ics)
 
\[ \left [ x{\left (t \right )} = C_{1} e^{t} + \frac {3 C_{2} e^{2 t}}{2} - 2 \sin {\left (t \right )} + \cos {\left (t \right )}, \ y{\left (t \right )} = C_{1} e^{t} + C_{2} e^{2 t} - 2 \sin {\left (t \right )} + 2 \cos {\left (t \right )}\right ] \]