89.26.9 problem 11

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

\begin{align*} y^{\prime \prime }-y&=\frac {2}{{\mathrm e}^{x}-{\mathrm e}^{-x}} \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 26
ode:=diff(diff(y(x),x),x)-y(x) = 2/(exp(x)-exp(-x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-x} c_2 +{\mathrm e}^{x} c_1 -x \cosh \left (x \right )+\ln \left (\sinh \left (x \right )\right ) \sinh \left (x \right ) \]
Mathematica. Time used: 0.048 (sec). Leaf size: 53
ode=D[y[x],{x,2}]-y[x]== 2/(Exp[x]-Exp[-x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^x \text {arctanh}\left (1-2 e^{2 x}\right )-\frac {1}{2} e^{-x} \log \left (1-e^{2 x}\right )+c_1 e^x+c_2 e^{-x} \end{align*}
Sympy. Time used: 1.243 (sec). Leaf size: 53
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-y() + Derivative(y(x), (x, 2)) - 2/(exp(x) - exp(-x)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} + x^{2} y{\left ( \right )} + x \left (C_{2} + \log {\left (e^{x} - 1 \right )} - \log {\left (e^{x} + 1 \right )}\right ) - \int \frac {x \left (y{\left ( \right )} e^{2 x} - y{\left ( \right )} + 2 e^{x}\right )}{\left (e^{x} - 1\right ) \left (e^{x} + 1\right )}\, dx \]