57.5.21 problem 6

Internal problem ID [14376]
Book : A First Course in Differential Equations by J. David Logan. Third Edition. Springer-Verlag, NY. 2015.
Section : Chapter 1, First order differential equations. Section 1.4.1. Integrating factors. Exercises page 41
Problem number : 6
Date solved : Thursday, October 02, 2025 at 09:34:19 AM
CAS classification : [_linear]

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

With initial conditions

\begin{align*} x \left (1\right )&=0 \\ \end{align*}
Maple. Time used: 0.045 (sec). Leaf size: 23
ode:=diff(x(t),t)+exp(-t)/t*x(t) = t; 
ic:=[x(1) = 0]; 
dsolve([ode,op(ic)],x(t), singsol=all);
 
\[ x = \int _{1}^{t}\textit {\_z1} \,{\mathrm e}^{-\operatorname {Ei}_{1}\left (\textit {\_z1} \right )}d \textit {\_z1} {\mathrm e}^{\operatorname {Ei}_{1}\left (t \right )} \]
Mathematica. Time used: 0.079 (sec). Leaf size: 31
ode=D[x[t],t]+Exp[-t]/t*x[t]==t; 
ic={x[1]==0}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to e^{-\operatorname {ExpIntegralEi}(-t)} \int _1^te^{\operatorname {ExpIntegralEi}(-K[1])} K[1]dK[1] \end{align*}
Sympy. Time used: 9.511 (sec). Leaf size: 105
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-t + Derivative(x(t), t) + x(t)*exp(-t)/t,0) 
ics = {x(1): 0} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = \frac {\left (e^{i \pi } \int t e^{\operatorname {Ei}{\left (t e^{i \pi } \right )}}\, dt - e^{i \pi } \int \limits ^{1} t e^{\operatorname {Ei}{\left (t e^{i \pi } \right )}}\, dt - e^{i \pi } \int \frac {x{\left (t \right )} e^{- t + \operatorname {Ei}{\left (t e^{i \pi } \right )}}}{t}\, dt + e^{i \pi } \int \limits ^{1} \frac {x{\left (t \right )} e^{- t} e^{\operatorname {Ei}{\left (t e^{i \pi } \right )}}}{t}\, dt\right ) e^{- \operatorname {Ei}{\left (t e^{i \pi } \right )}}}{e^{i \pi } + 1} \]