6.19.31 problem section 9.3, problem 31

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

\begin{align*} y^{\prime \prime \prime }-y^{\prime \prime }+2 y^{\prime }-2 y&={\mathrm e}^{2 x} \left (\left (-x^{2}+5 x +27\right ) \cos \left (x \right )+\left (9 x^{2}+13 x +2\right ) \sin \left (x \right )\right ) \end{align*}
Maple. Time used: 0.011 (sec). Leaf size: 180
ode:=diff(diff(diff(y(x),x),x),x)-diff(diff(y(x),x),x)+2*diff(y(x),x)-2*y(x) = exp(2*x)*((-x^2+5*x+27)*cos(x)+(9*x^2+13*x+2)*sin(x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {\sqrt {2}\, \int -\left (\sqrt {2}\, \cos \left (\sqrt {2}\, x \right )-\sin \left (\sqrt {2}\, x \right )\right ) \left (\left (-9 x^{2}-13 x -2\right ) \sin \left (x \right )+\left (x^{2}-5 x -27\right ) \cos \left (x \right )\right ) {\mathrm e}^{2 x}d x \cos \left (\sqrt {2}\, x \right )}{6}-\frac {\sqrt {2}\, \int -\left (\sqrt {2}\, \sin \left (\sqrt {2}\, x \right )+\cos \left (\sqrt {2}\, x \right )\right ) \left (\left (-9 x^{2}-13 x -2\right ) \sin \left (x \right )+\left (x^{2}-5 x -27\right ) \cos \left (x \right )\right ) {\mathrm e}^{2 x}d x \sin \left (\sqrt {2}\, x \right )}{6}+c_2 \cos \left (\sqrt {2}\, x \right )+c_3 \sin \left (\sqrt {2}\, x \right )+\frac {\left (5 \left (-x^{2}+x +3\right ) \cos \left (x \right )+4 \sin \left (x \right ) \left (x^{2}+\frac {5}{2} x +\frac {7}{4}\right )\right ) {\mathrm e}^{2 x}}{3}+c_1 \,{\mathrm e}^{x} \]
Mathematica. Time used: 0.013 (sec). Leaf size: 60
ode=1*D[y[x],{x,3}]-1*D[y[x],{x,2}]+2*D[y[x],x]-2*y[x]==Exp[2*x]*((27+5*x-x^2)*Cos[1*x]+(2+13*x+9*x^2)*Sin[1*x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{2 x} \left (\left (-x^2+x+1\right ) \cos (x)+(2 x+1) \sin (x)\right )+c_3 e^x+c_1 \cos \left (\sqrt {2} x\right )+c_2 \sin \left (\sqrt {2} x\right ) \end{align*}
Sympy. Time used: 0.589 (sec). Leaf size: 58
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(((x**2 - 5*x - 27)*cos(x) - (9*x**2 + 13*x + 2)*sin(x))*exp(2*x) - 2*y(x) + 2*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_{1} e^{x} + C_{2} \sin {\left (\sqrt {2} x \right )} + C_{3} \cos {\left (\sqrt {2} x \right )} + \left (- x^{2} \cos {\left (x \right )} + 2 x \sin {\left (x \right )} + x \cos {\left (x \right )} + \sin {\left (x \right )} + \cos {\left (x \right )}\right ) e^{2 x} \]