89.1.27 problem 27

Internal problem ID [24262]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 2. Equations of the first order and first degree. Exercises at page 21
Problem number : 27
Date solved : Sunday, October 12, 2025 at 05:55:24 AM
CAS classification : [_separable]

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

With initial conditions

\begin{align*} y \left (\infty \right )&={\frac {1}{2}} \\ \end{align*}
Maple. Time used: 0.058 (sec). Leaf size: 20
ode:=x*y(x)^2+exp(x)*diff(y(x),x) = 0; 
ic:=[y(infinity) = 1/2]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = -\frac {1}{x \,{\mathrm e}^{-x}+{\mathrm e}^{-x}-2} \]
Mathematica. Time used: 0.23 (sec). Leaf size: 20
ode=x*y[x]^2+Exp[x]*D[y[x],x]==0; 
ic={y[Infinity]==1/2}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {e^x}{x-2 e^x+1} \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*y(x)**2 + exp(x)*Derivative(y(x), x),0) 
ics = {y(oo): 1/2} 
dsolve(ode,func=y(x),ics=ics)
 
ValueError : Couldnt solve for initial conditions