50.14.16 problem 2(h)

Internal problem ID [8054]
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 : 2(h)
Date solved : Sunday, March 30, 2025 at 12:41:37 PM
CAS classification : [[_2nd_order, _missing_y]]

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

With initial conditions

\begin{align*} y \left (1\right )&={\mathrm e}\\ y^{\prime }\left (1\right )&={\mathrm e}^{-1} \end{align*}

Maple. Time used: 0.180 (sec). Leaf size: 47
ode:=diff(diff(y(x),x),x)-2*diff(y(x),x) = ln(x); 
ic:=y(1) = exp(1), D(y)(1) = 1/exp(1); 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {\int _{1}^{x}\left (-{\mathrm e}^{2 \textit {\_z1}} \operatorname {Ei}_{1}\left (2 \textit {\_z1} \right )+{\mathrm e}^{2 \textit {\_z1}} \operatorname {Ei}_{1}\left (2\right )+2 \,{\mathrm e}^{-3+2 \textit {\_z1}}-\ln \left (\textit {\_z1} \right )\right )d \textit {\_z1}}{2}+{\mathrm e} \]
Mathematica. Time used: 0.094 (sec). Leaf size: 66
ode=D[y[x],{x,2}]-2*D[y[x],x]==Log[x]; 
ic={y[1]==Exp[1],Derivative[1][y][1]==1/Exp[1]}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{4} \left (e^{2 x} \operatorname {ExpIntegralEi}(-2 x)-\operatorname {ExpIntegralEi}(-2) e^{2 x}+2 x+2 e^{2 x-3}-2 x \log (x)-\log (-x)+i \pi +4 e-\frac {2}{e}-2\right ) \]
Sympy. Time used: 1.234 (sec). Leaf size: 61
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-log(x) - 2*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {y(1): E, Subs(Derivative(y(x), x), x, 1): exp(-1)} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - \frac {x \log {\left (x \right )}}{2} + \frac {x}{2} + \left (\frac {\operatorname {Ei}{\left (- 2 x \right )}}{4} + \frac {- e^{3} \operatorname {Ei}{\left (-2 \right )} + 2}{4 e^{3}}\right ) e^{2 x} - \frac {\log {\left (x \right )}}{4} + \frac {- e - 1 + 2 e^{2}}{2 e} \]