\(\dfrac{x-2}{x-4}.\left(x^2-5x+4\right)=\dfrac{x-2}{x-4}.\left[\left(x^2-x\right)-\left(4x-4\right)\right]=\dfrac{x-2}{x-4}.\left[x\left(x-1\right)-4\left(x-1\right)\right]=\dfrac{x-2}{x-4}.\left(x-4\right)\left(x-1\right)=\left(x-2\right)\left(x-1\right)\)