89.22.8 problem 8

Internal problem ID [24796]
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 : 8
Date solved : Thursday, October 02, 2025 at 10:48:06 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y+2 y^{\prime }+y^{\prime \prime }&=x^{3}+6 x^{2} \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 22
ode:=diff(diff(y(x),x),x)+2*diff(y(x),x)+y(x) = x^3+6*x^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (c_1 x +c_2 \right ) {\mathrm e}^{-x}+x^{3}-6 x +12 \]
Mathematica. Time used: 0.009 (sec). Leaf size: 30
ode=D[y[x],{x,2}]+2*D[y[x],x]+y[x]==x^3+6*x^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{-x} \left (e^x \left (x^3-6 x+12\right )+c_2 x+c_1\right ) \end{align*}
Sympy. Time used: 0.119 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**3 - 6*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} - 6 x + \left (C_{1} + C_{2} x\right ) e^{- x} + 12 \]