\[(x - y + z)(x - y + z) =\]
\[= (x - y + z)^{2} =\]
\[= \left( (x - y) + z \right)^{2} =\]
\[= (x - y)^{2} + 2z(x - y) + z^{2} =\]
\[= x^{2} - 2xy + y^{2} + 2xz - 2yz + z^{2} =\]
\[= x^{2} + y^{2} + z^{2} - 2xy + 2xz - 2yz.\]