72.12.2 problem 2

Internal problem ID [14770]
Book : DIFFERENTIAL EQUATIONS by Paul Blanchard, Robert L. Devaney, Glen R. Hall. 4th edition. Brooks/Cole. Boston, USA. 2012
Section : Chapter 3. Linear Systems. Exercises section 3.5 page 327
Problem number : 2
Date solved : Thursday, March 13, 2025 at 04:18:38 AM
CAS classification : system_of_ODEs

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

With initial conditions

\begin{align*} x \left (0\right ) = 1\\ y \left (0\right ) = 0 \end{align*}

Maple. Time used: 0.042 (sec). Leaf size: 105
ode:=[diff(x(t),t) = 2*x(t)+y(t), diff(y(t),t) = -x(t)-2*y(t)]; 
ic:=x(0) = 1y(0) = 0; 
dsolve([ode,ic]);
 
\begin{align*} x \left (t \right ) &= \left (\frac {1}{2}+\frac {\sqrt {3}}{3}\right ) {\mathrm e}^{\sqrt {3}\, t}+\left (\frac {1}{2}-\frac {\sqrt {3}}{3}\right ) {\mathrm e}^{-\sqrt {3}\, t} \\ y &= \left (\frac {1}{2}+\frac {\sqrt {3}}{3}\right ) \sqrt {3}\, {\mathrm e}^{\sqrt {3}\, t}-\left (\frac {1}{2}-\frac {\sqrt {3}}{3}\right ) \sqrt {3}\, {\mathrm e}^{-\sqrt {3}\, t}-2 \left (\frac {1}{2}+\frac {\sqrt {3}}{3}\right ) {\mathrm e}^{\sqrt {3}\, t}-2 \left (\frac {1}{2}-\frac {\sqrt {3}}{3}\right ) {\mathrm e}^{-\sqrt {3}\, t} \\ \end{align*}
Mathematica. Time used: 0.008 (sec). Leaf size: 82
ode={D[x[t],t]==2*x[t]+1*y[t],D[y[t],t]==-1*x[t]-2*y[t]}; 
ic={x[0]==1,y[0]==0}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)\to \frac {1}{6} e^{-\sqrt {3} t} \left (\left (3+2 \sqrt {3}\right ) e^{2 \sqrt {3} t}+3-2 \sqrt {3}\right ) \\ y(t)\to -\frac {e^{-\sqrt {3} t} \left (e^{2 \sqrt {3} t}-1\right )}{2 \sqrt {3}} \\ \end{align*}
Sympy. Time used: 0.168 (sec). Leaf size: 60
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(-2*x(t) - y(t) + Derivative(x(t), t),0),Eq(x(t) + 2*y(t) + Derivative(y(t), t),0)] 
ics = {} 
dsolve(ode,func=[x(t),y(t)],ics=ics)
 
\[ \left [ x{\left (t \right )} = - C_{1} \left (\sqrt {3} + 2\right ) e^{\sqrt {3} t} - C_{2} \left (2 - \sqrt {3}\right ) e^{- \sqrt {3} t}, \ y{\left (t \right )} = C_{1} e^{\sqrt {3} t} + C_{2} e^{- \sqrt {3} t}\right ] \]