23.1.15 problem 2(e)

Internal problem ID [4105]
Book : Theory and solutions of Ordinary Differential equations, Donald Greenspan, 1960
Section : Chapter 2. First order equations. Exercises at page 14
Problem number : 2(e)
Date solved : Tuesday, March 04, 2025 at 05:26:11 PM
CAS classification : [_separable]

\begin{align*} {\mathrm e}^{-y}+\left (x^{2}+1\right ) y^{\prime }&=0 \end{align*}

With initial conditions

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

Maple. Time used: 0.043 (sec). Leaf size: 11
ode:=exp(-y(x))+(x^2+1)*diff(y(x),x) = 0; 
ic:=y(0) = 0; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y \left (x \right ) = \ln \left (-\arctan \left (x \right )+1\right ) \]
Mathematica. Time used: 0.392 (sec). Leaf size: 12
ode=Exp[-y[x]]+(1+x^2)*D[y[x],x]==0; 
ic=y[0]==0; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \log (1-\arctan (x)) \]
Sympy. Time used: 0.221 (sec). Leaf size: 8
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x**2 + 1)*Derivative(y(x), x) + exp(-y(x)),0) 
ics = {y(0): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \log {\left (1 - \operatorname {atan}{\left (x \right )} \right )} \]