7.12.15 problem 16

Internal problem ID [397]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 2. Linear Equations of Higher Order. Section 2.6 (Forced oscillations and resonance). Problems at page 171
Problem number : 16
Date solved : Saturday, March 29, 2025 at 04:52:45 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} x^{\prime \prime }+4 x^{\prime }+5 x&=10 \cos \left (\omega t \right ) \end{align*}

Maple. Time used: 0.005 (sec). Leaf size: 57
ode:=diff(diff(x(t),t),t)+4*diff(x(t),t)+5*x(t) = 10*cos(omega*t); 
dsolve(ode,x(t), singsol=all);
 
\[ x = {\mathrm e}^{-2 t} \sin \left (t \right ) c_2 +{\mathrm e}^{-2 t} \cos \left (t \right ) c_1 +\frac {-10 \omega ^{2} \cos \left (\omega t \right )+40 \omega \sin \left (\omega t \right )+50 \cos \left (\omega t \right )}{\omega ^{4}+6 \omega ^{2}+25} \]
Mathematica. Time used: 0.035 (sec). Leaf size: 58
ode=D[x[t],{t,2}]+4*D[x[t],t]+5*x[t]==10*Cos[w*t]; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to \frac {40 w \sin (t w)-10 \left (w^2-5\right ) \cos (t w)}{w^4+6 w^2+25}+c_2 e^{-2 t} \cos (t)+c_1 e^{-2 t} \sin (t) \]
Sympy. Time used: 0.322 (sec). Leaf size: 73
from sympy import * 
t = symbols("t") 
omega = symbols("omega") 
x = Function("x") 
ode = Eq(5*x(t) - 10*cos(omega*t) + 4*Derivative(x(t), t) + Derivative(x(t), (t, 2)),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = - \frac {10 \omega ^{2} \cos {\left (\omega t \right )}}{\omega ^{4} + 6 \omega ^{2} + 25} + \frac {40 \omega \sin {\left (\omega t \right )}}{\omega ^{4} + 6 \omega ^{2} + 25} + \left (C_{1} \sin {\left (t \right )} + C_{2} \cos {\left (t \right )}\right ) e^{- 2 t} + \frac {50 \cos {\left (\omega t \right )}}{\omega ^{4} + 6 \omega ^{2} + 25} \]