81.12.5 problem 16-5 and 16-7

Internal problem ID [21658]
Book : The Differential Equations Problem Solver. VOL. I. M. Fogiel director. REA, NY. 1978. ISBN 78-63609
Section : Chapter 16. Variation of Parameters. Page 375.
Problem number : 16-5 and 16-7
Date solved : Thursday, October 02, 2025 at 07:59:32 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

With initial conditions

\begin{align*} y \left (1\right )&=0 \\ y^{\prime }\left (1\right )&=1 \\ \end{align*}
Maple. Time used: 0.028 (sec). Leaf size: 22
ode:=diff(diff(y(x),x),x)-2*diff(y(x),x)+y(x) = exp(x)/x; 
ic:=[y(1) = 0, D(y)(1) = 1]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = {\mathrm e}^{x} \left (\left (x -1\right ) {\mathrm e}^{-1}+\ln \left (x \right ) x -x +1\right ) \]
Mathematica. Time used: 0.014 (sec). Leaf size: 24
ode=D[y[x],{x,2}]-2*D[y[x],x]+y[x]==Exp[x]/x; 
ic={y[1]==0,Derivative[1][y][1] ==1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{x-1} (-e x+x+e x \log (x)+e-1) \end{align*}
Sympy. Time used: 0.164 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) - 2*Derivative(y(x), x) + Derivative(y(x), (x, 2)) - exp(x)/x,0) 
ics = {y(1): 0, Subs(Derivative(y(x), x), x, 1): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (x \left (\log {\left (x \right )} + \frac {1 - e}{e}\right ) + \frac {-1 + e}{e}\right ) e^{x} \]