63.23.1 problem 3

Internal problem ID [13162]
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 : Wednesday, March 05, 2025 at 09:18:31 PM
CAS classification : system_of_ODEs

\begin{align*} \frac {d}{d t}x \left (t \right )&=3 x \left (t \right )-y \left (t \right )+1\\ \frac {d}{d t}y \left (t \right )&=x \left (t \right )+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.041 (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) = 1y(0) = 2; 
dsolve([ode,ic]);
 
\begin{align*} x \left (t \right ) &= -\frac {3}{4}+{\mathrm e}^{2 t} \left (-\frac {3 t}{2}+\frac {7}{4}\right ) \\ y &= -\frac {5}{4}+{\mathrm e}^{2 t} \left (-\frac {3 t}{2}+\frac {13}{4}\right ) \\ \end{align*}
Mathematica. Time used: 0.061 (sec). Leaf size: 234
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 -e^{2 t} \left (t \left (-\int _1^0e^{-2 K[2]} (K[2]+2)dK[2]\right )+t \int _1^te^{-2 K[2]} (K[2]+2)dK[2]+(t+1) \int _1^0e^{-2 K[1]} (K[1]+1)dK[1]-(t+1) \int _1^te^{-2 K[1]} (K[1]+1)dK[1]+t-1\right ) \\ y(t)\to -e^{2 t} \left (t \int _1^0e^{-2 K[1]} (K[1]+1)dK[1]-t \int _1^te^{-2 K[1]} (K[1]+1)dK[1]-t \int _1^0e^{-2 K[2]} (K[2]+2)dK[2]+t \int _1^te^{-2 K[2]} (K[2]+2)dK[2]-\int _1^te^{-2 K[2]} (K[2]+2)dK[2]+\int _1^0e^{-2 K[2]} (K[2]+2)dK[2]+t-2\right ) \\ \end{align*}
Sympy. Time used: 0.175 (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 ] \]