78.14.18 problem 6 (c)

Internal problem ID [18283]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 3. Second order linear equations. Section 19. The Method of Variation of Parameters. Problems at page 135
Problem number : 6 (c)
Date solved : Monday, March 31, 2025 at 05:24:47 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

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