89.26.7 problem 9

Internal problem ID [24874]
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 : 9
Date solved : Thursday, October 02, 2025 at 10:48:56 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-y&=\frac {2}{1+{\mathrm e}^{x}} \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 50
ode:=diff(diff(y(x),x),x)-y(x) = 2/(exp(x)+1); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{x} c_2 +{\mathrm e}^{-x} c_1 -1+\left (\ln \left ({\mathrm e}^{-x}\right )-\ln \left (1+{\mathrm e}^{-x}\right )\right ) {\mathrm e}^{-x}+\left (-\ln \left ({\mathrm e}^{x}\right )+\ln \left (1+{\mathrm e}^{x}\right )\right ) {\mathrm e}^{x} \]
Mathematica. Time used: 0.054 (sec). Leaf size: 47
ode=D[y[x],{x,2}]-y[x]== 2/(1+Exp[x] ); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to 2 e^x \text {arctanh}\left (2 e^x+1\right )-e^{-x} \log \left (e^x+1\right )+c_1 e^x+c_2 e^{-x}-1 \end{align*}
Sympy. Time used: 0.172 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-y(x) + Derivative(y(x), (x, 2)) - 2/(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} + \left (C_{2} - x + \log {\left (e^{x} + 1 \right )}\right ) e^{x} - 1 \]