Bài 5:
a) \(x^2-xy+x-y\)
\(=\left(x^2-xy\right)+\left(x-y\right)\)
\(=x\left(x-y\right)+\left(x-y\right)\)
\(=\left(x+1\right)\left(x-y\right)\)
b) \(xz+yz+4x+4y\)
\(=\left(xz+yz\right)+\left(4x+4y\right)\)
\(=z\left(x+y\right)+4\left(x+y\right)\)
\(=\left(z+4\right)\left(x+y\right)\)
c) \(x^2-x-y^2+y\)
\(=\left(x^2-y^2\right)-\left(x-y\right)\)
\(=\left(x+y\right)\left(x-y\right)-\left(x-y\right)\)
\(=\left(x-y\right)\left(x+y-1\right)\)
d) \(x^2+2x+2z-z^2\)
\(=\left(x^2-z^2\right)+\left(2x+2z\right)\)
\(=\left(x+z\right)\left(x-z\right)+2\left(x+z\right)\)
\(=\left(x+z\right)\left(x-z+2\right)\)