64.11.44 problem 44

Internal problem ID [13415]
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 : Wednesday, March 05, 2025 at 09:53:03 PM
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.006 (sec). Leaf size: 62
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 = \left (x^{3}+6 x^{2}+18 x +24\right ) {\mathrm e}^{2 x}+\frac {\left (x^{4}+12 c_{1} x +12 c_{2} \right ) {\mathrm e}^{3 x}}{12}+\frac {\left (x^{4}+4 x^{3}+9 x^{2}+12 x +\frac {15}{2}\right ) {\mathrm e}^{x}}{4} \]
Mathematica. Time used: 1.653 (sec). Leaf size: 91
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]
 
\[ y(x)\to e^{3 x} \left (\int _1^x-e^{-2 K[1]} K[1]^3 \left (K[1]^2+e^{K[1]} K[1]+e^{2 K[1]}\right )dK[1]+x \int _1^x\left (e^{-2 K[2]} K[2]^4+e^{-K[2]} K[2]^3+K[2]^2\right )dK[2]+c_2 x+c_1\right ) \]
Sympy. Time used: 0.532 (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} \]