1.12.2 problem 2

Internal problem ID [384]
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 : 2
Date solved : Tuesday, September 30, 2025 at 03:58:09 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} x^{\prime \prime }+4 x&=5 \sin \left (3 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.025 (sec). Leaf size: 17
ode:=diff(diff(x(t),t),t)+4*x(t) = 5*sin(3*t); 
ic:=[x(0) = 0, D(x)(0) = 0]; 
dsolve([ode,op(ic)],x(t), singsol=all);
 
\[ x = \frac {3 \sin \left (2 t \right )}{2}-\sin \left (3 t \right ) \]
Mathematica. Time used: 0.01 (sec). Leaf size: 18
ode=D[x[t],{t,2}]+4*x[t]==5*Sin[3*t]; 
ic={x[0]==0,Derivative[1][x][0] ==0}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to 3 \sin (t) \cos (t)-\sin (3 t) \end{align*}
Sympy. Time used: 0.049 (sec). Leaf size: 15
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(4*x(t) - 5*sin(3*t) + 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 )} = \frac {3 \sin {\left (2 t \right )}}{2} - \sin {\left (3 t \right )} \]