23.3.22 problem 22

Internal problem ID [5736]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 3. THE DIFFERENTIAL EQUATION IS LINEAR AND OF SECOND ORDER, page 311
Problem number : 22
Date solved : Tuesday, September 30, 2025 at 02:02:17 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} -2 y+y^{\prime \prime }&=4 \,{\mathrm e}^{x^{2}} x^{2} \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 26
ode:=-2*y(x)+diff(diff(y(x),x),x) = 4*x^2*exp(x^2); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{\sqrt {2}\, x} c_2 +{\mathrm e}^{-\sqrt {2}\, x} c_1 +{\mathrm e}^{x^{2}} \]
Mathematica. Time used: 0.18 (sec). Leaf size: 36
ode=-2*y[x] + D[y[x],{x,2}] == 4*E^(x^2)*x^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{x^2}+c_1 e^{\sqrt {2} x}+c_2 e^{-\sqrt {2} x} \end{align*}
Sympy. Time used: 0.220 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-4*x**2*exp(x**2) - 2*y(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- \sqrt {2} x} + C_{2} e^{\sqrt {2} x} + e^{x^{2}} \]