\(x^2-2xy-4z^2+y^2\)
\(=x^2-2xy+y^2-4z^2\)
\(=\left(x^2-2xy+y^2\right)-\left(2z\right)^2\)
\(=\left(x-y\right)^2-\left(2z\right)^2\)
\(=\left(x-y-2z\right)\left(x-y+2z\right)\)
\(x^2-2xy-4z^2+y^2\)
\(=\left(x-y\right)^2-4z^2\)
\(=\left(x-y-2z\right)\left(x-y+2z\right)\)