86.7.7 problem 7

Internal problem ID [23154]
Book : An introduction to Differential Equations. By Howard Frederick Cleaves. 1969. Oliver and Boyd publisher. ISBN 0050015044
Section : Chapter 5. Linear equations of the second order with constant coefficients. Exercise 5c at page 83
Problem number : 7
Date solved : Thursday, October 02, 2025 at 09:23:33 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} x^{\prime \prime }-2 x^{\prime }+5 x&=3 \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)+5*x(t) = 3*cos(2*t); 
dsolve(ode,x(t), singsol=all);
 
\[ x = {\mathrm e}^{t} \sin \left (2 t \right ) c_2 +{\mathrm e}^{t} \cos \left (2 t \right ) c_1 +\frac {3 \cos \left (2 t \right )}{17}-\frac {12 \sin \left (2 t \right )}{17} \]
Mathematica. Time used: 0.013 (sec). Leaf size: 38
ode=D[x[t],{t,2}]-2*D[x[t],t]+5*x[t]==3*Cos[2*t]; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to \left (\frac {3}{17}+c_2 e^t\right ) \cos (2 t)+\frac {1}{17} \left (-12+17 c_1 e^t\right ) \sin (2 t) \end{align*}
Sympy. Time used: 0.151 (sec). Leaf size: 36
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(5*x(t) - 3*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 (2 t \right )} + C_{2} \cos {\left (2 t \right )}\right ) e^{t} - \frac {12 \sin {\left (2 t \right )}}{17} + \frac {3 \cos {\left (2 t \right )}}{17} \]