78.27.3 problem 6 (c)

Internal problem ID [18397]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 10. Systems of First Order Equations. Section 55. Linear systems. Problems at page 496
Problem number : 6 (c)
Date solved : Monday, March 31, 2025 at 05:27:20 PM
CAS classification : system_of_ODEs

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

Maple. Time used: 0.132 (sec). Leaf size: 43
ode:=[diff(x(t),t) = x(t)+2*y(t)+t-1, diff(y(t),t) = 3*x(t)+2*y(t)-5*t-2]; 
dsolve(ode);
 
\begin{align*} x \left (t \right ) &= {\mathrm e}^{4 t} c_2 +{\mathrm e}^{-t} c_1 +3 t -2 \\ y \left (t \right ) &= \frac {3 \,{\mathrm e}^{4 t} c_2}{2}-{\mathrm e}^{-t} c_1 +3-2 t \\ \end{align*}
Mathematica. Time used: 0.218 (sec). Leaf size: 88
ode={D[x[t],t]==x[t]+2*y[t]+t-1,D[y[t],t]==3*x[t]+2*y[t]-5*t-2}; 
ic={}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)\to \frac {1}{5} e^{-t} \left (5 e^t (3 t-2)+2 (c_1+c_2) e^{5 t}+3 c_1-2 c_2\right ) \\ y(t)\to \frac {1}{5} e^{-t} \left (-5 e^t (2 t-3)+3 (c_1+c_2) e^{5 t}-3 c_1+2 c_2\right ) \\ \end{align*}
Sympy. Time used: 0.190 (sec). Leaf size: 41
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(-t - x(t) - 2*y(t) + Derivative(x(t), t) + 1,0),Eq(5*t - 3*x(t) - 2*y(t) + Derivative(y(t), t) + 2,0)] 
ics = {} 
dsolve(ode,func=[x(t),y(t)],ics=ics)
 
\[ \left [ x{\left (t \right )} = - C_{1} e^{- t} + \frac {2 C_{2} e^{4 t}}{3} + 3 t - 2, \ y{\left (t \right )} = C_{1} e^{- t} + C_{2} e^{4 t} - 2 t + 3\right ] \]