6.9.4 problem 4

Internal problem ID [1760]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 5 linear second order equations. Section 5.6 Reduction or order. Page 253
Problem number : 4
Date solved : Tuesday, September 30, 2025 at 05:19:07 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Using reduction of order method given that one solution is

\begin{align*} y&={\mathrm e}^{2 x} \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 34
ode:=diff(diff(y(x),x),x)-3*diff(y(x),x)+2*y(x) = 1/(1+exp(-x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{x} \left (\ln \left ({\mathrm e}^{x}+1\right ) \left ({\mathrm e}^{x}+1\right )+\left (-{\mathrm e}^{x}-1\right ) \ln \left ({\mathrm e}^{x}\right )+{\mathrm e}^{x} c_1 +c_2 -1\right ) \]
Mathematica. Time used: 0.056 (sec). Leaf size: 34
ode=D[y[x],{x,2}]-3*D[y[x],x]+2*y[x]==1/(1+Exp[-x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^x \left (2 \left (e^x+1\right ) \text {arctanh}\left (2 e^x+1\right )+c_2 e^x-1+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)) - 1/(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)) - exp(x) + Derivative(y(x), (x, 2)))/(3*(exp(x) + 1)) cannot be solved by the factorable group method