80.8.2 problem 2

Internal problem ID [21359]
Book : A Textbook on Ordinary Differential Equations by Shair Ahmad and Antonio Ambrosetti. Second edition. ISBN 978-3-319-16407-6. Springer 2015
Section : Chapter 8. Qualitative analysis of 2 by 2 systems and nonlinear second order equations. Excercise 8.5 at page 184
Problem number : 2
Date solved : Thursday, October 02, 2025 at 07:28:45 PM
CAS classification : system_of_ODEs

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