64.16.2 problem 2

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

Maple. Time used: 0.126 (sec). Leaf size: 32
ode:=[diff(x(t),t)+diff(y(t),t)-x(t) = -2*t, diff(x(t),t)+diff(y(t),t)-3*x(t)-y(t) = t^2]; 
dsolve(ode);
 
\begin{align*} x \left (t \right ) &= -2+{\mathrm e}^{-t} c_1 \\ y \left (t \right ) &= -t^{2}+4-2 \,{\mathrm e}^{-t} c_1 -2 t \\ \end{align*}
Mathematica. Time used: 0.074 (sec). Leaf size: 98
ode={D[x[t],t]+D[y[t],t]-x[t]==-2*t,D[x[t],t]+D[y[t],t]-3*x[t]-y[t]==t^2}; 
ic={}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)\to -\frac {1}{4} \int _1^t-4 e^{K[1]-t} K[1] (K[1]+4)dK[1]-t^2-2 t-\frac {c_1 e^{-t}}{4} \\ y(t)\to \frac {1}{2} \left (\int _1^t-4 e^{K[1]-t} K[1] (K[1]+4)dK[1]+c_1 e^{-t}\right )+t^2+2 t \\ \end{align*}
Sympy
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(2*t - x(t) + Derivative(x(t), t) + Derivative(y(t), t),0),Eq(-t**2 - 3*x(t) - y(t) + Derivative(x(t), t) + Derivative(y(t), t),0)] 
ics = {} 
dsolve(ode,func=[x(t),y(t)],ics=ics)