83.39.2 problem 2

Internal problem ID [19391]
Book : A Text book for differentional equations for postgraduate students by Ray and Chaturvedi. First edition, 1958. BHASKAR press. INDIA
Section : Chapter VIII. Linear equations of second order. Excercise VIII (D) at page 135
Problem number : 2
Date solved : Thursday, March 13, 2025 at 02:23:30 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.007 (sec). Leaf size: 49
ode:=x*diff(diff(y(x),x),x)+(x-2)*diff(y(x),x)-2*y(x) = x^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = 2 \,{\mathrm e}^{-x} \operatorname {Ei}_{1}\left (-x \right )+c_{2} {\mathrm e}^{-x}+\ln \left (x \right ) \left (x^{2}-2 x +2\right )+c_{1} x^{2}+\left (-2 c_{1} -1\right ) x +2 c_{1} +3 \]
Mathematica. Time used: 0.099 (sec). Leaf size: 29
ode=x*D[y[x],{x,2}]+(x-2)*D[y[x],x]-2*y[x]==x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to c_2 \left (x^2-2 x+2\right )-x+c_1 e^{-x}+1 \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2 + x*Derivative(y(x), (x, 2)) + (x - 2)*Derivative(y(x), x) - 2*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (x**2 - x*Derivative(y(x), (x, 2)) + 2*y(x))/(x - 2) cannot be solved by the factorable group method