77.1.132 problem 159 (page 236)

Internal problem ID [17943]
Book : V.V. Stepanov, A course of differential equations (in Russian), GIFML. Moscow (1958)
Section : All content
Problem number : 159 (page 236)
Date solved : Thursday, March 13, 2025 at 11:11:47 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.006 (sec). Leaf size: 23
ode:=diff(diff(y(x),x),x)-y(x) = (exp(x)-exp(-x))/(exp(x)+exp(-x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (c_{2} +\arctan \left ({\mathrm e}^{x}\right )\right ) {\mathrm e}^{-x}+{\mathrm e}^{x} \left (\arctan \left ({\mathrm e}^{x}\right )+c_{1} \right ) \]
Mathematica. Time used: 0.417 (sec). Leaf size: 34
ode=D[y[x],{x,2}]-y[x]==(Exp[x]-Exp[-x])/(Exp[x]+Exp[-x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-x} \left (\left (e^{2 x}+1\right ) \arctan \left (e^x\right )+c_1 e^{2 x}+c_2\right ) \]
Sympy. Time used: 1.719 (sec). Leaf size: 53
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-(exp(x) - exp(-x))/(exp(x) + exp(-x)) - y(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + \int \frac {\sinh ^{2}{\left (x \right )}}{\left (e^{x} - 1\right ) \left (e^{x} + 1\right ) \cosh {\left (x \right )}}\, dx\right ) e^{x} + \left (C_{2} + \frac {\operatorname {atan}{\left (\tanh {\left (\frac {x}{2} \right )} \right )}}{2} - \frac {\int \frac {e^{2 x}}{\cosh {\left (x \right )}}\, dx}{4}\right ) e^{- x} \]