89.26.11 problem 13

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

\begin{align*} y^{\prime \prime }-y&=\frac {1}{{\mathrm e}^{2 x}+1} \end{align*}
Maple. Time used: 0.063 (sec). Leaf size: 32
ode:=diff(diff(y(x),x),x)-y(x) = 1/(exp(2*x)+1); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (4 c_1 -2 \arctan \left ({\mathrm e}^{x}\right )\right ) {\mathrm e}^{-x}}{4}+{\mathrm e}^{x} c_2 -\frac {{\mathrm e}^{x} \arctan \left (\sinh \left (x \right )\right )}{4}-\frac {1}{2} \]
Mathematica. Time used: 0.181 (sec). Leaf size: 48
ode=D[y[x],{x,2}]-y[x]== 1/(1+Exp[2*x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{2} \left (e^x \arctan \left (e^{-x}\right )-e^{-x} \arctan \left (e^x\right )+2 c_1 e^x+2 c_2 e^{-x}-1\right ) \end{align*}
Sympy. Time used: 0.284 (sec). Leaf size: 44
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-y(x) + Derivative(y(x), (x, 2)) - 1/(exp(2*x) + 1),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} - \frac {\operatorname {atan}{\left (\tanh {\left (\frac {x}{2} \right )} \right )}}{2}\right ) e^{- x} + \left (C_{2} + \frac {i \log {\left (e^{x} - i \right )}}{4} - \frac {i \log {\left (e^{x} + i \right )}}{4}\right ) e^{x} - \frac {1}{2} \]