85.92.7 problem 2 (a)

Internal problem ID [23056]
Book : Applied Differential Equations. By Murray R. Spiegel. 3rd edition. 1980. Pearson. ISBN 978-0130400970
Section : Chapter 11. Matrix eigenvalue methods for systems of linear differential equations. A Exercises at page 528
Problem number : 2 (a)
Date solved : Thursday, October 02, 2025 at 09:18:23 PM
CAS classification : system_of_ODEs

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

With initial conditions

\begin{align*} x \left (0\right )&=2 \\ y \left (0\right )&=-1 \\ \end{align*}
Maple. Time used: 0.065 (sec). Leaf size: 30
ode:=[diff(x(t),t)-y(t) = t, diff(y(t),t)+x(t) = t^2]; 
ic:=[x(0) = 2, y(0) = -1]; 
dsolve([ode,op(ic)]);
 
\begin{align*} x \left (t \right ) &= -\sin \left (t \right )+3 \cos \left (t \right )+t^{2}-1 \\ y \left (t \right ) &= -\cos \left (t \right )-3 \sin \left (t \right )+t \\ \end{align*}
Mathematica. Time used: 0.036 (sec). Leaf size: 31
ode={D[x[t],{t,1}]-y[t]==t, D[y[t],{t,1}]+x[t]==t^2}; 
ic={x[0]==2,y[0]==-1}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to t^2-\sin (t)+3 \cos (t)-1\\ y(t)&\to t-3 \sin (t)-\cos (t) \end{align*}
Sympy. Time used: 0.190 (sec). Leaf size: 61
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(-t - y(t) + Derivative(x(t), t),0),Eq(-t**2 + x(t) + Derivative(y(t), t),0)] 
ics = {x(0): 2, y(0): -1} 
dsolve(ode,func=[x(t),y(t)],ics=ics)
 
\[ \left [ x{\left (t \right )} = t^{2} \sin ^{2}{\left (t \right )} + t^{2} \cos ^{2}{\left (t \right )} - \sin ^{2}{\left (t \right )} - \sin {\left (t \right )} - \cos ^{2}{\left (t \right )} + 3 \cos {\left (t \right )}, \ y{\left (t \right )} = t \sin ^{2}{\left (t \right )} + t \cos ^{2}{\left (t \right )} - 3 \sin {\left (t \right )} - \cos {\left (t \right )}\right ] \]