6.19.4 problem section 9.3, problem 4

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

\begin{align*} y^{\prime \prime \prime }+3 y^{\prime \prime }-y^{\prime }-3 y&={\mathrm e}^{-2 x} \left (3 x^{2}-17 x +2\right ) \end{align*}
Maple. Time used: 0.006 (sec). Leaf size: 34
ode:=diff(diff(diff(y(x),x),x),x)+3*diff(diff(y(x),x),x)-diff(y(x),x)-3*y(x) = exp(-2*x)*(3*x^2-17*x+2); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (x^{2}-5 x +1\right ) {\mathrm e}^{-2 x}+c_1 \,{\mathrm e}^{x}+c_2 \,{\mathrm e}^{-3 x}+c_3 \,{\mathrm e}^{-x} \]
Mathematica. Time used: 0.005 (sec). Leaf size: 42
ode=D[y[x],{x,3}]+3*D[y[x],{x,2}]-D[y[x],x]-3*y[x]==Exp[-2*x]*(2-17*x+3*x^2); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{-3 x} \left (e^x \left (x^2-5 x+1\right )+c_2 e^{2 x}+c_3 e^{4 x}+c_1\right ) \end{align*}
Sympy. Time used: 0.227 (sec). Leaf size: 32
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((-3*x**2 + 17*x - 2)*exp(-2*x) - 3*y(x) - 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 )} = C_{1} e^{- 3 x} + C_{2} e^{- x} + C_{3} e^{x} + \left (x^{2} - 5 x + 1\right ) e^{- 2 x} \]