59.7.6 problem 14.1 (vi)

Internal problem ID [15051]
Book : AN INTRODUCTION TO ORDINARY DIFFERENTIAL EQUATIONS by JAMES C. ROBINSON. Cambridge University Press 2004
Section : Chapter 14, Inhomogeneous second order linear equations. Exercises page 140
Problem number : 14.1 (vi)
Date solved : Thursday, October 02, 2025 at 10:02:24 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} x^{\prime \prime }+\omega ^{2} x&=\sin \left (\alpha t \right ) \end{align*}
Maple. Time used: 0.005 (sec). Leaf size: 33
ode:=diff(diff(x(t),t),t)+omega^2*x(t) = sin(alpha*t); 
dsolve(ode,x(t), singsol=all);
 
\[ x = \sin \left (\omega t \right ) c_2 +\cos \left (\omega t \right ) c_1 +\frac {\sin \left (\alpha t \right )}{-\alpha ^{2}+\omega ^{2}} \]
Mathematica. Time used: 0.124 (sec). Leaf size: 56
ode=D[x[t],{t,2}]+w^2*x[t]==Sin[a*t]; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to \frac {-\left (c_1 \left (a^2-w^2\right ) \cos (t w)\right )+c_2 \left (w^2-a^2\right ) \sin (t w)+\sin (a t)}{(w-a) (a+w)} \end{align*}
Sympy. Time used: 0.065 (sec). Leaf size: 31
from sympy import * 
t = symbols("t") 
Alpha = symbols("Alpha") 
omega = symbols("omega") 
x = Function("x") 
ode = Eq(omega**2*x(t) - sin(Alpha*t) + Derivative(x(t), (t, 2)),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = C_{1} e^{- i \omega t} + C_{2} e^{i \omega t} - \frac {\sin {\left (\mathrm {A} t \right )}}{\mathrm {A}^{2} - \omega ^{2}} \]