10.18.5 problem 5

Internal problem ID [1432]
Book : Elementary differential equations and boundary value problems, 10th ed., Boyce and DiPrima
Section : Chapter 7.9, Nonhomogeneous Linear Systems. page 447
Problem number : 5
Date solved : Saturday, March 29, 2025 at 10:55:03 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^{3}}\\ \frac {d}{d t}x_{2} \left (t \right )&=8 x_{1} \left (t \right )-4 x_{2} \left (t \right )-\frac {1}{t^{2}} \end{align*}

Maple. Time used: 0.112 (sec). Leaf size: 46
ode:=[diff(x__1(t),t) = 4*x__1(t)-2*x__2(t)+1/t^3, diff(x__2(t),t) = 8*x__1(t)-4*x__2(t)-1/t^2]; 
dsolve(ode);
 
\begin{align*} x_{1} \left (t \right ) &= -\frac {1}{2 t^{2}}+\frac {2}{t}-2 \ln \left (t \right )+c_1 t +c_2 \\ x_{2} \left (t \right ) &= 2 c_1 t -4 \ln \left (t \right )-\frac {c_1}{2}+2 c_2 +\frac {5}{t} \\ \end{align*}
Mathematica. Time used: 0.007 (sec). Leaf size: 61
ode={D[ x1[t],t]==4*x1[t]-2*x2[t]+1/(t^3),D[ x2[t],t]==8*x1[t]-4*x2[t]-1/(t^2)}; 
ic={}; 
DSolve[{ode,ic},{x1[t],x2[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} \text {x1}(t)\to -\frac {1}{2 t^2}+\frac {2}{t}-2 \log (t)+4 c_1 t-2 c_2 t-2+c_1 \\ \text {x2}(t)\to \frac {5}{t}-4 \log (t)+8 c_1 t-4 c_2 t-4+c_2 \\ \end{align*}
Sympy. Time used: 0.161 (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**3,0),Eq(-8*x__1(t) + 4*x__2(t) + Derivative(x__2(t), t) + t**(-2),0)] 
ics = {} 
dsolve(ode,func=[x__1(t),x__2(t)],ics=ics)
 
\[ \left [ x^{1}{\left (t \right )} = 4 C_{1} t + C_{1} + 4 C_{2} - 2 \log {\left (t \right )} - 2 + \frac {2}{t} - \frac {1}{2 t^{2}}, \ x^{2}{\left (t \right )} = 8 C_{1} t + 8 C_{2} - 4 \log {\left (t \right )} - 4 + \frac {5}{t}\right ] \]