83.36.6 problem 6

Internal problem ID [19369]
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 (A) at page 125
Problem number : 6
Date solved : Monday, March 31, 2025 at 07:11:40 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y^{\prime \prime }+x y^{\prime }-y&=X \end{align*}

Maple. Time used: 0.005 (sec). Leaf size: 36
ode:=diff(diff(y(x),x),x)+x*diff(y(x),x)-y(x) = X; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \pi \,\operatorname {erf}\left (\frac {\sqrt {2}\, x}{2}\right ) c_1 x +\sqrt {\pi }\, \sqrt {2}\, {\mathrm e}^{-\frac {x^{2}}{2}} c_1 +c_2 x -X \]
Mathematica. Time used: 0.069 (sec). Leaf size: 48
ode=D[y[x],{x,2}]+x*D[y[x],x]-y[x]==X; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\sqrt {\frac {\pi }{2}} c_2 x \text {erf}\left (\frac {x}{\sqrt {2}}\right )-c_2 e^{-\frac {x^2}{2}}+c_1 x-X \]
Sympy
from sympy import * 
x = symbols("x") 
X = symbols("X") 
y = Function("y") 
ode = Eq(-X + x*Derivative(y(x), x) - y(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (X + y(x) - Derivative(y(x), (x, 2)))/x cannot be solved by the factorable group method