89.22.6 problem 6

Internal problem ID [24794]
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 : 6
Date solved : Thursday, October 02, 2025 at 10:48:05 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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