64.16.9 problem 9

Internal problem ID [13533]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 7, Systems of linear differential equations. Section 7.1. Exercises page 277
Problem number : 9
Date solved : Wednesday, March 05, 2025 at 10:03:20 PM
CAS classification : system_of_ODEs

\begin{align*} \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 )\\ \frac {d}{d t}x \left (t \right )+\frac {d}{d t}y \left (t \right )-x \left (t \right )-y \left (t \right )&=0 \end{align*}

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