57.23.1 problem 3

Internal problem ID [14522]
Book : A First Course in Differential Equations by J. David Logan. Third Edition. Springer-Verlag, NY. 2015.
Section : Chapter 4, Linear Systems. Exercises page 244
Problem number : 3
Date solved : Thursday, October 02, 2025 at 09:38:07 AM
CAS classification : system_of_ODEs

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

With initial conditions

\begin{align*} x \left (0\right )&=1 \\ y \left (0\right )&=2 \\ \end{align*}
Maple. Time used: 0.135 (sec). Leaf size: 31
ode:=[diff(x(t),t) = 3*x(t)-y(t)+1, diff(y(t),t) = x(t)+y(t)+2]; 
ic:=[x(0) = 1, y(0) = 2]; 
dsolve([ode,op(ic)]);
 
\begin{align*} x \left (t \right ) &= -\frac {3}{4}+{\mathrm e}^{2 t} \left (-\frac {3 t}{2}+\frac {7}{4}\right ) \\ y \left (t \right ) &= -\frac {5}{4}+{\mathrm e}^{2 t} \left (-\frac {3 t}{2}+\frac {13}{4}\right ) \\ \end{align*}
Mathematica. Time used: 0.029 (sec). Leaf size: 42
ode={D[x[t],t]==3*x[t]-y[t]+1,D[y[t],t]==x[t]+y[t]+2}; 
ic={x[0]==1,y[0]==2}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to \frac {1}{4} \left (e^{2 t} (7-6 t)-3\right )\\ y(t)&\to \frac {1}{4} \left (e^{2 t} (13-6 t)-5\right ) \end{align*}
Sympy. Time used: 0.102 (sec). Leaf size: 42
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(-3*x(t) + y(t) + Derivative(x(t), t) - 1,0),Eq(-x(t) - 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} t e^{2 t} + \left (C_{1} + C_{2}\right ) e^{2 t} - \frac {3}{4}, \ y{\left (t \right )} = C_{1} t e^{2 t} + C_{2} e^{2 t} - \frac {5}{4}\right ] \]