62.24.4 problem Ex 4

Internal problem ID [12861]
Book : An elementary treatise on differential equations by Abraham Cohen. DC heath publishers. 1906
Section : Chapter VII, Linear differential equations with constant coefficients. Article 47. Particular integral. Page 100
Problem number : Ex 4
Date solved : Monday, March 31, 2025 at 07:22:57 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

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