\(x^2-2xy+y^2+4x-4y-5\)
\(=\left(x-y\right)^2+4\left(x-y\right)+4-9\)
\(=\left(x-y+2\right)^2-9\)
\(=\left(x-y+2-3\right)\left(x-y+2+3\right)\)
\(=\left(x-y-1\right)\left(x-y+5\right)\)
\(x^2-2xy+y^2+4x-4y-5\)
\(=\left(x-y\right)^2+4\left(x-y\right)+4-9\)
\(=\left(x-y+2\right)^2-9\)
\(=\left(x-y+2-3\right)\cdot\left(x-y+2+3\right)\)
\(=\left(x-y-1\right)\cdot\left(x-y+5\right)\)
\(x^2-2xy+y^2+4x-4y-5\\ =\left(x^2+y^2+4-2xy+4x-4y\right)-9\\ =\left(x-y+2\right)^2-9\\ =\left(x-y+5\right)\left(x-y-1\right)\)