15.15.6 problem 6

Internal problem ID [3210]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 24, page 109
Problem number : 6
Date solved : Sunday, March 30, 2025 at 01:21:17 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} 2 y^{\prime \prime }+3 y^{\prime }-2 y&=x^{2} {\mathrm e}^{x} \end{align*}

Maple. Time used: 0.005 (sec). Leaf size: 29
ode:=2*diff(diff(y(x),x),x)+3*diff(y(x),x)-2*y(x) = x^2*exp(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{\frac {x}{2}} c_2 +{\mathrm e}^{-2 x} c_1 +\frac {\left (x^{2}-\frac {14}{3} x +\frac {86}{9}\right ) {\mathrm e}^{x}}{3} \]
Mathematica. Time used: 0.023 (sec). Leaf size: 41
ode=2*D[y[x],{x,2}]+3*D[y[x],x]-2*y[x]==x^2*Exp[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{27} e^x \left (9 x^2-42 x+86\right )+c_1 e^{x/2}+c_2 e^{-2 x} \]
Sympy. Time used: 0.244 (sec). Leaf size: 31
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2*exp(x) - 2*y(x) + 3*Derivative(y(x), x) + 2*Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- 2 x} + C_{2} e^{\frac {x}{2}} + \frac {\left (9 x^{2} - 42 x + 86\right ) e^{x}}{27} \]