88.3.8 problem 8

Internal problem ID [23962]
Book : Elementary Differential Equations. By Lee Roy Wilcox and Herbert J. Curtis. 1961 first edition. International texbook company. Scranton, Penn. USA. CAT number 61-15976
Section : Chapter 1. Introduction. Exercise at page 22
Problem number : 8
Date solved : Thursday, October 02, 2025 at 09:47:54 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} x y^{\prime \prime }-2 \left (1+x \right ) y^{\prime }+\left (x +2\right ) y&=1 \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 34
ode:=x*diff(diff(y(x),x),x)-2*(1+x)*diff(y(x),x)+(x+2)*y(x) = 1; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {1}{3}-\frac {\operatorname {Ei}_{1}\left (x \right ) x^{3} {\mathrm e}^{x}}{6}+\left (c_1 \,x^{3}+c_2 \right ) {\mathrm e}^{x}+\frac {x^{2}}{6}-\frac {x}{6} \]
Mathematica. Time used: 0.055 (sec). Leaf size: 45
ode=x*D[y[x],{x,2}]-2*(x+1)*D[y[x],{x,1}]+(x+2)*y[x]==1; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{6} \left (e^x x^3 \operatorname {ExpIntegralEi}(-x)+2 c_2 e^x x^3+x^2-x+6 c_1 e^x+2\right ) \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), (x, 2)) + (x + 2)*y(x) - (2*x + 2)*Derivative(y(x), x) - 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (x*y(x) + x*Derivative(y(x), (x, 2)) + 2*y