7.23.7 problem 7

Internal problem ID [593]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 5. Linear systems of differential equations. Section 5.2 (Applications). Problems at page 345
Problem number : 7
Date solved : Tuesday, March 04, 2025 at 11:27:23 AM
CAS classification : system_of_ODEs

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

Maple. Time used: 0.021 (sec). Leaf size: 43
ode:=[diff(x(t),t) = 4*x(t)+y(t)+2*t, diff(y(t),t) = -2*x(t)+y(t)]; 
dsolve(ode);
 
\begin{align*} x \left (t \right ) &= c_2 \,{\mathrm e}^{2 t}+c_1 \,{\mathrm e}^{3 t}-\frac {t}{3}+\frac {1}{18} \\ y \left (t \right ) &= -2 c_2 \,{\mathrm e}^{2 t}-c_1 \,{\mathrm e}^{3 t}-\frac {5}{9}-\frac {2 t}{3} \\ \end{align*}
Mathematica. Time used: 0.102 (sec). Leaf size: 77
ode={D[x[t],t]==4*x[t]+y[t]+2*t,D[y[t],t]==-2*x[t]+y[t]}; 
ic={}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)\to -\frac {t}{3}-(c_1+c_2) e^{2 t}+(2 c_1+c_2) e^{3 t}+\frac {1}{18} \\ y(t)\to -\frac {2 t}{3}+2 (c_1+c_2) e^{2 t}-(2 c_1+c_2) e^{3 t}-\frac {5}{9} \\ \end{align*}
Sympy. Time used: 0.173 (sec). Leaf size: 48
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(-2*t - 4*x(t) - y(t) + Derivative(x(t), t),0),Eq(2*x(t) - y(t) + Derivative(y(t), t),0)] 
ics = {} 
dsolve(ode,func=[x(t),y(t)],ics=ics)
 
\[ \left [ x{\left (t \right )} = - \frac {C_{1} e^{2 t}}{2} - C_{2} e^{3 t} - \frac {t}{3} + \frac {1}{18}, \ y{\left (t \right )} = C_{1} e^{2 t} + C_{2} e^{3 t} - \frac {2 t}{3} - \frac {5}{9}\right ] \]