28.2.22 problem 22

Internal problem ID [4465]
Book : Differential equations for engineers by Wei-Chau XIE, Cambridge Press 2010
Section : Chapter 4. Linear Differential Equations. Page 183
Problem number : 22
Date solved : Sunday, March 30, 2025 at 03:23:19 AM
CAS classification : [[_high_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.004 (sec). Leaf size: 43
ode:=diff(diff(diff(diff(y(x),x),x),x),x)+5*diff(diff(y(x),x),x)+4*y(x) = sin(x)*cos(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (40 c_3 +\sin \left (x \right )\right ) \cos \left (x \right )^{2}}{20}+\frac {\left (24 c_4 \sin \left (x \right )+x +12 c_1 \right ) \cos \left (x \right )}{12}+\frac {\left (360 c_2 -7\right ) \sin \left (x \right )}{360}-c_3 \]
Mathematica. Time used: 0.032 (sec). Leaf size: 50
ode=D[y[x],{x,4}]+5*D[y[x],{x,2}]+4*y[x]==Sin[x]*Cos[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {\sin (x)}{72}+\frac {1}{80} \sin (3 x)+\left (\frac {x}{12}+c_3\right ) \cos (x)+c_1 \cos (2 x)+c_4 \sin (x)+c_2 \sin (2 x) \]
Sympy. Time used: 1.195 (sec). Leaf size: 73
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(4*y(x) - sin(x)*cos(2*x) + 5*Derivative(y(x), (x, 2)) + Derivative(y(x), (x, 4)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{3} \sin {\left (2 x \right )} + C_{4} \cos {\left (2 x \right )} + \left (C_{1} + \frac {x}{12}\right ) \cos {\left (x \right )} + \left (C_{2} - \frac {\left (1 - \cos {\left (2 x \right )}\right )^{3}}{30} + \frac {4 \left (1 - \cos {\left (2 x \right )}\right )^{2}}{45}\right ) \sin {\left (x \right )} + \frac {13 \sin {\left (3 x \right )}}{360} + \frac {\sin {\left (5 x \right )}}{144} - \frac {\sin {\left (7 x \right )}}{240} \]