8.12.6 problem 7

Internal problem ID [913]
Book : Differential equations and linear algebra, 3rd ed., Edwards and Penney
Section : Section 5.6, Forced Oscillations and Resonance. Page 362
Problem number : 7
Date solved : Tuesday, March 04, 2025 at 12:02:17 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.004 (sec). Leaf size: 27
ode:=diff(diff(x(t),t),t)+4*diff(x(t),t)+4*x(t) = 10*cos(3*t); 
dsolve(ode,x(t), singsol=all);
 
\[ x \left (t \right ) = \left (c_1 t +c_2 \right ) {\mathrm e}^{-2 t}-\frac {50 \cos \left (3 t \right )}{169}+\frac {120 \sin \left (3 t \right )}{169} \]
Mathematica. Time used: 0.018 (sec). Leaf size: 35
ode=D[x[t],{t,2}]+4*D[x[t],t]+4*x[t]==10*Cos[3*t]; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to \frac {120}{169} \sin (3 t)-\frac {50}{169} \cos (3 t)+e^{-2 t} (c_2 t+c_1) \]
Sympy. Time used: 0.214 (sec). Leaf size: 29
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(4*x(t) - 10*cos(3*t) + 4*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} + C_{2} t\right ) e^{- 2 t} + \frac {120 \sin {\left (3 t \right )}}{169} - \frac {50 \cos {\left (3 t \right )}}{169} \]