82.33.10 problem Ex. 10

Internal problem ID [18824]
Book : Introductory Course On Differential Equations by Daniel A Murray. Longmans Green and Co. NY. 1924
Section : Chapter VI. Linear equations with constant coefficients. Examples on chapter VI, page 80
Problem number : Ex. 10
Date solved : Thursday, March 13, 2025 at 01:00:06 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 (m x \right ) \end{align*}

Maple. Time used: 0.224 (sec). Leaf size: 48
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(m*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \frac {\cos \left (m x \right )}{\left (m -n \right )^{2} \left (m +n \right )^{2}}+c_{1} \cos \left (n x \right )+c_{2} \sin \left (n x \right )+c_3 \cos \left (n x \right ) x +c_4 \sin \left (n x \right ) x \]
Mathematica. Time used: 0.461 (sec). Leaf size: 60
ode=D[y[x],{x,4}]+2*n^2*D[y[x],{x,2}]+n^4*y[x]==Cos[m*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {\cos (m x)+\left (m^2-n^2\right )^2 ((c_2 x+c_1) \cos (n x)+(c_4 x+c_3) \sin (n x))}{(m-n)^2 (m+n)^2} \]
Sympy. Time used: 0.191 (sec). Leaf size: 46
from sympy import * 
x = symbols("x") 
m = symbols("m") 
n = symbols("n") 
y = Function("y") 
ode = Eq(n**4*y(x) + 2*n**2*Derivative(y(x), (x, 2)) - cos(m*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^{- i n x} + \left (C_{3} + C_{4} x\right ) e^{i n x} + \frac {\cos {\left (m x \right )}}{m^{4} - 2 m^{2} n^{2} + n^{4}} \]