89.22.7 problem 7

Internal problem ID [24795]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 10. Nonhomogeneous Equations: Operational methods. Exercises at page 161
Problem number : 7
Date solved : Thursday, October 02, 2025 at 10:48:05 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y-2 y^{\prime }+y^{\prime \prime }&=x^{3}-4 x^{2} \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 24
ode:=diff(diff(y(x),x),x)-2*diff(y(x),x)+y(x) = x^3-4*x^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (c_1 x +c_2 \right ) {\mathrm e}^{x}+x^{3}+2 x^{2}+2 x \]
Mathematica. Time used: 0.008 (sec). Leaf size: 30
ode=D[y[x],{x,2}]-2*D[y[x],x]+y[x]==x^3-4*x^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to x^3+2 x^2+x \left (2+c_2 e^x\right )+c_1 e^x \end{align*}
Sympy. Time used: 0.117 (sec). Leaf size: 22
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**3 + 4*x**2 + y(x) - 2*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x^{3} + 2 x^{2} + 2 x + \left (C_{1} + C_{2} x\right ) e^{x} \]