58.11.44 problem 44

Internal problem ID [14775]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 4, Section 4.3. The method of undetermined coefficients. Exercises page 151
Problem number : 44
Date solved : Thursday, October 02, 2025 at 09:51:04 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-6 y^{\prime }+9 y&=x^{4} {\mathrm e}^{x}+x^{3} {\mathrm e}^{2 x}+x^{2} {\mathrm e}^{3 x} \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 61
ode:=diff(diff(y(x),x),x)-6*diff(y(x),x)+9*y(x) = x^4*exp(x)+x^3*exp(2*x)+x^2*exp(3*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (\frac {45}{2}+\left (x^{4}+12 c_1 x +12 c_2 \right ) {\mathrm e}^{2 x}+12 \left (x^{3}+6 x^{2}+18 x +24\right ) {\mathrm e}^{x}+3 x^{4}+12 x^{3}+27 x^{2}+36 x \right ) {\mathrm e}^{x}}{12} \]
Mathematica. Time used: 1.385 (sec). Leaf size: 70
ode=D[y[x],{x,2}]-6*D[y[x],x]+9*y[x]==x^4*Exp[x]+x^3*Exp[2*x]+x^2*Exp[3*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^x \left (\frac {x^4}{4}+e^{2 x} \left (\frac {x^4}{12}+c_2 x+c_1\right )+x^3+\frac {9 x^2}{4}+e^x \left (x^3+6 x^2+18 x+24\right )+3 x+\frac {15}{8}\right ) \end{align*}
Sympy. Time used: 0.349 (sec). Leaf size: 70
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**4*exp(x) - x**3*exp(2*x) - x**2*exp(3*x) + 9*y(x) - 6*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (\frac {x^{4}}{4} + x^{3} e^{x} + x^{3} + 6 x^{2} e^{x} + \frac {9 x^{2}}{4} + 18 x e^{x} + 3 x + \left (C_{1} + x \left (C_{2} + \frac {x^{3}}{12}\right )\right ) e^{2 x} + 24 e^{x} + \frac {15}{8}\right ) e^{x} \]