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