40.14.3 problem 24

Internal problem ID [6774]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 19. Linear equations with variable coefficients (Misc. types). Supplemetary problems. Page 132
Problem number : 24
Date solved : Sunday, March 30, 2025 at 11:22:18 AM
CAS classification : [[_2nd_order, _missing_y]]

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

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