14.25.3 problem 1

Internal problem ID [2760]
Book : Differential equations and their applications, 4th ed., M. Braun
Section : Section 3.12, Systems of differential equations. The nonhomogeneous equation. variation of parameters. Page 366
Problem number : 1
Date solved : Tuesday, March 04, 2025 at 02:41:02 PM
CAS classification : system_of_ODEs

\begin{align*} \frac {d}{d t}x_{1} \left (t \right )&=4 x_{1} \left (t \right )+5 x_{2} \left (t \right )+4 \,{\mathrm e}^{t} \cos \left (t \right )\\ \frac {d}{d t}x_{2} \left (t \right )&=-2 x_{1} \left (t \right )-2 x_{2} \left (t \right ) \end{align*}

With initial conditions

\begin{align*} x_{1} \left (0\right ) = 0\\ x_{2} \left (0\right ) = 0 \end{align*}

Maple. Time used: 0.037 (sec). Leaf size: 33
ode:=[diff(x__1(t),t) = 4*x__1(t)+5*x__2(t)+4*exp(t)*cos(t), diff(x__2(t),t) = -2*x__1(t)-2*x__2(t)]; 
ic:=x__1(0) = 0x__2(0) = 0; 
dsolve([ode,ic]);
 
\begin{align*} x_{1} \left (t \right ) &= \frac {{\mathrm e}^{t} \left (12 \sin \left (t \right ) t +4 \cos \left (t \right ) t +4 \sin \left (t \right )\right )}{2} \\ x_{2} \left (t \right ) &= -4 \sin \left (t \right ) {\mathrm e}^{t} t \\ \end{align*}
Mathematica. Time used: 0.014 (sec). Leaf size: 33
ode={D[ x1[t],t]==4*x1[t]+5*x2[t]+4*Exp[t]*Cos[t],D[ x2[t],t]==-2*x1[t]-2*x2[t]}; 
ic={x1[0]==0,x2[0]==0}; 
DSolve[{ode,ic},{x1[t],x2[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} \text {x1}(t)\to 2 e^t (3 t \sin (t)+\sin (t)+t \cos (t)) \\ \text {x2}(t)\to -4 e^t t \sin (t) \\ \end{align*}
Sympy. Time used: 0.161 (sec). Leaf size: 105
from sympy import * 
t = symbols("t") 
x__1 = Function("x__1") 
x__2 = Function("x__2") 
ode=[Eq(-4*x__1(t) - 5*x__2(t) - 4*exp(t)*cos(t) + Derivative(x__1(t), t),0),Eq(2*x__1(t) + 2*x__2(t) + Derivative(x__2(t), t),0)] 
ics = {} 
dsolve(ode,func=[x__1(t),x__2(t)],ics=ics)
 
\[ \left [ x^{1}{\left (t \right )} = 6 t e^{t} \sin {\left (t \right )} + 2 t e^{t} \cos {\left (t \right )} + \left (\frac {C_{1}}{2} + \frac {3 C_{2}}{2}\right ) e^{t} \sin {\left (t \right )} - \left (\frac {3 C_{1}}{2} - \frac {C_{2}}{2}\right ) e^{t} \cos {\left (t \right )} + 2 e^{t} \sin ^{3}{\left (t \right )} + 2 e^{t} \sin {\left (t \right )} \cos ^{2}{\left (t \right )}, \ x^{2}{\left (t \right )} = C_{1} e^{t} \cos {\left (t \right )} - C_{2} e^{t} \sin {\left (t \right )} - 4 t e^{t} \sin {\left (t \right )}\right ] \]