58.11.46 problem 46

Internal problem ID [14777]
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 : 46
Date solved : Thursday, October 02, 2025 at 09:53:26 AM
CAS classification : [[_3rd_order, _missing_y]]

\begin{align*} y^{\prime \prime \prime }-3 y^{\prime \prime }+2 y^{\prime }&=x^{2} {\mathrm e}^{x}+3 x \,{\mathrm e}^{2 x}+5 x^{2} \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 55
ode:=diff(diff(diff(y(x),x),x),x)-3*diff(diff(y(x),x),x)+2*diff(y(x),x) = x^2*exp(x)+3*x*exp(2*x)+5*x^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (6 x^{2}+4 c_1 -18 x +21\right ) {\mathrm e}^{2 x}}{8}+\frac {\left (-x^{3}+3 c_2 -6 x +6\right ) {\mathrm e}^{x}}{3}+\frac {5 x^{3}}{6}+\frac {15 x^{2}}{4}+\frac {35 x}{4}+c_3 \]
Mathematica. Time used: 0.722 (sec). Leaf size: 67
ode=D[y[x],{x,3}]-3*D[y[x],{x,2}]+2*D[y[x],x]==x^2*Exp[x]+3*x*Exp[2*x]+5*x^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {5 x^3}{6}+e^x \left (-\frac {x^3}{3}-2 x+c_1\right )+\frac {15 x^2}{4}+\frac {1}{8} e^{2 x} \left (6 x^2-18 x+21+4 c_2\right )+\frac {35 x}{4}+c_3 \end{align*}
Sympy. Time used: 0.261 (sec). Leaf size: 54
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2*exp(x) - 5*x**2 - 3*x*exp(2*x) + 2*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} + \frac {5 x^{3}}{6} + \frac {15 x^{2}}{4} + \frac {35 x}{4} + \left (C_{2} + \frac {3 x^{2}}{4} - \frac {9 x}{4}\right ) e^{2 x} + \left (C_{3} - \frac {x^{3}}{3} - 2 x\right ) e^{x} \]