38.5.31 problem 31

Internal problem ID [8379]
Book : A First Course in Differential Equations with Modeling Applications by Dennis G. Zill. 12 ed. Metric version. 2024. Cengage learning.
Section : Chapter 2. First order differential equations. Section 2.2 Separable equations. Exercises 2.2 at page 53
Problem number : 31
Date solved : Tuesday, September 30, 2025 at 05:33:09 PM
CAS classification : [_separable]

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

With initial conditions

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