47.5.2 problem 2

Internal problem ID [7491]
Book : Ordinary differential equations and calculus of variations. Makarets and Reshetnyak. Wold Scientific. Singapore. 1995
Section : Chapter 2. Linear homogeneous equations. Section 2.3.4 problems. page 104
Problem number : 2
Date solved : Sunday, March 30, 2025 at 12:10:33 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

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