65.7.10 problem 14.1 (x)

Internal problem ID [13695]
Book : AN INTRODUCTION TO ORDINARY DIFFERENTIAL EQUATIONS by JAMES C. ROBINSON. Cambridge University Press 2004
Section : Chapter 14, Inhomogeneous second order linear equations. Exercises page 140
Problem number : 14.1 (x)
Date solved : Wednesday, March 05, 2025 at 10:12:49 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} x^{\prime \prime }+6 x^{\prime }+10 x&={\mathrm e}^{-2 t} \cos \left (t \right ) \end{align*}

Maple. Time used: 0.004 (sec). Leaf size: 32
ode:=diff(diff(x(t),t),t)+6*diff(x(t),t)+10*x(t) = exp(-2*t)*cos(t); 
dsolve(ode,x(t), singsol=all);
 
\[ x \left (t \right ) = \left (c_{2} \sin \left (t \right )+\cos \left (t \right ) c_{1} \right ) {\mathrm e}^{-3 t}+\frac {{\mathrm e}^{-2 t} \left (\cos \left (t \right )+2 \sin \left (t \right )\right )}{5} \]
Mathematica. Time used: 0.049 (sec). Leaf size: 47
ode=D[x[t],{t,2}]+6*D[x[t],t]+10*x[t]==Exp[-3*t]*Cos[t]; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to \frac {1}{2} e^{-3 t} \left (2 \sin (t) \int _1^t\cos ^2(K[1])dK[1]+\cos ^3(t)+2 c_2 \cos (t)+2 c_1 \sin (t)\right ) \]
Sympy. Time used: 0.388 (sec). Leaf size: 32
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(10*x(t) + 6*Derivative(x(t), t) + Derivative(x(t), (t, 2)) - exp(-2*t)*cos(t),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = \left (\left (C_{1} \sin {\left (t \right )} + C_{2} \cos {\left (t \right )}\right ) e^{- t} + \frac {2 \sin {\left (t \right )}}{5} + \frac {\cos {\left (t \right )}}{5}\right ) e^{- 2 t} \]