6.19.49 problem section 9.3, problem 49

Internal problem ID [2196]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 9 Introduction to Linear Higher Order Equations. Section 9.3. Undetermined Coefficients for Higher Order Equations. Page 495
Problem number : section 9.3, problem 49
Date solved : Tuesday, September 30, 2025 at 05:24:53 AM
CAS classification : [[_3rd_order, _linear, _nonhomogeneous]]

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