75.31.8 problem 822

Internal problem ID [17196]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Chapter 3 (Systems of differential equations). Section 23.2 The method of undetermined coefficients. Exercises page 239
Problem number : 822
Date solved : Thursday, March 13, 2025 at 09:18:38 AM
CAS classification : system_of_ODEs

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

Maple. Time used: 0.079 (sec). Leaf size: 38
ode:=[diff(x(t),t)+diff(y(t),t)+y(t) = exp(-t), 2*diff(x(t),t)+diff(y(t),t)+2*y(t) = sin(t)]; 
dsolve(ode);
 
\begin{align*} x \left (t \right ) &= -\sin \left (t \right )-{\mathrm e}^{-t}-\cos \left (t \right )+c_{1} t +c_{2} \\ y \left (t \right ) &= \cos \left (t \right )-2 \,{\mathrm e}^{-t}-c_{1} \\ \end{align*}
Mathematica. Time used: 0.168 (sec). Leaf size: 97
ode={D[x[t],t]+D[y[t],t]+y[t]==Exp[-t],2*D[x[t],t]+D[y[t],t]+2*y[t]==Sin[t]}; 
ic={}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)\to \int _1^te^{-K[1]} \left (2 K[1]-e^{K[1]} (K[1]-1) \sin (K[1])-1\right )dK[1]-t \int _1^t\left (2 e^{-K[2]}-\sin (K[2])\right )dK[2]-c_2 t+c_1 \\ y(t)\to \int _1^t\left (2 e^{-K[2]}-\sin (K[2])\right )dK[2]+c_2 \\ \end{align*}
Sympy. Time used: 0.182 (sec). Leaf size: 32
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(y(t) + Derivative(x(t), t) + Derivative(y(t), t) - exp(-t),0),Eq(2*y(t) - sin(t) + 2*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} - C_{2} t - \sin {\left (t \right )} - \cos {\left (t \right )} - e^{- t}, \ y{\left (t \right )} = C_{2} + \cos {\left (t \right )} - 2 e^{- t}\right ] \]