57.4.31 problem 28

Internal problem ID [14355]
Book : A First Course in Differential Equations by J. David Logan. Third Edition. Springer-Verlag, NY. 2015.
Section : Chapter 1, First order differential equations. Section 1.3.1 Separable equations. Exercises page 26
Problem number : 28
Date solved : Thursday, October 02, 2025 at 09:32:20 AM
CAS classification : [_separable]

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

With initial conditions

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