83.40.5 problem 5

Internal problem ID [19398]
Book : A Text book for differentional equations for postgraduate students by Ray and Chaturvedi. First edition, 1958. BHASKAR press. INDIA
Section : Chapter VIII. Linear equations of second order. Excercise VIII (E) at page 140
Problem number : 5
Date solved : Thursday, March 13, 2025 at 02:23:50 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.004 (sec). Leaf size: 38
ode:=diff(diff(y(x),x),x)-y(x) = 2/(1+exp(x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = c_{2} {\mathrm e}^{-x}+{\mathrm e}^{x} c_{1} +\left ({\mathrm e}^{x}-{\mathrm e}^{-x}\right ) \ln \left ({\mathrm e}^{x}+1\right )-\ln \left ({\mathrm e}^{x}\right ) {\mathrm e}^{x}-1 \]
Mathematica. Time used: 0.029 (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]
 
\[ 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 \]
Sympy. Time used: 0.255 (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 \]