58.12.20 problem 20

Internal problem ID [14805]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 4, Section 4.4. Variation of parameters. Exercises page 162
Problem number : 20
Date solved : Thursday, October 02, 2025 at 09:55:06 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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