83.41.24 problem 5 (xi)

Internal problem ID [19425]
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 : 5 (xi)
Date solved : Friday, March 14, 2025 at 12:55:32 AM
CAS classification : [[_2nd_order, _exact, _linear, _nonhomogeneous]]

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

With initial conditions

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

Maple. Time used: 0.191 (sec). Leaf size: 12
ode:=x*diff(diff(y(x),x),x)+(x^2+1)*diff(y(x),x)+2*x*y(x) = 2*x; 
ic:=y(0) = 2, D(y)(0) = 0; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y \left (x \right ) = {\mathrm e}^{-\frac {x^{2}}{2}}+1 \]
Mathematica. Time used: 0.212 (sec). Leaf size: 16
ode=x*D[y[x],{x,2}]+(1+x^2)*D[y[x],x]+2*x*y[x]==2*x; 
ic={y[0]==2,Derivative[1][y][0]==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-\frac {x^2}{2}}+1 \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x*y(x) + x*Derivative(y(x), (x, 2)) - 2*x + (x**2 + 1)*Derivative(y(x), x),0) 
ics = {y(0): 2, Subs(Derivative(y(x), x), x, 0): 0} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -x*(-2*y(x) - Derivative(y(x), (x, 2)) + 2)/(x**2 + 1) + Derivative(y(x), x) cannot be solved by the factorable group method