\(x^2-2xy+y^2-z^2=\left(x-y\right)^2-z^2=\left(x-y-z\right)\left(x-y+z\right)\)
\(3x^2+6xy+3y^2-3z^2=3\left(x^2+2xy+y^2-z^2\right)=3.\left[\left(x+y\right)^2-z^2\right]=3.\left(x+y-z\right)\left(x+y+z\right)\)
\(3x^2-3xy-5x+5y=3x\left(x-y\right)-5\left(x-y\right)=\left(x-y\right)\left(3x-5\right)\)