62.36.3 problem Ex 3

Internal problem ID [12922]
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 : Wednesday, March 05, 2025 at 08:51:34 PM
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.148 (sec). Leaf size: 52
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]
 
\[ y(x)\to \frac {(x-1) \int _1^x\cos (K[1])dK[1]+\int _1^x-\cos (K[2]) (K[2]-1)dK[2]+c_1 x-c_1+c_2}{(x-1)^2} \]
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