64.16.3 problem 3

Internal problem ID [13535]
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 : 3
Date solved : Monday, March 31, 2025 at 08:00:40 AM
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 )-3 y \left (t \right )&={\mathrm e}^{t}\\ \frac {d}{d t}x \left (t \right )+\frac {d}{d t}y \left (t \right )+x \left (t \right )&={\mathrm e}^{3 t} \end{align*}

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