40.10.3 problem 12

Internal problem ID [6725]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 15. Linear equations with constant coefficients (Variation of parameters). Supplemetary problems. Page 98
Problem number : 12
Date solved : Sunday, March 30, 2025 at 11:20:42 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.004 (sec). Leaf size: 45
ode:=diff(diff(y(x),x),x)-4*diff(y(x),x)+3*y(x) = 1/(1+exp(-x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{x} \left (c_2 -\frac {1}{4}-\frac {\ln \left ({\mathrm e}^{x}\right )}{2}+\frac {\ln \left ({\mathrm e}^{x}+1\right )}{2}+\left (c_1 +\frac {\ln \left ({\mathrm e}^{x}\right )}{2}-\frac {\ln \left ({\mathrm e}^{x}+1\right )}{2}\right ) {\mathrm e}^{2 x}+\frac {{\mathrm e}^{x}}{2}\right ) \]
Mathematica. Time used: 0.328 (sec). Leaf size: 49
ode=D[y[x],{x,2}]-4*D[y[x],x]+3*y[x]==1/(1+Exp[-x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{4} e^x \left (-4 \left (e^{2 x}-1\right ) \text {arctanh}\left (2 e^x+1\right )+2 e^x+4 c_2 e^{2 x}-1+4 c_1\right ) \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(3*y(x) - 4*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) - (3*y(x)*exp(x) + 3*y(x) + exp(x)*Derivative(y(x), (x, 2)) - exp(x) + Derivative(y(x), (x, 2)))/(4*(exp(x) + 1)) cannot be solved by the factorable group method