41.5.5 problem 5

Internal problem ID [8780]
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 : 5
Date solved : Tuesday, September 30, 2025 at 05:50:51 PM
CAS classification : [[_2nd_order, _exact, _linear, _nonhomogeneous]]

\begin{align*} x \left (1+x \right ) y^{\prime \prime }+\left (x +2\right ) y^{\prime }-y&=x +\frac {1}{x} \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 42
ode:=x*(1+x)*diff(diff(y(x),x),x)+(x+2)*diff(y(x),x)-y(x) = x+1/x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {2 \ln \left (x \right ) x^{2}+4 c_2 \,x^{2}+4 \ln \left (x \right ) x +8 c_2 x +4 c_1 +4 c_2 +6 x +5}{4 x} \]
Mathematica. Time used: 0.767 (sec). Leaf size: 185
ode=x*(1+x)*D[y[x],{x,2}]+(x+2)*D[y[x],x]-y[x]==x+1/x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {\exp \left (-\frac {1}{2} \int _1^x\frac {K[1]+2}{K[1]^2+K[1]}dK[1]\right ) \left ((x+2) x \int _1^x\frac {\exp \left (\frac {1}{2} \int _1^{K[3]}\frac {K[1]+2}{K[1]^2+K[1]}dK[1]\right ) \left (K[3]^2+1\right )}{K[3]^2 (K[3]+1)^{3/2}}dK[3]+2 \int _1^x-\frac {\exp \left (\frac {1}{2} \int _1^{K[2]}\frac {K[1]+2}{K[1]^2+K[1]}dK[1]\right ) \left (K[2]^3+2 K[2]^2+K[2]+2\right )}{2 K[2] (K[2]+1)^{3/2}}dK[2]+c_2 x^2+2 c_2 x+2 c_1\right )}{2 \sqrt {x+1}} \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*(x + 1)*Derivative(y(x), (x, 2)) - x + (x + 2)*Derivative(y(x), x) - y(x) - 1/x,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (-x**3*Derivative(y(x), (x, 2)) - x**2*Derivative(y(x), (x, 2)) + x**2 + x*y(x) + 1)/(x*(x + 2)) cannot be solved by the factorable group method