12.10.6 problem 6

Internal problem ID [1810]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 5 linear second order equations. Section 5.7 Variation of Parameters. Page 262
Problem number : 6
Date solved : Tuesday, March 04, 2025 at 01:43:33 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-y&=\frac {4 \,{\mathrm e}^{-x}}{1-{\mathrm e}^{-2 x}} \end{align*}

Maple. Time used: 0.005 (sec). Leaf size: 50
ode:=diff(diff(y(x),x),x)-y(x) = 4*exp(-x)/(1-exp(-2*x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \ln \left (1-{\mathrm e}^{-2 x}\right ) {\mathrm e}^{x}+c_2 \,{\mathrm e}^{x}-{\mathrm e}^{-x} \ln \left (-1+{\mathrm e}^{-2 x}\right )+{\mathrm e}^{-x} \ln \left ({\mathrm e}^{-2 x}\right )+{\mathrm e}^{-x} c_1 \]
Mathematica. Time used: 0.083 (sec). Leaf size: 49
ode=D[y[x],{x,2}]-y[x]==4*Exp[-x]/(1-Exp[-2*x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-x} \left (2 e^{2 x} \text {arctanh}\left (1-2 e^{2 x}\right )-\log \left (e^{2 x}-1\right )+c_1 e^{2 x}+c_2\right ) \]
Sympy. Time used: 0.265 (sec). Leaf size: 32
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-y(x) + Derivative(y(x), (x, 2)) - 4*exp(-x)/(1 - exp(-2*x)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} - \log {\left (e^{2 x} - 1 \right )}\right ) e^{- x} + \left (C_{2} - 2 x + \log {\left (e^{2 x} - 1 \right )}\right ) e^{x} \]