71.6.4 problem 4

Internal problem ID [14339]
Book : Ordinary Differential Equations by Charles E. Roberts, Jr. CRC Press. 2010
Section : Chapter 2. The Initial Value Problem. Exercises 2.3.2, page 63
Problem number : 4
Date solved : Monday, March 31, 2025 at 12:18:17 PM
CAS classification : [_separable]

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

With initial conditions

\begin{align*} y \left (0\right )&=0 \end{align*}

Maple. Time used: 0.083 (sec). Leaf size: 19
ode:=diff(y(x),x) = x*exp(y(x)-x^2); 
ic:=y(0) = 0; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \ln \left (2\right )-\ln \left (1+{\mathrm e}^{x^{2}}\right )+x^{2} \]
Mathematica. Time used: 2.089 (sec). Leaf size: 21
ode=D[y[x],x]==x*Exp[y[x]-x^2]; 
ic={y[0]==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\log \left (\frac {1}{2} \left (e^{-x^2}+1\right )\right ) \]
Sympy. Time used: 0.248 (sec). Leaf size: 22
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*exp(-x**2 + y(x)) + Derivative(y(x), x),0) 
ics = {y(0): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \log {\left (- \frac {e^{x^{2}}}{- e^{x^{2}} - 1} \right )} + \log {\left (2 \right )} \]