6.10.3 problem 3

Internal problem ID [1807]
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 : 3
Date solved : Tuesday, September 30, 2025 at 05:19:45 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-3 y^{\prime }+2 y&=\frac {4}{1+{\mathrm e}^{-x}} \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 36
ode:=diff(diff(y(x),x),x)-3*diff(y(x),x)+2*y(x) = 4/(1+exp(-x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{x} \left (\left (4 \,{\mathrm e}^{x}+4\right ) \ln \left ({\mathrm e}^{x}+1\right )+\left (-4 \,{\mathrm e}^{x}-4\right ) \ln \left ({\mathrm e}^{x}\right )+{\mathrm e}^{x} c_1 +c_2 -4\right ) \]
Mathematica. Time used: 0.02 (sec). Leaf size: 34
ode=D[y[x],{x,2}]-3*D[y[x],x]+2*y[x]==4/(1+Exp[-x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^x \left (8 \left (e^x+1\right ) \text {arctanh}\left (2 e^x+1\right )+c_2 e^x-4+c_1\right ) \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*y(x) - 3*Derivative(y(x), x) + Derivative(y(x), (x, 2)) - 4/(1 + exp(-x)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (2*y(x)*exp(x) + 2*y(x) + exp(x)*Derivative(y(x), (x, 2)) - 4*exp(x) + Derivative(y(x), (x, 2)))/(3*(exp(x) + 1)) cannot be solved by the factorable group method