2.5.21 Problem 21

Solved as first order separable ode
Solved as first order ode of type ID 1
Maple step by step solution
Maple trace
Maple dsolve solution
Mathematica DSolve solution
Sympy solution

Internal problem ID [8982]
Book : Own collection of miscellaneous problems
Section : section 5.0
Problem number : 21
Date solved : Friday, February 21, 2025 at 09:02:21 PM
CAS classification : [_separable]

Solve

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

Solved as first order separable ode

Time used: 0.070 (sec)

The ode

\begin{equation} y^{\prime } = -\frac {{\mathrm e}^{-y}}{x^{2}} \end{equation}

is separable as it can be written as

\begin{align*} y^{\prime }&= -\frac {{\mathrm e}^{-y}}{x^{2}}\\ &= f(x) g(y) \end{align*}

Where

\begin{align*} f(x) &= -\frac {1}{x^{2}}\\ g(y) &= {\mathrm e}^{-y} \end{align*}

Integrating gives

\begin{align*} \int { \frac {1}{g(y)} \,dy} &= \int { f(x) \,dx} \\ \int { {\mathrm e}^{y}\,dy} &= \int { -\frac {1}{x^{2}} \,dx} \\ \end{align*}
\[ {\mathrm e}^{y}=\frac {1}{x}+c_1 \]

Solving for \(y\) gives

\begin{align*} y &= \ln \left (\frac {c_1 x +1}{x}\right ) \\ \end{align*}
Figure 2.231: Slope field \(x^{2} y^{\prime }+{\mathrm e}^{-y} = 0\)

Summary of solutions found

\begin{align*} y &= \ln \left (\frac {c_1 x +1}{x}\right ) \\ \end{align*}
Solved as first order ode of type ID 1

Time used: 0.051 (sec)

Writing the ode as

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

And using the substitution \(u={\mathrm e}^{y}\) then

\begin{align*} u' &= y^{\prime } {\mathrm e}^{y} \end{align*}

The above shows that

\begin{align*} y^{\prime } &= u^{\prime }\left (x \right ) {\mathrm e}^{-y}\\ &= \frac {u^{\prime }\left (x \right )}{u} \end{align*}

Substituting this in (1) gives

\begin{align*} \frac {u^{\prime }\left (x \right )}{u}&=-\frac {1}{x^{2} u} \end{align*}

The above simplifies to

\begin{align*} u^{\prime }\left (x \right )&=-\frac {1}{x^{2}}\tag {2} \end{align*}

Now ode (2) is solved for \(u \left (x \right )\).

Since the ode has the form \(u^{\prime }\left (x \right )=f(x)\), then we only need to integrate \(f(x)\).

\begin{align*} \int {du} &= \int {-\frac {1}{x^{2}}\, dx}\\ u \left (x \right ) &= \frac {1}{x} + c_2 \end{align*}

Substituting the solution found for \(u \left (x \right )\) in \(u={\mathrm e}^{y}\) gives

\begin{align*} y&= \ln \left (u \left (x \right )\right )\\ &= \ln \left (\ln \left (\frac {1}{x}+c_2 \right )\right )\\ &= \ln \left (\frac {1}{x}+c_2 \right ) \end{align*}
Figure 2.232: Slope field \(x^{2} y^{\prime }+{\mathrm e}^{-y} = 0\)

Summary of solutions found

\begin{align*} y &= \ln \left (\frac {1}{x}+c_2 \right ) \\ \end{align*}
Maple step by step solution
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & x^{2} \left (\frac {d}{d x}y \left (x \right )\right )+{\mathrm e}^{-y \left (x \right )}=0 \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & \frac {d}{d x}y \left (x \right ) \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & \frac {d}{d x}y \left (x \right )=-\frac {{\mathrm e}^{-y \left (x \right )}}{x^{2}} \\ \bullet & {} & \textrm {Separate variables}\hspace {3pt} \\ {} & {} & \frac {\frac {d}{d x}y \left (x \right )}{{\mathrm e}^{-y \left (x \right )}}=-\frac {1}{x^{2}} \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} x \\ {} & {} & \int \frac {\frac {d}{d x}y \left (x \right )}{{\mathrm e}^{-y \left (x \right )}}d x =\int -\frac {1}{x^{2}}d x +\mathit {C1} \\ \bullet & {} & \textrm {Evaluate integral}\hspace {3pt} \\ {} & {} & \frac {1}{{\mathrm e}^{-y \left (x \right )}}=\frac {1}{x}+\mathit {C1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \left (x \right ) \\ {} & {} & y \left (x \right )=-\ln \left (\frac {x}{\mathit {C1} x +1}\right ) \end {array} \]

Maple trace
`Methods for first order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying 1st order linear 
trying Bernoulli 
trying separable 
<- separable successful`
 
Maple dsolve solution

Solving time : 0.003 (sec)
Leaf size : 15

dsolve(diff(y(x),x)*x^2+exp(-y(x)) = 0,y(x),singsol=all)
 
\[ y = \ln \left (\frac {-c_{1} x +1}{x}\right ) \]
Mathematica DSolve solution

Solving time : 0.433 (sec)
Leaf size : 12

DSolve[{x^2*D[y[x],x]+Exp[-y[x]]==0,{}},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \log \left (\frac {1}{x}+c_1\right ) \]
Sympy solution

Solving time : 0.167 (sec)
Leaf size : 8

Python version: 3.13.1 (main, Dec  4 2024, 18:05:56) [GCC 14.2.1 20240910] 
Sympy version 1.13.3
 
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), x) + exp(-y(x)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
Eq(y(x), log(C1 + 1/x))
 
\[ y{\left (x \right )} = \log {\left (C_{1} + \frac {1}{x} \right )} \]