63.10.1 problem 6

Internal problem ID [13072]
Book : A First Course in Differential Equations by J. David Logan. Third Edition. Springer-Verlag, NY. 2015.
Section : Chapter 2, Second order linear equations. Section 2.3.2 Resonance Exercises page 114
Problem number : 6
Date solved : Wednesday, March 05, 2025 at 09:14:45 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

With initial conditions

\begin{align*} x \left (0\right )&=0\\ x^{\prime }\left (0\right )&=0 \end{align*}

Maple. Time used: 0.042 (sec). Leaf size: 27
ode:=diff(diff(x(t),t),t)+1/100*diff(x(t),t)+4*x(t) = cos(2*t); 
ic:=x(0) = 0, D(x)(0) = 0; 
dsolve([ode,ic],x(t), singsol=all);
 
\[ x \left (t \right ) = -\frac {20000 \,{\mathrm e}^{-\frac {t}{200}} \sqrt {159999}\, \sin \left (\frac {\sqrt {159999}\, t}{200}\right )}{159999}+50 \sin \left (2 t \right ) \]
Mathematica. Time used: 7.503 (sec). Leaf size: 37
ode=D[x[t],{t,2}]+1/100*D[x[t],t]+4*x[t]==Cos[2*t]; 
ic={x[0]==0,Derivative[1][x][0 ]==0}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to 50 \sin (2 t)-\frac {20000 e^{-t/200} \sin \left (\frac {\sqrt {159999} t}{200}\right )}{\sqrt {159999}} \]
Sympy. Time used: 0.302 (sec). Leaf size: 32
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(4*x(t) - cos(2*t) + Derivative(x(t), t)/100 + Derivative(x(t), (t, 2)),0) 
ics = {x(0): 0, Subs(Derivative(x(t), t), t, 0): 0} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = 50 \sin {\left (2 t \right )} - \frac {20000 \sqrt {159999} e^{- \frac {t}{200}} \sin {\left (\frac {\sqrt {159999} t}{200} \right )}}{159999} \]