89.16.6 problem 6

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

\begin{align*} 4 y+y^{\prime \prime }&=15 \,{\mathrm e}^{x}-8 x^{2} \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 29
ode:=diff(diff(y(x),x),x)+4*y(x) = 15*exp(x)-8*x^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (c_1 -1\right ) \cos \left (2 x \right )-2 x^{2}+\sin \left (2 x \right ) c_2 +3 \,{\mathrm e}^{x}+1 \]
Mathematica. Time used: 0.098 (sec). Leaf size: 31
ode=D[y[x],{x,2}]+4*y[x]==15*Exp[x]-8*x^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -2 x^2+3 e^x+c_1 \cos (2 x)+c_2 \sin (2 x)+1 \end{align*}
Sympy. Time used: 0.056 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(8*x**2 + 4*y(x) - 15*exp(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} \sin {\left (2 x \right )} + C_{2} \cos {\left (2 x \right )} - 2 x^{2} + 3 e^{x} + 1 \]