83.41.11 problem 2 (x)

Internal problem ID [19420]
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 at end of chapter VIII. Page 141
Problem number : 2 (x)
Date solved : Monday, March 31, 2025 at 07:13:12 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.007 (sec). Leaf size: 27
ode:=diff(diff(y(x),x),x)+2*x*diff(y(x),x)+(x^2+5)*y(x) = x*exp(-1/2*x^2); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-\frac {x^{2}}{2}} \left (c_2 \cos \left (2 x \right )+c_1 \sin \left (2 x \right )+\frac {x}{4}\right ) \]
Mathematica. Time used: 0.101 (sec). Leaf size: 48
ode=D[y[x],{x,2}]+2*x*D[y[x],x]+(x^2+5)*y[x]==x*Exp[-1/2*x^2]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{4} e^{-\frac {1}{2} x (x+4 i)} \left (e^{2 i x} x-i c_2 e^{4 i x}+4 c_1\right ) \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x*Derivative(y(x), x) - x*exp(-x**2/2) + (x**2 + 5)*y(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE x*y(x)/2 + Derivative(y(x), x) - exp(-x**2/2)/2 + 5*y(x)/(2*x) + Derivative(y(x), (x, 2))/(2*x) cannot be solved by the factorable group method