83.47.2 problem Ex 2 page 80

Internal problem ID [19500]
Book : A Text book for differentional equations for postgraduate students by Ray and Chaturvedi. First edition, 1958. BHASKAR press. INDIA
Section : Book Solved Excercises. Chapter VI. Homogeneous linear equations with variable coefficients
Problem number : Ex 2 page 80
Date solved : Thursday, March 13, 2025 at 02:42:55 PM
CAS classification : [[_2nd_order, _exact, _linear, _nonhomogeneous]]

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

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