89.19.15 problem 15

Internal problem ID [24743]
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 151
Problem number : 15
Date solved : Thursday, October 02, 2025 at 10:47:36 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-9 y&=18 x -162 x \,{\mathrm e}^{2 x} \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 31
ode:=diff(diff(y(x),x),x)-9*y(x) = 18*x-162*x*exp(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-3 x} c_2 +{\mathrm e}^{3 x} c_1 +\frac {162 \left (4+5 x \right ) {\mathrm e}^{2 x}}{25}-2 x \]
Mathematica. Time used: 0.163 (sec). Leaf size: 39
ode=D[y[x],{x,2}]-9*y[x]==9*(2*x-3*6*x*Exp[2*x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -2 x+\frac {162}{25} e^{2 x} (5 x+4)+c_1 e^{3 x}+c_2 e^{-3 x} \end{align*}
Sympy. Time used: 0.086 (sec). Leaf size: 37
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(162*x*exp(2*x) - 18*x - 9*y(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- 3 x} + C_{2} e^{3 x} + \frac {162 x e^{2 x}}{5} - 2 x + \frac {648 e^{2 x}}{25} \]