20.9.5 problem Problem 5

Internal problem ID [3749]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 8, Linear differential equations of order n. Section 8.7, The Variation of Parameters Method. page 556
Problem number : Problem 5
Date solved : Sunday, March 30, 2025 at 02:07:16 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.004 (sec). Leaf size: 35
ode:=diff(diff(y(x),x),x)-4*y(x) = 8/(exp(2*x)+1); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{2 x} \left (\ln \left (\cosh \left (x \right )\right )+c_2 -x -1\right )-1+{\mathrm e}^{-2 x} \left (-\ln \left (\cosh \left (x \right )\right )+c_1 -x \right ) \]
Mathematica. Time used: 0.111 (sec). Leaf size: 56
ode=D[y[x],{x,2}]-4*y[x]==8/(Exp[2*x]+1); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-2 x} \left (2 e^{4 x} \text {arctanh}\left (2 e^{2 x}+1\right )-e^{2 x}-\log \left (e^{2 x}+1\right )+c_1 e^{4 x}+c_2\right ) \]
Sympy. Time used: 0.315 (sec). Leaf size: 37
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-4*y(x) + Derivative(y(x), (x, 2)) - 8/(exp(2*x) + 1),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^{- 2 x} + \left (C_{2} - 2 x + \log {\left (e^{2 x} + 1 \right )}\right ) e^{2 x} - 1 \]