57.2.3 problem 3

Internal problem ID [9057]
Book : First order enumerated odes
Section : section 2 (system of first order odes)
Problem number : 3
Date solved : Sunday, March 30, 2025 at 02:05:52 PM
CAS classification : system_of_ODEs

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

Maple. Time used: 0.258 (sec). Leaf size: 44
ode:=[diff(x(t),t)+diff(y(t),t)-x(t) = y(t)+t+sin(t)+cos(t), diff(x(t),t)+diff(y(t),t) = 2*x(t)+3*y(t)+exp(t)]; 
dsolve(ode);
 
\begin{align*} x \left (t \right ) &= -\sin \left (t \right )-3 \cos \left (t \right )+{\mathrm e}^{t} c_1 -3 t -2 \\ y \left (t \right ) &= \sin \left (t \right )+2 \cos \left (t \right )-\frac {{\mathrm e}^{t} c_1}{2}+2 t +1-\frac {{\mathrm e}^{t}}{2} \\ \end{align*}
Mathematica. Time used: 0.039 (sec). Leaf size: 54
ode={D[x[t],t]+D[y[t],t]-x[t]==y[t]+t+Sin[t]+Cos[t],D[x[t],t]+D[y[t],t]==2*x[t]+3*y[t]+Exp[t]}; 
ic={}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)\to -3 t+e^t-\sin (t)-3 \cos (t)+2 c_1 e^t-2 \\ y(t)\to 2 t-e^t+\sin (t)+2 \cos (t)-c_1 e^t+1 \\ \end{align*}
Sympy
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(-t - x(t) - y(t) - sin(t) - cos(t) + Derivative(x(t), t) + Derivative(y(t), t),0),Eq(-2*x(t) - 3*y(t) - exp(t) + Derivative(x(t), t) + Derivative(y(t), t),0)] 
ics = {} 
dsolve(ode,func=[x(t),y(t)],ics=ics)