64.11.44 problem 44

Internal problem ID [13423]
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 : Monday, March 31, 2025 at 07:53:53 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.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} \]