75.16.30 problem 503

Internal problem ID [16924]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Chapter 2 (Higher order ODEs). Section 15.3 Nonhomogeneous linear equations with constant coefficients. Trial and error method. Exercises page 132
Problem number : 503
Date solved : Thursday, March 13, 2025 at 09:00:30 AM
CAS classification : [[_high_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.007 (sec). Leaf size: 31
ode:=diff(diff(diff(diff(y(x),x),x),x),x)+4*diff(diff(y(x),x),x)+4*y(x) = cos(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (c_{3} x +c_{1} \right ) \cos \left (\sqrt {2}\, x \right )+\left (c_4 x +c_{2} \right ) \sin \left (\sqrt {2}\, x \right )+\cos \left (x \right ) \]
Mathematica. Time used: 0.257 (sec). Leaf size: 222
ode=D[y[x],{x,4}]+4*D[y[x],{x,2}]+4*y[x]==Cos[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to x \cos \left (\sqrt {2} x\right ) \int _1^x-\frac {1}{4} \cos (K[2]) \cos \left (\sqrt {2} K[2]\right )dK[2]+\cos \left (\sqrt {2} x\right ) \int _1^x-\frac {1}{8} \cos (K[1]) \left (\sqrt {2} \sin \left (\sqrt {2} K[1]\right )-2 \cos \left (\sqrt {2} K[1]\right ) K[1]\right )dK[1]+\sin \left (\sqrt {2} x\right ) \int _1^x\frac {1}{8} \cos (K[3]) \left (\sqrt {2} \cos \left (\sqrt {2} K[3]\right )+2 K[3] \sin \left (\sqrt {2} K[3]\right )\right )dK[3]+x \sin \left (\sqrt {2} x\right ) \int _1^x-\frac {1}{4} \cos (K[4]) \sin \left (\sqrt {2} K[4]\right )dK[4]+c_1 \cos \left (\sqrt {2} x\right )+c_2 x \cos \left (\sqrt {2} x\right )+c_3 \sin \left (\sqrt {2} x\right )+c_4 x \sin \left (\sqrt {2} x\right ) \]
Sympy. Time used: 0.110 (sec). Leaf size: 32
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(4*y(x) - cos(x) + 4*Derivative(y(x), (x, 2)) + Derivative(y(x), (x, 4)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + C_{2} x\right ) \sin {\left (\sqrt {2} x \right )} + \left (C_{3} + C_{4} x\right ) \cos {\left (\sqrt {2} x \right )} + \cos {\left (x \right )} \]