20.18.10 problem 11

Internal problem ID [3880]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 9, First order linear systems. Section 9.6 (Variation of parameters for linear systems), page 624
Problem number : 11
Date solved : Tuesday, March 04, 2025 at 05:18:34 PM
CAS classification : system_of_ODEs

\begin{align*} \frac {d}{d t}x_{1} \left (t \right )&=2 x_{1} \left (t \right )-3 x_{2} \left (t \right )+34 \sin \left (t \right )\\ \frac {d}{d t}x_{2} \left (t \right )&=-4 x_{1} \left (t \right )-2 x_{2} \left (t \right )+17 \cos \left (t \right ) \end{align*}

Maple. Time used: 0.163 (sec). Leaf size: 49
ode:=[diff(x__1(t),t) = 2*x__1(t)-3*x__2(t)+34*sin(t), diff(x__2(t),t) = -4*x__1(t)-2*x__2(t)+17*cos(t)]; 
dsolve(ode);
 
\begin{align*} x_{1} \left (t \right ) &= c_{2} {\mathrm e}^{4 t}+{\mathrm e}^{-4 t} c_{1} +\cos \left (t \right )-4 \sin \left (t \right ) \\ x_{2} \left (t \right ) &= -\frac {2 c_{2} {\mathrm e}^{4 t}}{3}+2 \,{\mathrm e}^{-4 t} c_{1} +9 \sin \left (t \right )+2 \cos \left (t \right ) \\ \end{align*}
Mathematica. Time used: 0.005 (sec). Leaf size: 98
ode={D[x1[t],t]==2*x1[t]-3*x2[t]+34*Sin[t],D[x2[t],t]==-4*x1[t]-2*x2[t]+17*Cos[t]}; 
ic={}; 
DSolve[{ode,ic},{x1[t],x2[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} \text {x1}(t)\to -4 \sin (t)+\cos (t)+\frac {1}{4} c_1 e^{-4 t} \left (3 e^{8 t}+1\right )-\frac {3}{8} c_2 e^{-4 t} \left (e^{8 t}-1\right ) \\ \text {x2}(t)\to 9 \sin (t)+2 \cos (t)-\frac {1}{2} c_1 e^{-4 t} \left (e^{8 t}-1\right )+\frac {1}{4} c_2 e^{-4 t} \left (e^{8 t}+3\right ) \\ \end{align*}
Sympy. Time used: 0.335 (sec). Leaf size: 54
from sympy import * 
t = symbols("t") 
x__1 = Function("x__1") 
x__2 = Function("x__2") 
ode=[Eq(-2*x__1(t) + 3*x__2(t) - 34*sin(t) + Derivative(x__1(t), t),0),Eq(4*x__1(t) + 2*x__2(t) - 17*cos(t) + Derivative(x__2(t), t),0)] 
ics = {} 
dsolve(ode,func=[x__1(t),x__2(t)],ics=ics)
 
\[ \left [ x^{1}{\left (t \right )} = \frac {C_{1} e^{- 4 t}}{2} - \frac {3 C_{2} e^{4 t}}{2} - 4 \sin {\left (t \right )} + \cos {\left (t \right )}, \ x^{2}{\left (t \right )} = C_{1} e^{- 4 t} + C_{2} e^{4 t} + 9 \sin {\left (t \right )} + 2 \cos {\left (t \right )}\right ] \]