64.16.5 problem 5

Internal problem ID [13537]
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 : 5
Date solved : Monday, March 31, 2025 at 08:00:43 AM
CAS classification : system_of_ODEs

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

Maple. Time used: 0.135 (sec). Leaf size: 47
ode:=[2*diff(x(t),t)+diff(y(t),t)-x(t)-y(t) = exp(-t), diff(x(t),t)+diff(y(t),t)+2*x(t)+y(t) = exp(t)]; 
dsolve(ode);
 
\begin{align*} x \left (t \right ) &= c_1 \sin \left (t \right )+c_2 \cos \left (t \right ) \\ y \left (t \right ) &= \frac {c_1 \cos \left (t \right )}{2}-\frac {3 c_2 \cos \left (t \right )}{2}-\frac {3 c_1 \sin \left (t \right )}{2}-\frac {c_2 \sin \left (t \right )}{2}+\frac {{\mathrm e}^{t}}{2}-\frac {{\mathrm e}^{-t}}{2} \\ \end{align*}
Mathematica. Time used: 0.179 (sec). Leaf size: 230
ode={2*D[x[t],t]+D[y[t],t]-x[t]-y[t]==Exp[-t],D[x[t],t]+D[y[t],t]+2*x[t]+y[t]==Exp[t]}; 
ic={}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)\to 2 \sin (t) \int _1^te^{-K[2]} \left (\left (-1+2 e^{2 K[2]}\right ) \cos (K[2])+\left (2+e^{2 K[2]}\right ) \sin (K[2])\right )dK[2]+(3 \sin (t)+\cos (t)) \int _1^te^{-K[1]} \left (-\left (\left (-1+e^{2 K[1]}\right ) \cos (K[1])\right )-\left (1+e^{2 K[1]}\right ) \sin (K[1])\right )dK[1]+2 c_2 \sin (t)+c_1 (3 \sin (t)+\cos (t)) \\ y(t)\to (\cos (t)-3 \sin (t)) \int _1^te^{-K[2]} \left (\left (-1+2 e^{2 K[2]}\right ) \cos (K[2])+\left (2+e^{2 K[2]}\right ) \sin (K[2])\right )dK[2]-5 \sin (t) \int _1^te^{-K[1]} \left (-\left (\left (-1+e^{2 K[1]}\right ) \cos (K[1])\right )-\left (1+e^{2 K[1]}\right ) \sin (K[1])\right )dK[1]-5 c_1 \sin (t)+c_2 (\cos (t)-3 \sin (t)) \\ \end{align*}
Sympy. Time used: 0.373 (sec). Leaf size: 78
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(-x(t) - y(t) + 2*Derivative(x(t), t) + Derivative(y(t), t) - exp(-t),0),Eq(2*x(t) + y(t) - exp(t) + Derivative(x(t), t) + Derivative(y(t), t),0)] 
ics = {} 
dsolve(ode,func=[x(t),y(t)],ics=ics)
 
\[ \left [ x{\left (t \right )} = \left (\frac {C_{1}}{5} + \frac {3 C_{2}}{5}\right ) \sin {\left (t \right )} - \left (\frac {3 C_{1}}{5} - \frac {C_{2}}{5}\right ) \cos {\left (t \right )}, \ y{\left (t \right )} = C_{1} \cos {\left (t \right )} - C_{2} \sin {\left (t \right )} + \frac {e^{t} \sin ^{2}{\left (t \right )}}{2} + \frac {e^{t} \cos ^{2}{\left (t \right )}}{2} - \frac {e^{- t} \sin ^{2}{\left (t \right )}}{2} - \frac {e^{- t} \cos ^{2}{\left (t \right )}}{2}\right ] \]