65.4.4 problem 9.1 (iv)

Internal problem ID [13655]
Book : AN INTRODUCTION TO ORDINARY DIFFERENTIAL EQUATIONS by JAMES C. ROBINSON. Cambridge University Press 2004
Section : Chapter 9, First order linear equations and the integrating factor. Exercises page 86
Problem number : 9.1 (iv)
Date solved : Wednesday, March 05, 2025 at 10:10:07 PM
CAS classification : [_linear]

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

With initial conditions

\begin{align*} y \left (0\right )&={\mathrm e} \end{align*}

Maple. Time used: 0.111 (sec). Leaf size: 23
ode:=diff(y(x),x)+y(x)*exp(-x) = 1; 
ic:=y(0) = exp(1); 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \left (\operatorname {Ei}_{1}\left ({\mathrm e}^{-x}\right )+1-\operatorname {Ei}_{1}\left (1\right )\right ) {\mathrm e}^{{\mathrm e}^{-x}} \]
Mathematica. Time used: 0.069 (sec). Leaf size: 32
ode=D[y[x],x]+Exp[-x]*y[x]==1; 
ic={y[0]==Exp[1]}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{e^{-x}} \left (\int _0^xe^{-e^{-K[1]}}dK[1]+1\right ) \]
Sympy. Time used: 5.073 (sec). Leaf size: 24
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x)*exp(-x) + Derivative(y(x), x) - 1,0) 
ics = {y(0): E} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (- \operatorname {Ei}{\left (- e^{- x} \right )} + \operatorname {Ei}{\left (-1 \right )} + 1\right ) e^{e^{- x}} \]