80.5.38 problem C 14

Internal problem ID [21259]
Book : A Textbook on Ordinary Differential Equations by Shair Ahmad and Antonio Ambrosetti. Second edition. ISBN 978-3-319-16407-6. Springer 2015
Section : Chapter 5. Second order equations. Excercise 5.9 at page 119
Problem number : C 14
Date solved : Thursday, October 02, 2025 at 07:27:25 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} x^{\prime \prime }+x&=t \sin \left (2 t \right ) \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 26
ode:=diff(diff(x(t),t),t)+x(t) = t*sin(2*t); 
dsolve(ode,x(t), singsol=all);
 
\[ x = \sin \left (t \right ) c_2 +\cos \left (t \right ) c_1 -\frac {4 \cos \left (2 t \right )}{9}-\frac {t \sin \left (2 t \right )}{3} \]
Mathematica. Time used: 0.016 (sec). Leaf size: 33
ode=D[x[t],{t,2}]+x[t]==t*Sin[2*t]; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to -\frac {1}{3} t \sin (2 t)-\frac {4}{9} \cos (2 t)+c_1 \cos (t)+c_2 \sin (t) \end{align*}
Sympy. Time used: 0.056 (sec). Leaf size: 29
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-t*sin(2*t) + x(t) + Derivative(x(t), (t, 2)),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = C_{1} \sin {\left (t \right )} + C_{2} \cos {\left (t \right )} - \frac {t \sin {\left (2 t \right )}}{3} - \frac {4 \cos {\left (2 t \right )}}{9} \]