29.9.3 problem 243

Internal problem ID [4843]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 9
Problem number : 243
Date solved : Sunday, March 30, 2025 at 04:03:30 AM
CAS classification : [_separable]

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

Maple. Time used: 0.014 (sec). Leaf size: 31
ode:=(2*x+1)*diff(y(x),x) = 4*exp(-y(x))-2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\ln \left (\frac {1+2 x}{-1+\left (4 x +2\right ) {\mathrm e}^{2 c_1}}\right )-2 c_1 \]
Mathematica. Time used: 0.715 (sec). Leaf size: 26
ode=(1+2 x)D[y[x],x]==4 Exp[-y[x]]-2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \log \left (2+\frac {e^{c_1}}{2 x+1}\right ) \\ y(x)\to \log (2) \\ \end{align*}
Sympy. Time used: 0.290 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((2*x + 1)*Derivative(y(x), x) + 2 - 4*exp(-y(x)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \log {\left (\frac {C_{1}}{2 x + 1} + 2 \right )} \]