6.19.48 problem section 9.3, problem 48

Internal problem ID [2195]
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 48
Date solved : Tuesday, September 30, 2025 at 05:24:52 AM
CAS classification : [[_3rd_order, _linear, _nonhomogeneous]]

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