26.4.2 problem 2(b)

Internal problem ID [4270]
Book : Differential equations with applications and historial notes, George F. Simmons. Second edition. 1971
Section : Chapter 2, section 11, page 49
Problem number : 2(b)
Date solved : Tuesday, March 04, 2025 at 06:03:45 PM
CAS classification : [_linear]

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

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