69.6.16 problem 149

Internal problem ID [18059]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Section 6. Linear equations of the first order. The Bernoulli equation. Exercises page 54
Problem number : 149
Date solved : Thursday, October 02, 2025 at 02:36:28 PM
CAS classification : [[_linear, `class A`]]

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

With initial conditions

\begin{align*} y \left (\infty \right )&=0 \\ \end{align*}
Maple. Time used: 0.071 (sec). Leaf size: 8
ode:=diff(y(x),x)-y(x) = -2*exp(-x); 
ic:=[y(infinity) = 0]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = {\mathrm e}^{-x} \]
Mathematica. Time used: 0.039 (sec). Leaf size: 10
ode=D[y[x],x]-y[x]==-2*Exp[-x]; 
ic={y[Infinity]==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{-x} \end{align*}
Sympy. Time used: 0.078 (sec). Leaf size: 7
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-y(x) + Derivative(y(x), x) + 2*exp(-x),0) 
ics = {y(oo): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = e^{- x} \]