15.17.4 problem 4

Internal problem ID [3240]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 26, page 115
Problem number : 4
Date solved : Sunday, March 30, 2025 at 01:23:36 AM
CAS classification : system_of_ODEs

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

Maple. Time used: 0.261 (sec). Leaf size: 41
ode:=[diff(x(t),t)-x(t)+y(t) = 2*sin(t), diff(x(t),t)+diff(y(t),t) = 3*y(t)-3*x(t)]; 
dsolve(ode);
 
\begin{align*} x \left (t \right ) &= -\frac {{\mathrm e}^{5 t} c_1}{20}-\frac {16 \cos \left (t \right )}{13}-\frac {2 \sin \left (t \right )}{13}+c_2 \\ y \left (t \right ) &= \frac {{\mathrm e}^{5 t} c_1}{5}+\frac {8 \sin \left (t \right )}{13}-\frac {14 \cos \left (t \right )}{13}+c_2 \\ \end{align*}
Mathematica. Time used: 0.004 (sec). Leaf size: 80
ode={D[x[t],t]-x[t]+y[t]==2*Sin[t],D[x[t],t]+D[y[t],t]==3*y[t]-3*x[t]}; 
ic={}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)\to \frac {1}{65} \left (-10 \sin (t)-80 \cos (t)+13 c_1 \left (e^{5 t}+4\right )-13 c_2 \left (e^{5 t}-1\right )\right ) \\ y(t)\to \frac {1}{65} \left (40 \sin (t)-70 \cos (t)-52 c_1 \left (e^{5 t}-1\right )+13 c_2 \left (4 e^{5 t}+1\right )\right ) \\ \end{align*}
Sympy. Time used: 0.258 (sec). Leaf size: 49
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(-x(t) + y(t) - 2*sin(t) + Derivative(x(t), t),0),Eq(3*x(t) - 3*y(t) + Derivative(x(t), t) + Derivative(y(t), t),0)] 
ics = {} 
dsolve(ode,func=[x(t),y(t)],ics=ics)
 
\[ \left [ x{\left (t \right )} = C_{1} - \frac {C_{2} e^{5 t}}{4} - \frac {2 \sin {\left (t \right )}}{13} - \frac {16 \cos {\left (t \right )}}{13}, \ y{\left (t \right )} = C_{1} + C_{2} e^{5 t} + \frac {8 \sin {\left (t \right )}}{13} - \frac {14 \cos {\left (t \right )}}{13}\right ] \]