75.16.74 problem 547

Internal problem ID [16976]
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 : 547
Date solved : Monday, March 31, 2025 at 03:36:56 PM
CAS classification : [[_high_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.005 (sec). Leaf size: 27
ode:=diff(diff(diff(diff(y(x),x),x),x),x)-2*diff(diff(y(x),x),x)+y(x) = cos(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\cos \left (x \right )}{4}+\left (c_4 x +c_2 \right ) {\mathrm e}^{-x}+\left (c_3 x +c_1 \right ) {\mathrm e}^{x} \]
Mathematica. Time used: 0.072 (sec). Leaf size: 134
ode=D[y[x],{x,4}]-2*D[y[x],{x,2}]+y[x]==Cos[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-x} \left (x \int _1^x\frac {1}{4} e^{K[2]} \cos (K[2])dK[2]+e^{2 x} x \int _1^x\frac {1}{4} e^{-K[4]} \cos (K[4])dK[4]+\int _1^x-\frac {1}{4} e^{K[1]} \cos (K[1]) (K[1]-1)dK[1]+e^{2 x} \int _1^x-\frac {1}{4} e^{-K[3]} \cos (K[3]) (K[3]+1)dK[3]+c_2 x+c_3 e^{2 x}+c_4 e^{2 x} x+c_1\right ) \]
Sympy. Time used: 0.108 (sec). Leaf size: 24
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) - cos(x) - 2*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 ) e^{- x} + \left (C_{3} + C_{4} x\right ) e^{x} + \frac {\cos {\left (x \right )}}{4} \]