58.16.2 problem 2

Internal problem ID [14886]
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 : Thursday, October 02, 2025 at 09:56:13 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.041 (sec). Leaf size: 42
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 -2-\frac {1}{4} c_1 e^{-t}\\ y(t)&\to -t^2-2 t+\frac {c_1 e^{-t}}{2}+4 \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)