10.18.6 problem 6

Internal problem ID [1433]
Book : Elementary differential equations and boundary value problems, 10th ed., Boyce and DiPrima
Section : Chapter 7.9, Nonhomogeneous Linear Systems. page 447
Problem number : 6
Date solved : Tuesday, March 04, 2025 at 12:35:49 PM
CAS classification : system_of_ODEs

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

Maple. Time used: 0.034 (sec). Leaf size: 44
ode:=[diff(x__1(t),t) = -4*x__1(t)+2*x__2(t)+1/t, diff(x__2(t),t) = 2*x__1(t)-x__2(t)+2/t+4]; 
dsolve(ode);
 
\begin{align*} x_{1} \left (t \right ) &= \ln \left (-5 t \right )-\frac {c_1 \,{\mathrm e}^{-5 t}}{5}+\frac {8 t}{5}+c_2 \\ x_{2} \left (t \right ) &= \frac {c_1 \,{\mathrm e}^{-5 t}}{10}+2 \ln \left (-5 t \right )+2 c_2 +\frac {16 t}{5}+\frac {4}{5} \\ \end{align*}
Mathematica. Time used: 0.023 (sec). Leaf size: 86
ode={D[ x1[t],t]==-4*x1[t]+2*x2[t]+1/t,D[ x2[t],t]==2*x1[t]-1*x2[t]+2/t+4}; 
ic={}; 
DSolve[{ode,ic},{x1[t],x2[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} \text {x1}(t)\to \frac {1}{25} \left (40 t+25 \log (t)+20 c_1 e^{-5 t}-10 c_2 e^{-5 t}-8+5 c_1+10 c_2\right ) \\ \text {x2}(t)\to \frac {1}{25} \left (80 t+50 \log (t)-10 c_1 e^{-5 t}+5 c_2 e^{-5 t}+4+10 c_1+20 c_2\right ) \\ \end{align*}
Sympy. Time used: 0.166 (sec). Leaf size: 49
from sympy import * 
t = symbols("t") 
x__1 = Function("x__1") 
x__2 = Function("x__2") 
ode=[Eq(4*x__1(t) - 2*x__2(t) + Derivative(x__1(t), t) - 1/t,0),Eq(-2*x__1(t) + x__2(t) + Derivative(x__2(t), t) - 4 - 2/t,0)] 
ics = {} 
dsolve(ode,func=[x__1(t),x__2(t)],ics=ics)
 
\[ \left [ x^{1}{\left (t \right )} = \frac {C_{1}}{2} - 2 C_{2} e^{- 5 t} + \frac {8 t}{5} + \log {\left (t \right )} - \frac {8}{25}, \ x^{2}{\left (t \right )} = C_{1} + C_{2} e^{- 5 t} + \frac {16 t}{5} + 2 \log {\left (t \right )} + \frac {4}{25}\right ] \]