88.9.6 problem 6

Internal problem ID [24026]
Book : Elementary Differential Equations. By Lee Roy Wilcox and Herbert J. Curtis. 1961 first edition. International texbook company. Scranton, Penn. USA. CAT number 61-15976
Section : Chapter 2. Differential equations of first order. Exercise at page 48
Problem number : 6
Date solved : Thursday, October 02, 2025 at 09:54:33 PM
CAS classification : [_linear]

\begin{align*} y^{\prime }+\frac {y}{x}&=\ln \left (x \right )-2 \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 18
ode:=diff(y(x),x)+y(x)/x = ln(x)-2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\ln \left (x \right ) x}{2}-\frac {5 x}{4}+\frac {c_1}{x} \]
Mathematica. Time used: 0.02 (sec). Leaf size: 24
ode=D[y[x],{x,1}] +1/x*y[x]==Log[x]-2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {5 x}{4}+\frac {1}{2} x \log (x)+\frac {c_1}{x} \end{align*}
Sympy. Time used: 0.123 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-log(x) + Derivative(y(x), x) + 2 + y(x)/x,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} + \frac {x^{2} \left (2 \log {\left (x \right )} - 5\right )}{4}}{x} \]