12.3.27 problem 35

Internal problem ID [1604]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 2, First order equations. separable equations. Section 2.2 Page 52
Problem number : 35
Date solved : Saturday, March 29, 2025 at 11:07:04 PM
CAS classification : [[_Abel, `2nd type`, `class B`]]

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

Maple. Time used: 0.006 (sec). Leaf size: 46
ode:=diff(y(x),x)+y(x) = 2*x*exp(-x)/(1+y(x)*exp(x)); 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= -\left (1+\sqrt {2 x^{2}-2 c_1 +1}\right ) {\mathrm e}^{-x} \\ y &= \left (-1+\sqrt {2 x^{2}-2 c_1 +1}\right ) {\mathrm e}^{-x} \\ \end{align*}
Mathematica. Time used: 32.449 (sec). Leaf size: 70
ode=D[y[x],x]+y[x]==(2*x*Exp[-x])/(1+y[x]*Exp[x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -e^{-2 x} \left (e^x+\sqrt {e^{2 x} \left (2 x^2+1+c_1\right )}\right ) \\ y(x)\to e^{-2 x} \left (-e^x+\sqrt {e^{2 x} \left (2 x^2+1+c_1\right )}\right ) \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*x*exp(-x)/(y(x)*exp(x) + 1) + y(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (2*x - y(x)**2*exp(2*x) - y(x)*exp(x))*exp(-x)/(y(x)*exp(x) + 1) cannot be solved by the factorable group method