10.18.2 problem 2

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

\begin{align*} \frac {d}{d t}x_{1} \left (t \right )&=x_{1} \left (t \right )+\sqrt {3}\, x_{2} \left (t \right )+{\mathrm e}^{t}\\ \frac {d}{d t}x_{2} \left (t \right )&=\sqrt {3}\, x_{1} \left (t \right )-x_{2} \left (t \right )+\sqrt {3}\, {\mathrm e}^{-t} \end{align*}

Maple. Time used: 0.156 (sec). Leaf size: 70
ode:=[diff(x__1(t),t) = x__1(t)+3^(1/2)*x__2(t)+exp(t), diff(x__2(t),t) = 3^(1/2)*x__1(t)-x__2(t)+3^(1/2)*exp(-t)]; 
dsolve(ode);
 
\begin{align*} x_{1} \left (t \right ) &= \sinh \left (2 t \right ) c_2 +\cosh \left (2 t \right ) c_1 -\frac {5 \cosh \left (t \right )}{3}+\frac {\sinh \left (t \right )}{3} \\ x_{2} \left (t \right ) &= -\frac {\sqrt {3}\, \left (\cosh \left (2 t \right ) c_1 -2 \cosh \left (2 t \right ) c_2 -2 \sinh \left (2 t \right ) c_1 +\sinh \left (2 t \right ) c_2 +{\mathrm e}^{t}+2 \sinh \left (t \right )-2 \cosh \left (t \right )\right )}{3} \\ \end{align*}
Mathematica. Time used: 2.705 (sec). Leaf size: 313
ode={D[ x1[t],t]==1*x1[t]+Sqrt[4]*x2[t]+Exp[t],D[ x2[t],t]==Sqrt[3]*x1[t]-1*x2[t]+Sqrt[3]*Exp[-t]}; 
ic={}; 
DSolve[{ode,ic},{x1[t],x2[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} \text {x1}(t)\to \frac {1}{6} \left (-6 e^{-t}-\frac {2 \left (6+\sqrt {3}\right ) e^t}{1+2 \sqrt {3}}+\frac {\left (3 \left (\sqrt {1+2 \sqrt {3}}-1\right ) c_1-6 c_2\right ) e^{-\sqrt {1+2 \sqrt {3}} t}}{\sqrt {1+2 \sqrt {3}}}+\frac {3 \left (\left (1+\sqrt {1+2 \sqrt {3}}\right ) c_1+2 c_2\right ) e^{\sqrt {1+2 \sqrt {3}} t}}{\sqrt {1+2 \sqrt {3}}}\right ) \\ \text {x2}(t)\to \frac {1}{4} \left (4 e^{-t}-2 e^t+\frac {2 \left (\left (6+\sqrt {3}\right ) c_1+\left (1+2 \sqrt {3}\right ) \left (\sqrt {1+2 \sqrt {3}}-1\right ) c_2\right ) e^{\sqrt {1+2 \sqrt {3}} t}}{\left (1+2 \sqrt {3}\right )^{3/2}}+\frac {\left (2 \left (1+2 \sqrt {3}\right ) \left (1+\sqrt {1+2 \sqrt {3}}\right ) c_2-2 \left (6+\sqrt {3}\right ) c_1\right ) e^{-\sqrt {1+2 \sqrt {3}} t}}{\left (1+2 \sqrt {3}\right )^{3/2}}\right ) \\ \end{align*}
Sympy. Time used: 0.304 (sec). Leaf size: 76
from sympy import * 
t = symbols("t") 
x__1 = Function("x__1") 
x__2 = Function("x__2") 
ode=[Eq(-x__1(t) - sqrt(3)*x__2(t) - exp(t) + Derivative(x__1(t), t),0),Eq(-sqrt(3)*x__1(t) + x__2(t) + Derivative(x__2(t), t) - sqrt(3)*exp(-t),0)] 
ics = {} 
dsolve(ode,func=[x__1(t),x__2(t)],ics=ics)
 
\[ \left [ x^{1}{\left (t \right )} = \sqrt {3} C_{1} e^{2 t} - \frac {\sqrt {3} C_{2} e^{- 2 t}}{3} - \frac {2 e^{t}}{3} - e^{- t}, \ x^{2}{\left (t \right )} = C_{1} e^{2 t} + C_{2} e^{- 2 t} - \frac {\sqrt {3} e^{t}}{3} + \frac {2 \sqrt {3} e^{- t}}{3}\right ] \]