23.5.51 problem 51

Internal problem ID [6660]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 5. THE EQUATION IS LINEAR AND OF ORDER GREATER THAN TWO, page 410
Problem number : 51
Date solved : Tuesday, September 30, 2025 at 03:50:36 PM
CAS classification : [[_3rd_order, _linear, _nonhomogeneous]]

\begin{align*} -2 y+4 y^{\prime }-3 y^{\prime \prime }+y^{\prime \prime \prime }&={\mathrm e}^{x}+\cos \left (x \right ) \end{align*}
Maple. Time used: 0.005 (sec). Leaf size: 27
ode:=-2*y(x)+4*diff(y(x),x)-3*diff(diff(y(x),x),x)+diff(diff(diff(y(x),x),x),x) = exp(x)+cos(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (c_2 \cos \left (x \right )+c_3 \sin \left (x \right )+x +c_1 \right ) {\mathrm e}^{x}+\frac {\cos \left (x \right )}{10}+\frac {3 \sin \left (x \right )}{10} \]
Mathematica. Time used: 0.059 (sec). Leaf size: 40
ode=-2*y[x] + 4*D[y[x],x] - 3*D[y[x],{x,2}] + D[y[x],{x,3}] == E^x + Cos[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^x (x+c_3)+\left (\frac {1}{10}+c_2 e^x\right ) \cos (x)+\left (\frac {3}{10}+c_1 e^x\right ) \sin (x) \end{align*}
Sympy. Time used: 0.161 (sec). Leaf size: 31
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*y(x) - exp(x) - cos(x) + 4*Derivative(y(x), x) - 3*Derivative(y(x), (x, 2)) + Derivative(y(x), (x, 3)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + C_{2} \sin {\left (x \right )} + C_{3} \cos {\left (x \right )} + x\right ) e^{x} + \frac {3 \sin {\left (x \right )}}{10} + \frac {\cos {\left (x \right )}}{10} \]