66.2.2 problem Problem 2

Internal problem ID [13901]
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 2
Date solved : Tuesday, January 28, 2025 at 06:08:00 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Solution by Maple

Time used: 0.004 (sec). Leaf size: 31

dsolve(diff(x(t),t$2)+x(t)=sin(t)-cos(2*t),x(t), singsol=all)
 
\[ x \left (t \right ) = \frac {\cos \left (2 t \right )}{3}+\frac {\left (-t +2 c_{1} \right ) \cos \left (t \right )}{2}+\frac {\left (1+4 c_{2} \right ) \sin \left (t \right )}{4} \]

Solution by Mathematica

Time used: 0.147 (sec). Leaf size: 30

DSolve[D[x[t],{t,2}]+x[t]==Sin[t]-Cos[2*t],x[t],t,IncludeSingularSolutions -> True]
 
\[ x(t)\to \frac {1}{3} \cos (2 t)+\left (-\frac {t}{2}+c_1\right ) \cos (t)+c_2 \sin (t) \]