83.1.5 problem 2 (e)

Internal problem ID [21910]
Book : Differential Equations By Kaj L. Nielsen. Second edition 1966. Barnes and nobel. 66-28306
Section : Chapter II. Definitions and fundamentals
Problem number : 2 (e)
Date solved : Thursday, October 02, 2025 at 08:09:16 PM
CAS classification : [[_linear, `class A`]]

\begin{align*} y^{\prime }+y&=2 \,{\mathrm e}^{-x} \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 14
ode:=diff(y(x),x)+y(x) = 2*exp(-x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (2 x +c_1 \right ) {\mathrm e}^{-x} \]
Mathematica. Time used: 0.033 (sec). Leaf size: 17
ode=D[y[x],x]+y[x]==2*Exp[-x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{-x} (2 x+c_1) \end{align*}
Sympy. Time used: 0.076 (sec). Leaf size: 10
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) + Derivative(y(x), x) - 2*exp(-x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + 2 x\right ) e^{- x} \]