14.20.9 problem 9

Internal problem ID [2706]
Book : Differential equations and their applications, 4th ed., M. Braun
Section : Chapter 2. Second order differential equations. Section 2.14, The method of elimination for systems. Excercises page 258
Problem number : 9
Date solved : Sunday, March 30, 2025 at 12:15:18 AM
CAS classification : system_of_ODEs

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

With initial conditions

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

Maple. Time used: 0.264 (sec). Leaf size: 33
ode:=[diff(x(t),t) = 4*x(t)+5*y(t)+4*exp(t)*cos(t), diff(y(t),t) = -2*x(t)-2*y(t)]; 
ic:=x(0) = 0y(0) = 0; 
dsolve([ode,ic]);
 
\begin{align*} x \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} \\ y \left (t \right ) &= -4 \sin \left (t \right ) {\mathrm e}^{t} t \\ \end{align*}
Mathematica. Time used: 0.032 (sec). Leaf size: 33
ode={D[x[t],t]==4*x[t]+5*y[t]+4*Exp[t]*Cos[t],D[y[t],t]==-2*x[t]-2*y[t]}; 
ic={x[0]==0,y[0]==0}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)\to 2 e^t (3 t \sin (t)+\sin (t)+t \cos (t)) \\ y(t)\to -4 e^t t \sin (t) \\ \end{align*}
Sympy. Time used: 0.164 (sec). Leaf size: 105
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(-4*x(t) - 5*y(t) - 4*exp(t)*cos(t) + Derivative(x(t), t),0),Eq(2*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 )} = 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 )}, \ y{\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 ] \]