\(x\left(y-1\right)-y\left(y-1\right)\)
\(=\left(y-1\right)\left(x-y\right)\)
_________________
\(5x\left(x-2\right)-x+2\)
\(=5x\left(x-2\right)-\left(x-2\right)\)
\(=\left(x-2\right)\left(5x-1\right)\)
_________________
\(5x\left(x+1\right)-8x-8\)
\(=5x\left(x+1\right)-\left(8x+8\right)\)
\(=5x\left(x+1\right)-8\left(x+1\right)\)
\(=\left(x+1\right)\left(5x-8\right)\)