80.5.37 problem C 13

Internal problem ID [21258]
Book : A Textbook on Ordinary Differential Equations by Shair Ahmad and Antonio Ambrosetti. Second edition. ISBN 978-3-319-16407-6. Springer 2015
Section : Chapter 5. Second order equations. Excercise 5.9 at page 119
Problem number : C 13
Date solved : Thursday, October 02, 2025 at 07:27:24 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} x^{\prime \prime }+2 x^{\prime }+2 x&=\cos \left (2 t \right ) \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 33
ode:=diff(diff(x(t),t),t)+2*diff(x(t),t)+2*x(t) = cos(2*t); 
dsolve(ode,x(t), singsol=all);
 
\[ x = {\mathrm e}^{-t} \sin \left (t \right ) c_2 +{\mathrm e}^{-t} \cos \left (t \right ) c_1 +\frac {\sin \left (2 t \right )}{5}-\frac {\cos \left (2 t \right )}{10} \]
Mathematica. Time used: 0.089 (sec). Leaf size: 42
ode=D[x[t],{t,2}]+2*D[x[t],t]+2*x[t]==Cos[2*t]; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to -\frac {1}{10} \cos (2 t)+c_1 e^{-t} \sin (t)+\cos (t) \left (\frac {2 \sin (t)}{5}+c_2 e^{-t}\right ) \end{align*}
Sympy. Time used: 0.134 (sec). Leaf size: 29
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(2*x(t) - cos(2*t) + 2*Derivative(x(t), t) + Derivative(x(t), (t, 2)),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = \left (C_{1} \sin {\left (t \right )} + C_{2} \cos {\left (t \right )}\right ) e^{- t} + \frac {\sin {\left (2 t \right )}}{5} - \frac {\cos {\left (2 t \right )}}{10} \]