47.5.6 problem 6

Internal problem ID [7495]
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 : 6
Date solved : Sunday, March 30, 2025 at 12:10:42 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

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