66.2.31 problem Problem 42

Internal problem ID [13859]
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 42
Date solved : Monday, March 31, 2025 at 08:15:25 AM
CAS classification : [[_high_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.004 (sec). Leaf size: 33
ode:=diff(diff(diff(diff(x(t),t),t),t),t)+2*diff(diff(x(t),t),t)+x(t) = cos(t); 
dsolve(ode,x(t), singsol=all);
 
\[ x = \frac {\left (8 c_3 t -t^{2}+8 c_1 +2\right ) \cos \left (t \right )}{8}+\left (\left (c_4 +\frac {3}{8}\right ) t +c_2 \right ) \sin \left (t \right ) \]
Mathematica. Time used: 0.077 (sec). Leaf size: 43
ode=D[x[t],{t,4}]+2*D[x[t],{t,2}]+x[t]==Cos[t]; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to \left (-\frac {t^2}{8}+c_2 t+\frac {5}{16}+c_1\right ) \cos (t)+\frac {1}{4} (t+4 c_4 t+4 c_3) \sin (t) \]
Sympy. Time used: 0.154 (sec). Leaf size: 22
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(x(t) - cos(t) + 2*Derivative(x(t), (t, 2)) + Derivative(x(t), (t, 4)),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = \left (C_{1} + C_{2} t\right ) \sin {\left (t \right )} + \left (C_{3} + t \left (C_{4} - \frac {t}{8}\right )\right ) \cos {\left (t \right )} \]