50.14.28 problem 4(d)

Internal problem ID [8066]
Book : Differential Equations: Theory, Technique, and Practice by George Simmons, Steven Krantz. McGraw-Hill NY. 2007. 1st Edition.
Section : Chapter 2. Problems for Review and Discovery. Drill excercises. Page 105
Problem number : 4(d)
Date solved : Wednesday, March 05, 2025 at 05:27:46 AM
CAS classification : [[_2nd_order, _missing_y]]

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

Using reduction of order method given that one solution is

\begin{align*} y&=\ln \left (x \right ) \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 26
ode:=diff(diff(y(x),x),x)+diff(y(x),x) = (x-1)/x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \int \left (1+{\mathrm e}^{-x} \operatorname {Ei}_{1}\left (-x \right )+c_{1} {\mathrm e}^{-x}\right )d x +c_{2} \]
Mathematica. Time used: 0.137 (sec). Leaf size: 30
ode=D[y[x],{x,2}]+D[y[x],x]==(x-1)/x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-x} \operatorname {ExpIntegralEi}(x)+x-\log (x)-c_1 e^{-x}+c_2 \]
Sympy. Time used: 0.509 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) + Derivative(y(x), (x, 2)) - (x - 1)/x,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} + x + \left (C_{2} + \operatorname {Ei}{\left (x \right )}\right ) e^{- x} - \log {\left (x \right )} \]