85.59.9 problem 9

Internal problem ID [22850]
Book : Applied Differential Equations. By Murray R. Spiegel. 3rd edition. 1980. Pearson. ISBN 978-0130400970
Section : Chapter 4. Linear differential equations. A Exercises at page 203
Problem number : 9
Date solved : Thursday, October 02, 2025 at 09:15:44 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-y&={\mathrm e}^{-x^{2}} \end{align*}
Maple. Time used: 0.005 (sec). Leaf size: 42
ode:=diff(diff(y(x),x),x)-y(x) = exp(-x^2); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{x} c_2 +{\mathrm e}^{-x} c_1 +\frac {\sqrt {\pi }\, \left (\operatorname {erf}\left (x +\frac {1}{2}\right ) {\mathrm e}^{2 x}-\operatorname {erf}\left (x -\frac {1}{2}\right )\right ) {\mathrm e}^{\frac {1}{4}-x}}{4} \]
Mathematica. Time used: 0.078 (sec). Leaf size: 59
ode=D[y[x],{x,2}]-y[x]==Exp[-x^2]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{4} \sqrt {\pi } e^{\frac {1}{4}-x} \left (\text {erf}\left (\frac {1}{2}-x\right )+e^{2 x} \text {erf}\left (x+\frac {1}{2}\right )\right )+c_1 e^x+c_2 e^{-x} \end{align*}
Sympy. Time used: 0.322 (sec). Leaf size: 49
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-y(x) + Derivative(y(x), (x, 2)) - exp(-x**2),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} - \frac {\sqrt {\pi } e^{\frac {1}{4}} \operatorname {erf}{\left (x - \frac {1}{2} \right )}}{4}\right ) e^{- x} + \left (C_{2} + \frac {\sqrt {\pi } e^{\frac {1}{4}} \operatorname {erf}{\left (x + \frac {1}{2} \right )}}{4}\right ) e^{x} \]