50.14.23 problem 3(g)

Internal problem ID [8061]
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 : 3(g)
Date solved : Sunday, March 30, 2025 at 12:41:50 PM
CAS classification : [[_2nd_order, _exact, _linear, _nonhomogeneous]]

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

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