10.6.12 problem 12

Internal problem ID [1229]
Book : Elementary differential equations and boundary value problems, 10th ed., Boyce and DiPrima
Section : Miscellaneous problems, end of chapter 2. Page 133
Problem number : 12
Date solved : Saturday, March 29, 2025 at 10:48:23 PM
CAS classification : [_linear]

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

Maple. Time used: 0.002 (sec). Leaf size: 25
ode:=y(x)+diff(y(x),x) = 1/(1+exp(x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (\ln \left (1+{\mathrm e}^{-x}\right )-\ln \left ({\mathrm e}^{-x}\right )+c_1 \right ) {\mathrm e}^{-x} \]
Mathematica. Time used: 0.081 (sec). Leaf size: 20
ode=y[x]+D[y[x],x] == 1/(1+Exp[x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-x} \left (\log \left (e^x+1\right )+c_1\right ) \]
Sympy. Time used: 0.246 (sec). Leaf size: 14
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) + Derivative(y(x), x) - 1/(exp(x) + 1),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + \log {\left (e^{x} + 1 \right )}\right ) e^{- x} \]