56.36.3 problem Ex 3

Internal problem ID [14282]
Book : An elementary treatise on differential equations by Abraham Cohen. DC heath publishers. 1906
Section : Chapter IX, Miscellaneous methods for solving equations of higher order than first. Article 60. Exact equation. Integrating factor. Page 139
Problem number : Ex 3
Date solved : Thursday, October 02, 2025 at 09:27:41 AM
CAS classification : [[_2nd_order, _exact, _linear, _nonhomogeneous]]

\begin{align*} \left (x -1\right )^{2} y^{\prime \prime }+4 \left (x -1\right ) y^{\prime }+2 y&=\cos \left (x \right ) \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 19
ode:=(x-1)^2*diff(diff(y(x),x),x)+4*(x-1)*diff(y(x),x)+2*y(x) = cos(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {c_2 +c_1 x -\cos \left (x \right )}{\left (x -1\right )^{2}} \]
Mathematica. Time used: 0.043 (sec). Leaf size: 24
ode=(x-1)^2*D[y[x],{x,2}]+4*(x-1)*D[y[x],x]+2*y[x]==Cos[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {-\cos (x)+c_1 (x-1)+c_2}{(x-1)^2} \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x - 1)**2*Derivative(y(x), (x, 2)) + (4*x - 4)*Derivative(y(x), x) + 2*y(x) - cos(x),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) + cos(x) - Derivative(y(x), (x, 2)))/(4*(x - 1)) cannot be solved by the factorable group method