89.26.1 problem 1

Internal problem ID [24868]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 11. Variation of parameters and other methods. Miscellaneous Exercises at page 177
Problem number : 1
Date solved : Thursday, October 02, 2025 at 10:48:52 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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