4.32.43 \((1-x)^2 y''(x)-4 (1-x) y'(x)+2 y(x)=\cos (x)\)

ODE
\[ (1-x)^2 y''(x)-4 (1-x) y'(x)+2 y(x)=\cos (x) \] ODE Classification

[[_2nd_order, _exact, _linear, _nonhomogeneous]]

Book solution method
TO DO

Mathematica
cpu = 0.0386188 (sec), leaf count = 24

\[\left \{\left \{y(x)\to \frac {c_1 (x-1)+c_2-\cos (x)}{(x-1)^2}\right \}\right \}\]

Maple
cpu = 0.025 (sec), leaf count = 19

\[ \left \{ y \left ( x \right ) ={\frac {{\it \_C2}+{\it \_C1}\,x-\cos \left ( x \right ) }{ \left ( -1+x \right ) ^{2}}} \right \} \] Mathematica raw input

DSolve[2*y[x] - 4*(1 - x)*y'[x] + (1 - x)^2*y''[x] == Cos[x],y[x],x]

Mathematica raw output

{{y[x] -> ((-1 + x)*C[1] + C[2] - Cos[x])/(-1 + x)^2}}

Maple raw input

dsolve((1-x)^2*diff(diff(y(x),x),x)-4*(1-x)*diff(y(x),x)+2*y(x) = cos(x), y(x),'implicit')

Maple raw output

y(x) = (_C2+_C1*x-cos(x))/(-1+x)^2