66.2.23 problem Problem 32

Internal problem ID [13851]
Book : Differential equations and the calculus of variations by L. ElSGOLTS. MIR PUBLISHERS, MOSCOW, Third printing 1977.
Section : Chapter 2, DIFFERENTIAL EQUATIONS OF THE SECOND ORDER AND HIGHER. Problems page 172
Problem number : Problem 32
Date solved : Monday, March 31, 2025 at 08:15:12 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} x^{\prime \prime }+9 x&=t \sin \left (3 t \right ) \end{align*}

Maple. Time used: 0.003 (sec). Leaf size: 31
ode:=diff(diff(x(t),t),t)+9*x(t) = t*sin(3*t); 
dsolve(ode,x(t), singsol=all);
 
\[ x = \frac {\left (-3 t^{2}+36 c_1 \right ) \cos \left (3 t \right )}{36}+\frac {\sin \left (3 t \right ) \left (t +36 c_2 \right )}{36} \]
Mathematica. Time used: 0.132 (sec). Leaf size: 38
ode=D[x[t],{t,2}]+9*x[t]==t*Sin[3*t]; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to \left (-\frac {t^2}{12}+\frac {1}{216}+c_1\right ) \cos (3 t)+\frac {1}{36} (t+36 c_2) \sin (3 t) \]
Sympy. Time used: 0.137 (sec). Leaf size: 24
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-t*sin(3*t) + 9*x(t) + Derivative(x(t), (t, 2)),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = \left (C_{1} - \frac {t^{2}}{12}\right ) \cos {\left (3 t \right )} + \left (C_{2} + \frac {t}{36}\right ) \sin {\left (3 t \right )} \]