89.16.36 problem 36

Internal problem ID [24686]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 9. Nonhomogeneous Equations: Undetermined coefficients. Exercises at page 140
Problem number : 36
Date solved : Thursday, October 02, 2025 at 10:47:04 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} 2 y^{\prime \prime }-5 y^{\prime }-3 y&=-9 x^{2}-1 \end{align*}

With initial conditions

\begin{align*} y \left (0\right )&=1 \\ y^{\prime }\left (0\right )&=0 \\ \end{align*}
Maple. Time used: 0.011 (sec). Leaf size: 20
ode:=2*diff(diff(y(x),x),x)-5*diff(y(x),x)-3*y(x) = -9*x^2-1; 
ic:=[y(0) = 1, D(y)(0) = 0]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = 21-20 \,{\mathrm e}^{-\frac {x}{2}}+3 x^{2}-10 x \]
Mathematica. Time used: 0.009 (sec). Leaf size: 24
ode=2*D[y[x],{x,2}]-5*D[y[x],{x,1}]-3*y[x]==  -9*x^2-1; 
ic={y[0]==1,Derivative[1][y][0] ==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to 3 x^2-10 x-20 e^{-x/2}+21 \end{align*}
Sympy. Time used: 0.141 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(9*x**2 - 3*y(x) - 5*Derivative(y(x), x) + 2*Derivative(y(x), (x, 2)) + 1,0) 
ics = {y(0): 1, Subs(Derivative(y(x), x), x, 0): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = 3 x^{2} - 10 x + 21 - 20 e^{- \frac {x}{2}} \]