75.16.33 problem 506

Internal problem ID [16935]
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 : 506
Date solved : Monday, March 31, 2025 at 03:35:51 PM
CAS classification : [[_high_order, _linear, _nonhomogeneous]]

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

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